From 49091315ba700e78b355e7133e64b4e20baf9d73 Mon Sep 17 00:00:00 2001
From: pompolic <pompolic@special-circumstanc.es>
Date: Mon, 25 Jul 2022 21:03:47 +0200
Subject: [PATCH] Fix AST getting mistakenly printed

- hammer-parse-apply wasn't clearing the pointer to the desired stack frame
- Reproduction steps: hammer-parse-step N, hammer-parse-apply, hammer-parse-step 1
---
 gdb-port/commands.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb-port/commands.py b/gdb-port/commands.py
index 17f6cc7..84ab837 100644
--- a/gdb-port/commands.py
+++ b/gdb-port/commands.py
@@ -226,6 +226,8 @@ class HammerParseApply(FlowControlWithPrint):
 		if gdb.selected_inferior().pid > 0:
 			gdb.execute("continue")
 
+		top_level_parse.clear_ast_stack_index()
+
 		self.conditionally_print_backtrace()
 
 HammerParseApply()
-- 
GitLab