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

Adrian Prantl aprantl at apple.com
Fri Apr 19 14:51:04 PDT 2013

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. 

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.

I did clean up the tests as suggested.

-- adrian

More information about the cfe-commits mailing list