From 55b299349faf5097ed1292b89f27953dc362e200 Mon Sep 17 00:00:00 2001
From: pompolic <pompolic@special-circumstanc.es>
Date: Wed, 16 Nov 2022 19:26:00 +0100
Subject: [PATCH] Fix intermittent ValueError when printing input

Highlighting why it's a bad idea to print unparsed input
---
 gdb-port/commands.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb-port/commands.py b/gdb-port/commands.py
index bcb548f..7474e1c 100644
--- a/gdb-port/commands.py
+++ b/gdb-port/commands.py
@@ -127,7 +127,7 @@ class HammerParserPreviewInput(gdb.Command):
 	def invoke(self, arg, from_tty):
 		args = gdb.string_to_argv(arg)
 
-		print(top_level_parse.input_chunk)
+		print(top_level_parse.input_chunk.replace("\x00", ".")) # Avoid embedded null error
 
 HammerParserPreviewInput()
 
-- 
GitLab