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-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 Jakub Jelinek via Dwarf-discuss
On Fri, Sep 13, 2024 at 10:51:33AM -0500, 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 juicer , which dumps > it

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 Jakub Jelinek via Dwarf-discuss
On Fri, Sep 13, 2024 at 01:46:26PM -0500, Lorenzo Gomez wrote: > 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

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

2024-09-13 Thread David Anderson via Dwarf-discuss
On 9/12/24 11:39, David Blaikie via Dwarf-discuss wrote: Oooh, fascinating. Certainly llvm-dwarfdump has explicit support for sections it expects to be fragmented (multiple sections with the same name, for comdat purposes, etc) - and so llvm-dwarfdump certainly wouldn't dump this correctly (prob

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

2024-09-13 Thread David Anderson via Dwarf-discuss
On 9/13/24 09:37, Jakub Jelinek via Dwarf-discuss wrote: DW_MACRO_import 0 means include the .debug_macro chunk from offset 0 in the section, which with applied relocations would be endless recursion there. Most likely just dwarfdump doesn't distinguish in that 0x what it really is, it is

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