cv2pdb icon indicating copy to clipboard operation
cv2pdb copied to clipboard

Using separate DWARF debugging symbols as input

Open jtanx opened this issue 8 years ago • 5 comments

If I have a stripped executable with its DWARF debugging symbols as a separate file (stripped via objcopy), would it be possible to convert those into PDB symbols instead? Thanks!

jtanx avatar Jan 07 '17 00:01 jtanx

What's your command line for keeping debug symbols in a separate file? I haven't found anything appropriate with --help.

If you want to ship an executable with stripped debug info, but keep the PDB for later crash dump analysis, have you tried to reverse the steps? Generate the PDB with cv2pdb, then strip DWARF info could work (or need a lot less changes).

rainers avatar Jan 07 '17 09:01 rainers

I am using mingw-w64 from the msys2 project, specifically objcopy and strip from the binutils package (mingw-w64-i686-binutils).

To extract the symbols, I run:

objcopy --only-keep-debug my-binary.exe my-binary.debug

To strip the binary, I run:

strip my-binary.exe -so my-stripped-binary.exe

But I think you can also just make use of objcopy only, maybe:

objcopy --strip-all my-binary.exe my-stripped-binary.exe

I hadn't thought about the reverse method of generating the PDB first, then stripping the DWARF symbols - I'll keep that in mind, thanks!

jtanx avatar Jan 07 '17 09:01 jtanx

@jtanx hello, is the suggested method of converting to PDB and only then stripping the debug symbols working? I am facing the same problem and wonder if I need to modify the cv2pdb or not.

foxeed avatar Apr 28 '17 12:04 foxeed

@foxeed I'm unaware of any changes to converting separate DWARF symbols. I haven't tried the other method, but I don't see why it won't work

jtanx avatar Apr 28 '17 21:04 jtanx

You can not use separate DWARF symbols because you have to understand exactly where linker relocates the object data to.

By mistake

excitoon avatar May 20 '22 12:05 excitoon