This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: jit interface and jit reader


> I have trouble getting GDB's jit interface to work. I'm trying to make
> application using AsmJit [1] easier to debug by being able to break
> when entering jitted code. As AsmJit is just an assembler returning a
> function pointer to the generated code, I do not want to create an
> object file for it. That is why I'm trying to use jit-reader, but the
> symbol does not seem to show up in GDB and a pending breakpoint is
> never hit.
> 
> What am I doing wrong? I attached two files: gdbjit.cpp is talking to
> GDB via the jit interface. gdbjit-reader.c is the jit reader for GDB
> which I compile to a shared object and load in GDB with
> jit-reader-load.
> 
> It does not implement unwind and get_frame_id. Do I need these
> functions? unwind is called sometimes. Is there a minimal example
> somewhere which implements jit reader?
> 
> [1] https://github.com/asmjit/asmjit


I looked at GDB's source code a bit and found a minimal example in
testsuite/gdb.base/jit{host.c,reader.c}.

The problem is also visible there: I can follow the indirect call into
the generated code. In TUI-mode, the instructions belonging to the
function have the correct symbol+offset. backtrace shows the function
name as well.

But, I cannot set a breakpoint with the function name. Nor can I use
the command disassemble, only the disassemble view in TUI works.

How can I register the address range as a proper function?

Best regards,
Frank


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]