r179879 - Emit the underlying type in the debug info for all kinds of fixed enums

Adrian Prantl aprantl at apple.com
Mon Apr 22 15:36:17 PDT 2013


On Apr 19, 2013, at 3:05 PM, Eric Christopher <echristo at gmail.com> wrote:

> On Fri, Apr 19, 2013 at 2:51 PM, Adrian Prantl <aprantl at apple.com> wrote:
>> To briefly summarize a discussion in #llvm:
>> The problem the patch addresses is that lldb displays negative enumerator values for fixed enums as unsigned values.
>> 
>> This patch solves this by attaching the (optional) underlying type of the enum if there is one specified (for example NSInteger in the test case that comes with the patch). This is something we used to do for all scoped enums, and the patch extends this to all fixed enums.
>> 
>> Eric points out that it should be sufficient to emit a negative DW_AT_const_value for the enumerator
>> to let the debugger deduce that this is a signed data type. However, he also points out that darwin-gdb will probably not be able understand that.
>> 
> 
> And that this ends up bloating the debug info (admittedly by a single
> field, but...) when we don't need it to.

True. One tag per fixed enum declaration.

>> Update: We actually do emit the enumerators as signed values (DW_FORM_sdata). But it’s not enough for lldb to deduce the signedness in all cases.
>> 
> 
> Why not?

I filed a bug report for lldb. I’ll follow up once I know more about it.

-- 
Adrian



More information about the cfe-commits mailing list