Failing BreakpointIDTestCase

Hi all,

This test-case is failing (Mac OS X Mountain Lion, latest Xcode released, built using xcodebuild):
./dotest.py -v -d -A x86_64 -C clang -v -t -f BreakpointIDTestCase.test_with_dsym

From what I can tell, after LLDB finds the DIE that has the inlined sum() function, it stops looking, although there is another inlined sum() function.
With that, the breakpoint will only resolve to one location.

At least I think that is what’s happening. I’m not an expert on DWARF :wink:

Could you have a look at it, please?

Thanks,

Filipe

This test case succeeds for me using TOT lldb and some fairly recent clang. So it looks like the failure is due to some bug or difference in the debug output. It would be easier to figure out what is going on if I could reproduce the failure. What clang version are you using?

Jim

As Jim said, this works for me as well.

Hi Jim,

I just did an update to lldb and re-ran the test. Same result…

But…

If I use Xcode’s clang (by passing -C $(xcrun -f clang)), it works.
If I use ToT clang (just updated and ran make install), it fails.

Attached are both log files. The problem is that, with ToT clang, breakpoint location 2.2 doesn’t exist. Only 2.1.

Regards,

Filipe

breakpointIDs-xcode-clang.log (5.36 KB)

breakpointIDs.log (6.38 KB)

So, we have a problem with the debug information:

There are two TAG_inlined_subroutine DIEs for the ToT clang, one of them with an AT_ranges.
For the Xcode clang, we have three DIEs (which makes sense, since we have three sum() calls).

Example lldb interaction:
Compiled with make CC=$(xcrun -f clang)

± …/…/…/…/build/Debug/lldb a.out
Current executable set to ‘a.out’ (x86_64).
(lldb) b sum
Breakpoint 1: 3 locations.
(lldb) breakpoint list
Current breakpoints:
1: name = ‘sum’, locations = 3
1.1: where = a.outfoo(int, int) + 99 [inlined] sum(int, int) at main.cpp:49, address = 0x0000000100000d43, unresolved, hit count = 0 1.2: where = a.outfoo(int, int) + 131 [inlined] sum(int, int) at main.cpp:51, address = 0x0000000100000d63, unresolved, hit count = 0
1.3: where = a.out`foo(int, int) + 155 [inlined] sum(int, int) at main.cpp:51, address = 0x0000000100000d7b, unresolved, hit count = 0

Compiled with make (clang is ToT):

± …/…/…/…/build/Debug/lldb a.out
Current executable set to ‘a.out’ (x86_64).
(lldb) b sum
Breakpoint 1: where = a.outfoo(int, int) + 99 [inlined] sum(int, int) at main.cpp:49, address = 0x0000000100000d43 (lldb) breakpoint list Current breakpoints: 1: name = 'sum', locations = 1 1.1: where = a.outfoo(int, int) + 99 [inlined] sum(int, int) at main.cpp:49, address = 0x0000000100000d43, unresolved, hit count = 0

So, should we bring this to the clang bugs page?
I’m sending the dwarfdump of both files attached.

Regards,

Filipe

dwarfdump-ToT-clang.log (287 KB)

dwarfdump-Xcode-clang.log (287 KB)

Filipe, thanks for pointing this out. I filed a bug on this internally here at apple (<rdar://problem/12592135>).

Greg

It’s not that I think the bug will be forgotten (I don’t), but if it’s mostly related to clang trunk, I think the best place would be llvm.org/bugs.

But thanks for confirming and filing it.

Regards,

Filipe