[cfe-dev] Make standalone-debug default based on glldb tuning

Adrian Prantl via cfe-dev cfe-dev at lists.llvm.org
Fri Apr 12 08:56:22 PDT 2019

> On Apr 12, 2019, at 8:45 AM, paul.robinson at sony.com wrote:
>> -----Original Message-----
>> From: aprantl at apple.com [mailto:aprantl at apple.com]
>> Sent: Friday, April 12, 2019 11:21 AM
>> To: David Blaikie
>> Cc: Clang Dev; Robinson, Paul; Douglas Katzman
>> Subject: Re: Make standalone-debug default based on glldb tuning
>>> On Apr 12, 2019, at 8:18 AM, David Blaikie <dblaikie at gmail.com> wrote:
>>> I realized recently (as folks at Google have started experimenting
>>> with LLDB) that the platform default for debugger tuning and the
>>> default for -fstandalone-debug are both independent. This seems a bit
>>> wrong to me because enabling -glldb doesn't enable -fstandalone-debug.
>>> I'm wondering if everyone's on board with removing
>>> ToolChain::GetDefaultStandaloneDebug, and using
>>> ToolChain::getDefaultDebuggerTuning() to select the default standalone
>>> debug state?
>>> Then on the command line, I'd kind of expect one to override the
>>> other, so things like "-glldb -fno-standalone-debug" is respected
>>> (when it comes to hopefully fixing LLDB to cope with standalone debug
>>> input).
>>> Sound good to everyone? If so I'll make a patch & send it for review.
>>> (well, I'll probably work on the patch now anyway)
>> Since this doesn't change anything for platforms that default to -glldb,
>> I'm fine with this change.
>> -- adrian
> I'm somewhat surprised LLDB would want -fstandalone-debug, independent
> of the target.  It would be a source of unnecessary bloat on ELF-using
> targets, no? 
> --paulr

On Darwin we made the decision because when you are building against a binary library without debug info that vends a C++ interface (such as XNU kernel extensions do) the program becomes undebuggable because types from the library's headers are mnissing. An since dsymutil uniques C++ types this isn't particularly expensive and easier than educating developers of -fstandalone-debug. It also allows LLDB when debugging with .o files directly (without .dSYM) to only search for types in the current object, which speeds things up significantly.

IIRC, the ELF change was done by the FreeBSD folks and I'm not sure what the primary driver was, since the debug info in ELF is always one big blob.

-- adrian

More information about the cfe-dev mailing list