From 001dafb1c51bda37474afe4e67a2b6506f2ea006 Mon Sep 17 00:00:00 2001 From: pompolic <pompolic@special-circumstanc.es> Date: Thu, 9 Jun 2022 19:56:48 +0200 Subject: [PATCH] (WIP) Fix backtrace exception Printing failed when stopped in h_do_parse with a parser whose type hasn't been resolved yet --- gdb-port/commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb-port/commands.py b/gdb-port/commands.py index 9c2e098..a1559ff 100644 --- a/gdb-port/commands.py +++ b/gdb-port/commands.py @@ -30,7 +30,9 @@ class HammerParserBacktrace(gdb.Command): maxsize = len(parserstack) print("Argument must be a positive integer") - print("[" + str(hex(top_level_parse.h_do_parse_parser.address)) + "] " + top_level_parse.h_do_parse_parser.name + " [current]") #TODO: GUI widget should reflect this + parser_name = top_level_parse.h_do_parse_parser.name or "(Parser type resolution pending)" # TODO: should we just look at the vtable and name the parser in h_do_parse? + + print("[" + str(hex(top_level_parse.h_do_parse_parser.address)) + "] " + parser_name + " [current]") #TODO: GUI widget should reflect this print(" ") depth = min(len(parserstack), maxsize) if depth > 0: # if stack not empty -- GitLab