This is the mail archive of the gdb-prs@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]

[Bug symtab/20635] New: Re-executing a program in one gdb instance breaks JIT debugging


https://sourceware.org/bugzilla/show_bug.cgi?id=20635

            Bug ID: 20635
           Summary: Re-executing a program in one gdb instance breaks JIT
                    debugging
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: fredrik at dolda2000 dot com
  Target Milestone: ---

When "re-using" one instance of gdb to execute a program that emits JIT code
more than once, JIT debugging appears to not work on subsequent runs, and gdb
simply can't find the symbols.

For instance, here follows an example where I've set a breakpoint on a function
that is only called from JIT'ed code; please notice how the backtrace is broken
the second time around. The functions whose names begin with % are the JIT'ed
functions. No output has been removed; I literally just run the program twice
in a row. This particular output is generated by gdb from the latest Git
revision, but the error is also present in versions 7.11.1 and 7.7.1 that come
by default on Debian.

(gdb) r
Starting program: /home/fredrik/src/hafen/server/hafen 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, __m_ciinit_118 (nextmethod=0x7fffffffe058, rcp=0x44544f0, onum=0)
at craft.c:120
120         struct recipe *rd = tslots(rcp, recipe);
(gdb) bt
#0  __m_ciinit_118 (nextmethod=0x7fffffffe058, rcp=0x44544f0, onum=0) at
craft.c:120
#1  0x00007ffff7f7c23f in %g126 ()
#2  0x00000000004efae1 in __m_ciinit_436 (nextmethod=0x7fffffffe0c0,
rcp=0x44544f0) at sutils.c:440
#3  0x00007ffff7f7c105 in %em_ciinitv125 ()
#4  0x00007ffff7436df0 in cimake (type=0xbeddc0 <__it_wisprecipe>) at ext.c:92
#5  0x00000000007e417c in __init_craft () at vengeance.c:1340
#6  0x00000000004041e2 in runinits (stage=0x81bf62 "craft") at main.c:83
#7  0x00000000004ad6cb in initcrafting () at craft.c:1480
#8  0x00000000004052c1 in main (argc=1, argv=0x7fffffffe768) at main.c:487
(gdb) k
Kill the program being debugged? (y or n) y
(gdb) r
Starting program: /home/fredrik/src/hafen/server/hafen 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, __m_ciinit_118 (nextmethod=0x7fffffffe058, rcp=0x44544f0, onum=0)
at craft.c:120
120         struct recipe *rd = tslots(rcp, recipe);
(gdb) bt
#0  __m_ciinit_118 (nextmethod=0x7fffffffe058, rcp=0x44544f0, onum=0) at
craft.c:120
#1  0x00007ffff7f7c23f in ?? ()
#2  0x00007fffffffe110 in ?? ()
#3  0x7ffff7f7c250bb49 in ?? ()
#4  0xffffe138ba490000 in ?? ()
#5  0x00e3ff4900007fff in ?? ()
#6  0x0000000000000000 in ?? ()
(gdb)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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