Re: [Dwarf-discuss] Virtual Methods/Array Of Structs and Anonymous Structs

2024-12-18 Thread Lorenzo Gomez via Dwarf-discuss
Thanks so much for the quick response David. I have reported this as a bug on GCC's bug tracker: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118117 I tried it on clang and I don't see the same behavior. So it does seem to be pointing to an issue in GCC... Thanks Lorenzo On Wed, Dec 18, 2024 at

[Dwarf-discuss] Virtual Methods/Array Of Structs and Anonymous Structs

2024-12-17 Thread Lorenzo Gomez via Dwarf-discuss
Hello there, hope you are all doing well. While working with libdwarf/dwarfdump,  I noticed the following behavior. Suppose we have the following code: ```C++ #ifndef CCHANNEL_HPP_ #define CCHANNEL_HPP_ class CChannel {    public:     typedef enum     {     UNUSED   = 0,     INACTI

Re: [Dwarf-discuss] Macros after "#include" does not show up DWARF

2024-09-13 Thread Lorenzo Gomez via Dwarf-discuss
I did find it kind of odd too that it emitted "macinfo". I got a newer version of clang(Ubuntu clang version 14.0.0-1ubuntu1.1 ) and now it actually emits the DWARF5 version of macros: .debug_macro: Macro info for a single cu at macro Offset 0x Macro data from CU-DIE at .debug_info offset

Re: [Dwarf-discuss] Macros after "#include" does not show up DWARF

2024-09-13 Thread Lorenzo Gomez via Dwarf-discuss
That makes sense. Interestingly enough when I run with clang "clang -gdwarf-5 -fdebug-macro -g3 -c macro_test.c -o macro_test_clang.o" and dwarfdump with "dwarfdump macro_test_clang.o > macro_test_clang_dwarf" yields all the macros: compilation-unit .debug_macinfo offset 0x num name sect

Re: [Dwarf-discuss] Macros after "#include" does not show up DWARF

2024-09-13 Thread Lorenzo Gomez via Dwarf-discuss
Would like to clarify: I ran dwarfdump on "macro_test_relocatable" On Fri, Sep 13, 2024 at 10:51 AM Lorenzo Gomez wrote: > Thanks again for all of the insight into all this. The reason we're > looking into this is because we develop a tool that extracts dwarf info > from an elf file called juice

Re: [Dwarf-discuss] Macros after "#include" does not show up DWARF

2024-09-13 Thread Lorenzo Gomez via Dwarf-discuss
Thanks again for all of the insight into all this. The reason we're looking into this is because we develop a tool that extracts dwarf info from an elf file called juicer , which dumps it into a SQLITE db for other tools. And we want to make sure we document

Re: [Dwarf-discuss] Macros after "#include" does not show up DWARF

2024-09-12 Thread Lorenzo Gomez via Dwarf-discuss
Thanks so much for the detailed explanation. So clearly all the macros are there as we can see from readelf. I ran it myself and can see all the macros as David pointed out. And just to make sure I understand, this is what I took away: 1. All the macros are in the file as we can see from readelf o

Re: [Dwarf-discuss] Macros after "#include" does not show up DWARF

2024-09-11 Thread Lorenzo Gomez via Dwarf-discuss
Something else to note: If I link the "test_file1.o" file with "gcc  -g3  -nostartfiles -Llib -gdwarf-4  test_file1_copy.o -o test_file1_linked_dwarf4.o" the macro shows up in the DWARF, regardless of whether it is defined before/after the #include. On 9/11/24 1:47 PM, Lorenzo Gomez wrote:

[Dwarf-discuss] Macros after "#include" does not show up DWARF

2024-09-11 Thread Lorenzo Gomez via Dwarf-discuss
Hi there, I'm currently using dwarfdump "2020-01-14 10:13:32-08:00 Package Version "20200114"" to look at macros inside the DWARF. Imagine two files; test_file1.h and test_file1.cpp test_file1.cpp is defined as follows: /*  * test_file.cpp  *  */ #ifdef __cplusplus e