From a9339c1febf60971aba97a128af78008b36b0461 Mon Sep 17 00:00:00 2001 From: Roman Khapov Date: Mon, 29 Jul 2024 09:53:09 +0500 Subject: [PATCH] machinarium-gdb.py: fix mmcoro cache (#640) It is necessarry to invalidate frames cache after mmcoro command. Signed-off-by: Roman Khapov Co-authored-by: Roman Khapov --- third_party/machinarium/gdb/machinarium-gdb.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/third_party/machinarium/gdb/machinarium-gdb.py b/third_party/machinarium/gdb/machinarium-gdb.py index 43d4d5402..fdb64f106 100644 --- a/third_party/machinarium/gdb/machinarium-gdb.py +++ b/third_party/machinarium/gdb/machinarium-gdb.py @@ -451,11 +451,14 @@ def _execute_in_coroutine_context(self, thread: gdb.InferiorThread, coroutine: g # However, this will cause the first frame to be the frame of the current thread. # And then we unwides to the coroutine context. # Therefore, we should use a frame filter to skip the first frame. - with mm_first_frame_skip.enabled_filter(): - regs = mm_get_context_registers_for_coroutine_x64(coroutine) - mm_context_selector.target_to(regs) + try: + with mm_first_frame_skip.enabled_filter(): + regs = mm_get_context_registers_for_coroutine_x64(coroutine) + mm_context_selector.target_to(regs) + gdb.invalidate_cached_frames() + gdb.execute(gdbcmd) + finally: gdb.invalidate_cached_frames() - gdb.execute(gdbcmd) def invoke(self, args, is_tty): if gdb_get_current_platform() != 'i386:x86-64':