sevaa / dwex

DWARF Explorer - a GUI utility for navigating the DWARF debug information

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DWARF Symbols in .h Files Do Not Appear in DWARF 4 CCS File

kierarcher opened this issue · comments

Hello,

I reported the following issue on the TI Code Compser Studio forum:

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/1220659/dwarf-3-vs-dwarf-4-for-3rd-party-tools

I have no idea if this is an issue with CCS or DWEX but thought you should know.

See if the missing symbols show up in readelf, dwarfdump, or llvm-dwarfdump. If they do, that's a problem with dwex.

Thank you. I looked for these utils but they are Linux right? I only have Windows, sorry. Is there a Windows utility I can use?

llvm-dwarfdump is available on Windows definitely - poke around the LLVM project's site. Readelf is available on Windows under Cygwin (look it up).

That said, if the toolchain is targeting Windows, are you sure it emits debug info in the DWARF format? That's not Windows native.

Thanks for your help. I found readelf under MinGW, sorry, I missed that first time!. The results are inconclusive however because the symbols I'm after do not appear in either the DWARF3 or DWARF4 dump. I used readelf -all, not sure if that's sufficient though?

But I can now supply two ELF files (attached) and refine the problem statement: Structure members defined in a header file do not appear in DWEX for DWARF4. See picture. lab_main.h and structure members member1 and member2 are nowhere to be found in the GUI.

My problem is that I don't know if is an issue with the ELF file or not but it would be good if you could confirm DWEX is not at fault here. This means I have more concrete evidence to convince the compiler developers to fix the issue with the ELF file.

My use case is that I'm using the compiler on Windows but the output binary is for a microcontroller.
driverlib_lp_f28003x_foo.zip

I downloaded and installed LLVM-16.0.0-win64.exe but llvm-dwarfdump.exe is not present. Only the following utils are installed:
\bin\llvm-strip.exe
\bin\llvm-ranlib.exe
\bin\llvm-lib.exe
\bin\llvm-readobj.exe
\bin\llvm-objdump.exe
\bin\llvm-symbolizer.exe
\bin\llvm-strings.exe
\bin\llvm-size.exe
\bin\llvm-pdbutil.exe
\bin\llvm-nm.exe
\bin\llvm-rc.exe
\bin\llvm-objcopy.exe
\bin\llvm-ml.exe
\bin\llvm-cov.exe
\bin\llvm-dwp.exe
\bin\llvm-cxxfilt.exe
\bin\llvm-ar.exe
\bin\llvm-profdata.exe

re.zip

Here is the readelf output of the DIE tree of the two binaries.

In the readelf output for the DWARFv4 binary, there is no compilation unit for lab_main.h. There are 198 CUs in the v3 file and 197 CUs in the v4 one.

I think we can safely conclude that dwex is not to blame here :)

OK, thank you very much! I'll go back to Texas Instruments armed with this info.