Skip to content

Instantly share code, notes, and snippets.

@agrif
Created August 5, 2025 14:13
Show Gist options
  • Save agrif/eb3821cc872ac6837d0ef6fc3b50f2c1 to your computer and use it in GitHub Desktop.
Save agrif/eb3821cc872ac6837d0ef6fc3b50f2c1 to your computer and use it in GitHub Desktop.
from gdb.unwinder import Unwinder
class FrameID:
def __init__(self, sp, pc):
self.sp = sp
self.pc = pc
class no_unwinder(Unwinder):
def __init__(self):
super().__init__("no_unwinder")
def __call__(self, pending_frame):
sp = pending_frame.read_register("sp")
pc = pending_frame.read_register("pc")
frame_id = FrameID(sp, pc)
info = pending_frame.create_unwind_info(frame_id)
return info
gdb.unwinder.register_unwinder(None, no_unwinder(), replace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment