From 966ef85218271f9a9cc705732d23238af7813834 Mon Sep 17 00:00:00 2001 From: pompolic <pompolic@special-circumstanc.es> Date: Tue, 25 Oct 2022 16:03:43 +0200 Subject: [PATCH] Disable old printing behavior --- gdb-port/top-level-parse.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/gdb-port/top-level-parse.py b/gdb-port/top-level-parse.py index ea60795..2fa8c64 100644 --- a/gdb-port/top-level-parse.py +++ b/gdb-port/top-level-parse.py @@ -429,15 +429,8 @@ class TopLevelParse: info_strings.append(" ".join([hpr.str_no_deref(), str(tokenmap_entry)])) except: info_strings.append(" ".join(["invalid", str(tokenmap_entry)])) - if tokenmap_entry['end'] > end: - print("carrying token to next chunk, current_token:", tokenmap_entry) - if printing_index+1 < len(token_list): - next_token = token_list[printing_index+1] - next_tokenmap_entry = self.input_token_map[int(next_token.address)] - print("next_token:", next_tokenmap_entry) - break - else: - printing_index += 1 + + printing_index += 1 self.printing_index = printing_index info_dict = dict(enumerate(info_strings)) @@ -481,7 +474,7 @@ class TopLevelParse: #charbufrows = ["".join(row) for row in charbuf_dynamic] #charbuf_final = "\n".join(charbufrows) charbuf_final = "\n".join(charbufrows_token_debug) - print(charbuf_final) + #print(charbuf_final) def print_input_map(self, token, parent_bounds=None): w = gdb.parameter("width") @@ -506,6 +499,8 @@ class TopLevelParse: #printing_tokens.extend(tk.children[::-1]) printing_tokens.extend(tk.children) # No longer using this as a stack, so no reversing is needed i += 1 + #debug_printing_token_list = [token.str_no_deref() for token in printing_tokens] + #print(debug_printing_token_list) fragmentlen = end-start inputfragment = (self.input_ptr+start).string('UTF-8','replace',fragmentlen) #encoded_inputfragment = inputfragment.replace("\n", "<0A>").replace("\r", "<0D>").replace(" ", "<20>").replace("\t", "<09>") -- GitLab