This is the mail archive of the gdb-patches@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: [patch v4 24/24] record-btrace: skip tail calls in back trace


> -----Original Message-----
> From: Metzger, Markus T
> Sent: Tuesday, September 17, 2013 4:28 PM


> > reverse-next^M
> > __GI_____strtoul_l_internal (nptr=<unavailable>, endptr=<unavailable>,
> > base=<optimized out>, group=<optimized out>, loc=<optimized out>) at
> > ../stdlib/strtol_l.c:531^M
> > 531     }^M
> > (gdb) FAIL: gdb.btrace/rn-dl-bind.exp: rn-dl-bind, 2.3 bt^M
> > #0  __GI_____strtoul_l_internal (nptr=<unavailable>,
> > endptr=<unavailable>, base=<optimized out>, group=<optimized out>,
> > loc=<optimized out>) at ../stdlib/strtol_l.c:531^M
> > #1  0x00007ffff7228f8d in __GI_strtoul (nptr=<error reading variable:
> > Registers are not available in btrace record history>, endptr=<error
> > reading
> > variable: Registers are not available in btrace record history>,
> > base=<error reading variable: Registers are not available in btrace
> > record history>) at ../stdlib/strtol.c:108^M
> > #2  _dl_runtime_resolve () at ../sysdeps/x86_64/dl-trampoline.S:56^M
> > #3  0x00000000004004c6 in ?? ()^M
> > #4  0x00000000004004fb in strtoul@plt ()^M
> > #5  0x000000000040060c in test () at ./gdb.btrace/rn-dl-bind.c:26^M
> > #6  0x0000000000400621 in main () at ./gdb.btrace/rn-dl-bind.c:35^M
> > Backtrace stopped: not enough registers or memory available to unwind
> > further^M
> 
> I need to investigate this.

If we skip tail calls, GDB recognizes that we reverse-stepped into a
subroutine and keeps stepping.

If we don't skip tail calls, GDB fails to recognize this and stops stepping
due to the absence of line information.

The line information is also missing when we skip tail calls, but the stepped-
into-subroutine check comes before the has-line-info check.

When searching for the caller frame id in infrun.c, GDB skips artificial frames
including normal TAILCALL_FRAMEs.  I guess this is why it works for live
stepping and also for record-full.

One way to solve this would be to add a BTRACE_TAILCALL_FRAME and
extend struct target_ops to provide two optional unwinders that are both
tried before any arch unwinder.  I'd try this unless you have a better idea.

Regards,
Markus.

Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


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