All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: gdb@sourceware.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] tcg: Use the GDB JIT debugging interface.
Date: Fri, 30 Sep 2011 07:36:15 -0700	[thread overview]
Message-ID: <4E85D3DF.7070307@twiddle.net> (raw)
In-Reply-To: <4E856BDE.80904@web.de>

On 09/30/2011 12:12 AM, Jan Kiszka wrote:
>> Breakpoint 1, __ldb_mmu (addr=1001716, mmu_idx=0)
>>     at /home/rth/work/qemu/qemu/softmmu_template.h:86
>> 86	{
>> (gdb) where
>> #0  __ldb_mmu (addr=1001716, mmu_idx=0)
>>     at /home/rth/work/qemu/qemu/softmmu_template.h:86
>> #1  0x0000000040000afc in ?? ()
...
> Would it be possible to tag translated code as well? At TB or maybe even
> input instruction level? Only in debugging mode of course.

I don't know.  A couple of points on that:

(1) I was rather expecting frame 1 above to be marked "code_gen_buffer"
    rather than "??".  I *did* install that symbol in the generated 
    ELF image as a function covering the entire buffer.  So I'm not
    quite sure why GDB didn't use it.

(2) If we wanted to mark stuff individually, then we would have to
    manipulate the symbol table presented to GDB.  One could do this
    either via separate ELF images for each TB (overhead ~600 bytes
    per TB, more if we mark input insns), or via un-registering and
    re-registering the "main" ELF image after having manipulated the
    symbol table.  Of course, in the later case the layout of the ELF
    image would get tricky, as the symbol table expands and overruns
    existing TBs.

So, "probably not" is my answer.

>> +/* Begin GDB interface.  The following must match the docs.  */
...
>> +void __jit_debug_register_code(void);
>> +void __attribute__((noinline)) __jit_debug_register_code(void)
> 
> Leading '_' are reserved for the system and tabu for the application (we
> have some other violations, yes).

We have no choice here -- we must use exactly what GDB documents.

>> +#if 0
> 
> #ifdef DEBUG_ELF_GENERATION or so?

Sure.


r~

  reply	other threads:[~2011-09-30 14:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29 23:46 [Qemu-devel] [PATCH] tcg: Use the GDB JIT debugging interface Richard Henderson
2011-09-30  7:12 ` Jan Kiszka
2011-09-30 14:36   ` Richard Henderson [this message]
2011-10-02  2:04     ` Daniel Jacobowitz
2012-03-19 19:25 [Qemu-devel] [PATCH v2] " Richard Henderson
2012-03-19 19:25 ` [Qemu-devel] [PATCH] tcg: " Richard Henderson
2012-03-24 16:11   ` Blue Swirl
2012-03-24 17:04     ` Peter Maydell
2012-03-20 18:18 [Qemu-devel] [PATCH v3] Use the GDB JIT interface Richard Henderson
2012-03-20 18:18 ` [Qemu-devel] [PATCH] tcg: Use the GDB JIT debugging interface Richard Henderson

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=4E85D3DF.7070307@twiddle.net \
    --to=rth@twiddle.net \
    --cc=gdb@sourceware.org \
    --cc=jan.kiszka@web.de \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.