From: Frank Tetzel <s1445051@mail.zih.tu-dresden.de>
To: gdb@sourceware.org
Subject: Re: jit interface and jit reader
Date: Mon, 21 Jan 2019 13:53:00 -0000 [thread overview]
Message-ID: <20190121145310.36158a70@archvm> (raw)
In-Reply-To: <20190118115004.1a51eefc@archvm>
> 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
next prev parent reply other threads:[~2019-01-21 13:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-18 10:50 Frank Tetzel
2019-01-21 2:54 ` How to set the same command for all the breakpoints in gdb? Peng Yu
2019-01-21 13:53 ` Frank Tetzel [this message]
2019-01-22 11:21 ` jit interface and jit reader Tony Simpson
2019-01-22 17:33 ` Frank Tetzel
2019-01-22 17:56 ` Tony Simpson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190121145310.36158a70@archvm \
--to=s1445051@mail.zih.tu-dresden.de \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox