OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [gdb-5.0/] [mmalloc/] [mmtrace.awk] - Diff between revs 579 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 579 Rev 1765
#
#
#  Awk program to analyze mtrace.c output.
#  Awk program to analyze mtrace.c output.
#
#
$1 == "+"       { if (allocated[$2] != "")
$1 == "+"       { if (allocated[$2] != "")
                    print "+", $2, "Alloc", NR, "duplicate:", allocated[$2];
                    print "+", $2, "Alloc", NR, "duplicate:", allocated[$2];
                  else
                  else
                    allocated[$2] = $3;
                    allocated[$2] = $3;
                }
                }
$1 == "-"       { if (allocated[$2] != "") {
$1 == "-"       { if (allocated[$2] != "") {
                    allocated[$2] = "";
                    allocated[$2] = "";
                    if (allocated[$2] != "")
                    if (allocated[$2] != "")
                        print "DELETE FAILED", $2, allocated[$2];
                        print "DELETE FAILED", $2, allocated[$2];
                  } else
                  } else
                    print "-", $2, "Free", NR, "was never alloc'd";
                    print "-", $2, "Free", NR, "was never alloc'd";
                }
                }
$1 == "<"       { if (allocated[$2] != "")
$1 == "<"       { if (allocated[$2] != "")
                    allocated[$2] = "";
                    allocated[$2] = "";
                  else
                  else
                    print "-", $2, "Realloc", NR, "was never alloc'd";
                    print "-", $2, "Realloc", NR, "was never alloc'd";
                }
                }
$1 == ">"       { if (allocated[$2] != "")
$1 == ">"       { if (allocated[$2] != "")
                    print "+", $2, "Realloc", NR, "duplicate:", allocated[$2];
                    print "+", $2, "Realloc", NR, "duplicate:", allocated[$2];
                  else
                  else
                    allocated[$2] = $3;
                    allocated[$2] = $3;
                }
                }
 
 
# Ignore "= Start"
# Ignore "= Start"
$1 == "="       { }
$1 == "="       { }
# Ignore failed realloc attempts for now
# Ignore failed realloc attempts for now
$1 == "!"       { }
$1 == "!"       { }
 
 
 
 
END             { for (x in allocated)
END             { for (x in allocated)
                    if (allocated[x] != "")
                    if (allocated[x] != "")
                      print "+", x, allocated[x];
                      print "+", x, allocated[x];
                }
                }
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.