Quantcast
Channel: LLDB - Swift Forums
Viewing all articles
Browse latest Browse all 40

SymbolFileDWARF::FindTypes is called too many times (apparently)

$
0
0

I was debugging slow expression evaluation in lldb in my project and noticed that most of the time is spent on calling the functions SymbolFileDWARF::FindTypes and SymbolFileDWARF::FindFunctions. And a lot of these calls are made on my module's objects, but trying to search foreign symbols, like swift_release, swift_retain, $ss4VoidaD, $ss16_DebuggerSupportO20stringForPrintObjectySSypFZ, and so on.
Looks like this search is performed for each type/function resolution request in every module.
I made a small example reproducing this behavior and took logs with
log enable -T -f ~/lldb_dwarf_map.log dwarf all
Examples:

$ss16_DebuggerSupportO20stringForPrintObjectySSypFZ (click for more details) swift_release/swift_retain (click for more details) $ss4VoidaD (click for more details)

In my small sample project, it performs quite fast. However, in my main project, we have approximately 24,000 .o and .pcm files in a target, and these lookups take a noticeable amount of time, often tens of seconds.

I would like to discuss how we can improve the debugging experience:

  • In the case of Swift symbols, we often have a good guess about where the symbol is located by looking at the module name in the unmangled symbol. Can we leverage this?
  • It appears there is no cache for these lookups. Can we add one?
  • Are there any other possible improvements?

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 40

Trending Articles