Opened 8 years ago

Closed 8 years ago

#5221 closed Bug (fixed)

STABS debug information format prevents source-level debuging in LLDB

Reported by: CrazyMonster Owned by: livings124
Priority: Normal Milestone: 2.80
Component: Mac Client Version:
Severity: Minor Keywords: stabs debug information lldb mac-client xcode
Cc:

Description

What's happening:

Hello, I was trying to debug Transmission and when I set a breakpoint in Xcode (on a line number) I noticed that LLDB couldn't resolve it (and so it doesn't fire). If I set a breakpoint on a function name, instead, LLDB resolved it but showed the disassembly of the function instead of opening the source code.

breakpoint list output:

1: file ='torrent.c', line = 85, locations = 0 (pending)

2: name = 'tr_torrentId', locations = 1, resolved = 1
  2.1: where = Transmission`tr_torrentId, address = 0x00000001000b2220, resolved, hit count = 0 

As you can see here, the first breakpoint isn't resolved at all while the second is resolved to an address in the executable instead of a source code location.

Proposed Fix:

Changing the DEBUG_INFORMATION_FORMAT to "DWARF with dSYM" in the Xcode project's Build Settings fixes the problem. Both the breakpoints above now resolve to source code locations, they both fire when reached and they both opens the source-level debugger instead of the disassembly.

http://f.cl.ly/items/3X150n1E383f431T201X/Schermata%2001-2456306%20alle%2019.07.35.png

breakpoint list output after change:

1: file ='torrent.c', line = 85, locations = 1, resolved = 1

  1.1: where = Transmission`tr_torrentId + 8 at torrent.c:85, address = 0x00000001000b2248, resolved, hit count = 0 

2: name = 'tr_torrentId', locations = 1, resolved = 1

  2.1: where = Transmission`tr_torrentId + 8 at torrent.c:85, address = 0x00000001000b2248, resolved, hit count = 0 

Probably the cause of the problem is that the LLDB doesn't support (anymore?) the legacy STABS debug information format and thus can't provide source-level debugging because it doesn't have debug symbols. Moving to DWARF (which is newer and is better than STABS anyway) restores source-level support. Being DWARF the default choice since at least Xcode 2.3, I went looking in the blame when the setting was changed, turned out that changeset [9814] is responsible of this change.

Change History (2)

comment:1 Changed 8 years ago by livings124

Good catch! Thanks!

r13789

comment:2 Changed 8 years ago by livings124

  • Milestone changed from None Set to 2.80
  • Resolution set to fixed
  • Severity changed from Normal to Minor
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.