[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] tcg: Use the GDB JIT debugging interface.

From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] tcg: Use the GDB JIT debugging interface.
Date: Fri, 30 Sep 2011 07:36:15 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2

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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]