Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using separate DWARF debugging symbols as input #17

Open
jtanx opened this issue Jan 7, 2017 · 5 comments
Open

Using separate DWARF debugging symbols as input #17

jtanx opened this issue Jan 7, 2017 · 5 comments

Comments

@jtanx
Copy link

jtanx commented Jan 7, 2017

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!

@rainers
Copy link
Owner

rainers commented Jan 7, 2017

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).

@jtanx
Copy link
Author

jtanx commented Jan 7, 2017

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!

@foxeed
Copy link

foxeed commented Apr 28, 2017

@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.

@jtanx
Copy link
Author

jtanx commented Apr 28, 2017

@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

@excitoon
Copy link

excitoon commented May 20, 2022

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

By mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants