Skip to content

Commit

Permalink
machinarium-gdb.py: fix mmcoro cache (#640)
Browse files Browse the repository at this point in the history
It is necessarry to invalidate frames cache after mmcoro command.

Signed-off-by: Roman Khapov <[email protected]>
Co-authored-by: Roman Khapov <[email protected]>
  • Loading branch information
rkhapov and Roman Khapov authored Jul 29, 2024
1 parent 46de978 commit a9339c1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions third_party/machinarium/gdb/machinarium-gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit a9339c1

Please sign in to comment.