[swift-dev] tips for debugging the swift executable
Joe Groff
jgroff at apple.com
Thu Dec 17 17:09:12 CST 2015
> On Dec 17, 2015, at 2:57 PM, Rafkind, Jon via swift-dev <swift-dev at swift.org> wrote:
>
> I use gdb on linux to debug the swift binary. I find that gdb takes about 20 seconds just to read the symbols before I can even interact with gdb. I was wondering if anyone knew of a way to decrease the symbol load time, either by some gdb settings or by compiling swift/llvm/clang in such a way as to get a usefully debuggable binary but without so many symbols.
>
> My swift binary is a massive 1.1gb.
>
> $ ls -lh swift
> -rwxr-xr-x 1 jon jon 1.1G Dec 8 18:43 swift*
>
> I built all of llvm/clang/swift in Debug mode.
>
> (Tangentially related, but using gold instead of ld to link swift is about 2-3x faster)
You might give lldb a shot, if you haven't already. It seems to cope better with large binaries, and expr evaluation is more stable IME.
-Joe
More information about the swift-dev
mailing list