[lldb-dev] breakpoint command

Greg Clayton gclayton at apple.com
Mon Jun 17 11:27:13 PDT 2013


We do skip the prologue by default. We use the DWARF line tables to see where the prologue end is. If the DWARF doesn't have a prologue end marker in it, we try and figure this out ourselves by using the second line table entry in the line table. I am guessing there is either bad DWARF line table info made by the compiler in this case (with an bad prologue end marker), or no prologue end marker. 

You can also see the some of the line table using:

(lldb) image dump line-table printf.c

If we are picking the second entry, the breakpoint you see us setting will probably be the second address in the line table.

There is also a bug here where we must have two "__printf" symbols because the disassembly is broken up:

(lldb) disassemble -n printf
libc.so.6`__printf at printf.c:30:
   0x7f961e2a2840:  subq   $216, %rsp

libc.so.6`__printf + 7 at printf.c:30:
   0x7f961e2a2847:  testb  %al, %al
   0x7f961e2a2849:  movq   %rsi, 40(%rsp)
   0x7f961e2a284e:  movq   %rdx, 48(%rsp)
   0x7f961e2a2853:  movq   %rcx, 56(%rsp)
   0x7f961e2a2858:  movq   %r8, 64(%rsp)
   0x7f961e2a285d:  movq   %r9, 72(%rsp)

The symbol table probably contains a "__printf" symbol with zero size and one with a larger size (there is a bug already files for this issue with "malloc" on bugzilla.

The ELF symbol table parser should try to only emit one symbol when it can by coalescing the two "__printf" symbols into one. The disassembly output should look like this:

(lldb) disassemble -n printf
libc.so.6`__printf at printf.c:30:
   0x7f961e2a2840:  subq   $216, %rsp
   0x7f961e2a2847:  testb  %al, %al
   0x7f961e2a2849:  movq   %rsi, 40(%rsp)
   0x7f961e2a284e:  movq   %rdx, 48(%rsp)
   0x7f961e2a2853:  movq   %rcx, 56(%rsp)
   0x7f961e2a2858:  movq   %r8, 64(%rsp)
   0x7f961e2a285d:  movq   %r9, 72(%rsp)


If you send me the ELF file that contains printf, I can check it out the line table and probably the symbol issue for you.

On Jun 17, 2013, at 10:28 AM, Michael Sartain <mikesart at valvesoftware.com> wrote:

> On Mon, Jun 17, 2013 at 9:57 AM, Kopec, Matt <matt.kopec at intel.com> wrote:
> In case you haven't looked at this yet, lldb has an option to skip the function prologue when setting function breakpoints. The setting is configurable via 'settings set target.skip-prologue false|true'. The default is true.
> 
> It looks like you have some debug info for libc.so since you are able to resolve some line numbers. My guess is it's getting this prologue offset information from the DWARF info.
> 
> Oh, brilliant. That gets the breakpoint set correctly at the start of printf and it's hit now. And yes - the split symbol support means we have full symbols for all the system stuff (that has installed symbols).
> 
> I'll investigate what is going on with the prologue dwarf stuff - something is broken there since the prologue shouldn't put us in the middle of printf.
> 
> Thank you very much Matt.
>  -Mike
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list