[llvm] [llvm-debuginfo-analyzer] Add support for DWARF `DW_AT_byte_size` (PR #139110)

Javier Lopez-Gomez via llvm-commits llvm-commits at lists.llvm.org
Mon May 12 07:39:50 PDT 2025


================
@@ -32,9 +32,9 @@
 ; ONE-NEXT:                                    {File} 'test.cpp'
 ; ONE-NEXT:                                    {Public} 'foo' [0x0000000000:0x000000003a]
 ; ONE-NEXT: [0x000000000b][002]                {Range} Lines 2:9 [0x0000000000:0x000000003a]
-; ONE-NEXT: [0x00000000bc][002]                {BaseType} 'bool'
-; ONE-NEXT: [0x0000000099][002]                {BaseType} 'int'
-; ONE-NEXT: [0x00000000b5][002]                {BaseType} 'unsigned int'
+; ONE-NEXT: [0x00000000bc][002]                {BaseType} 'bool' [Size = 1]
+; ONE-NEXT: [0x0000000099][002]                {BaseType} 'int' [Size = 4]
+; ONE-NEXT: [0x00000000b5][002]                {BaseType} 'unsigned int' [Size = 4]
----------------
jalopezg-git wrote:

Hmmm... unsure, to be honest.  It is a common thing (due to C language syntax) to see `some_symbol_name : bit_size`, but here it's really meaning byte size.

Alternatively, we could do something in the lines of
```
{BaseType} 'bool' [sizeof(bool) == 1]
{BaseType} 'int' [sizeof(int) == 4]
{BaseType} 'unsigned int' [sizeof(unsigned int) == 4]
```

I don't have a particular preference?  Do you have any strong opinions for going for any particular notation?

https://github.com/llvm/llvm-project/pull/139110


More information about the llvm-commits mailing list