Re: GDB-JIT: why would my 'unwind' not be invoked on crash?

K via Gdb <[email protected]> Wed, 12 Nov 2025 03:00:39 +0100
Newsgroups gmane.comp.gdb.devel
Message-ID <CACTzTFBRsJ6Rv=D5aKdeKb9SqDByDOKN1VjqdYiSbyMVQgZgPQ@mail.gmail.com>
>
> Could you say more about what exactly you're doing?
>
> Like are you writing an unwinder in gdb?  Or writing one in Python?
>
>
I'm implementing an unwinder via the GDB-JIT C API for JIT code where
generating custom ELF debug information is too onerous.
The first article I read on it, by the implementor Sanjoy D(?) mentioned
your name as originating the approach!
So I'm just providing the functions called for by the struct in the API -
unwind and get-frame-id  (plus the function name/line number info
separately).

So gdb has no ELF info to look at (other than of the binary that is
generating the JIT code), so I was expecting gdb to immediately defer
to the jit-reader.so loaded into itself with the defined unwind function
which has a few printf statements so I know when it runs ...
and it isn't being called until 2 lines of backtrace have already been
emitted, and only then on garbage data because it has already gone awry
interpreting the stack contents/frame (with those first 2 lines above).