From dea3346d0b84acca22b0aff00ad3171f71b0317b Mon Sep 17 00:00:00 2001 From: anjiahao Date: Fri, 12 May 2023 12:11:55 +0800 Subject: [PATCH] add prefix addr2line to parsememdump.py Signed-off-by: anjiahao --- tools/parsememdump.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/parsememdump.py b/tools/parsememdump.py index 5b8e9540a1..c5194e2d01 100755 --- a/tools/parsememdump.py +++ b/tools/parsememdump.py @@ -92,6 +92,9 @@ if __name__ == "__main__": description=program_description, formatter_class=argparse.RawTextHelpFormatter ) parser.add_argument("-f", "--file", help="dump file", nargs=1, required=True) + parser.add_argument( + "-p", "--prefix", help="addr2line program prefix", nargs=1, default="" + ) parser.add_argument( "-e", @@ -142,7 +145,7 @@ if __name__ == "__main__": log.output("\n") if args.elffile != "": addr2line_file = os.popen( - "addr2line -Cfe %s %s" % (args.elffile[0], memstr), "r" + "%saddr2line -Cfe %s %s" % (args.prefix, args.elffile[0], memstr), "r" ) while 1: add2line_str = addr2line_file.readline()