jrfonseca / drmingw

Postmortem debugging tools for MinGW.
GNU Lesser General Public License v2.1
273 stars 53 forks source link

Allow reading debug symbols from external files #11

Closed renatosilva closed 9 years ago

renatosilva commented 9 years ago

Can you please allow for reading debug symbols from external files, like implemented in this old fork? Thanks in advance.

jrfonseca commented 9 years ago

I don't know if you noticed, but I recently added support for .gnu_debuglink -- https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html -- which is the standard way of doing this sort of thing with GDB/MinGW.

I'm afraid I'm not interesting in supporting a non-standard way.

dismine commented 9 years ago

Do you know that feature no more works?

jrfonseca commented 9 years ago

Do you know that feature no more works?

@dismine , are you saying that .gnu_debuglink doesn't work anymore?

I wrote a unit test for it (test_mgwhelp_stripped) , and it is passing on multiple machines. So it works at least in some cases. If it doesn't work for you please file a bug report and provide more information.

dismine commented 9 years ago

@dismine , are you saying that .gnu_debuglink doesn't work anymore?

Yes, i do. And wrote you a letter about it.

If it doesn't work for you please file a bug report and provide more information.

Ok, i will make a bug report.

jrfonseca commented 9 years ago

Yes, i do. And wrote you a letter about it.

OK. Indeed I got your email about the regression, and I got it starred for further action, but when I read it, I somehow mixed up with your other email thread about line number differences, and not the split debug symbols issue.

Thanks for the issue report though. It's easier for me to track these things in the issue tracker.

renatosilva commented 9 years ago

@jrfonseca, GDB seems to organize the symbol files based on FHS structure, which is usually not applicable to Windows programs. They will unlikely support non-FHS models such as Program Files. So instead of spreading .debug files or subdirectories all over the place, your application is usually better organized if you keep them within a simple, separate subdirectory. The commit I mentioned allows for this with SetDebugInfoDir.

jrfonseca commented 9 years ago

Currently the debug files have to be in same dir as the executables.

If that's insufficient I'd rather add support for searching the MinGW debug files into _NT_SYMBOL_PATH

renatosilva commented 9 years ago

Using the structure expected by GDB instead of implementing SetDebugInfoDir is convenient because it can find the symbols automatically, yes. But GDB will also search for the symbol files within a .debug folder alongside the executable, so could you implement this as well?

jrfonseca commented 9 years ago

But GDB will also search for the symbol files within a .debug folder alongside the executable, so could you implement this as well?

Yes, that seems a good idea. I'm not sure exactly when to do it -- I'm tired of ugly and buggy filepath manipulation code, and want to start using strsafe.h or std::string. But please file a bug and I'll eventually get around to do it.