-
Notifications
You must be signed in to change notification settings - Fork 111
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
debug gcc #30
Comments
Are you able to set breakpoints? You can use https://github.com/Microsoft/microsoft-pdb/tree/master/cvdump to dump the resulting PDB file and verify whether it contains sensible line numbers. |
Thanks, it works if put breakpoint in source file |
64-bit mingw is used here. And by "indicate variables" watches/locals/autos in Visual Studio debugger are meant I assume. They are not available in most cases, although it's written in the Features section:
So it should be supported. May there be a problem in lack of dwarf debug info in the source dll/exe? Which are the recommended mingw options in that case? The source language for the library we're trying to debug is C, not C++. And we link that to a VS C++ program. Will posting cvdump output be any helpful? It's already very nice that we're able to set breakpoints and see call stack I think, but full-featured debugging is what we seek for. Thank you! |
I suspect it very much depends on the debug info emitted by gcc. If you can provide an example executable/DLL that you want to convert and specify which functions' locals don't work I can have a look. There has been a recent improvement to locals in #24 which has not yet made it into the downloadable executable. I just triggered a new build, should be available in a couple of minutes. |
I try to use new downloadable executable - it crashed on the files with that previous downloadable executable works well |
I just tried gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 7.3.0 and it worked ok for me. |
while @krylovgeorgii is working on getting executables, may I ask, which dwarf version should we use for the dwarf debug info? gcc defaults to version 4, but version 5 (experimental) also could be used. Found here |
Example of .dll with that that last downloadable executable crashed but previous works |
@rainers we use gcc (Rev1, Built by MSYS2 project) 7.3.0 I don't know if it's interesting for you, but just cloning the repository and running If you don't want to bother with it, maybe you want us to prepare an archive with sources included, so you could try some debugging on your machine? |
I've fixed the regression in the last version and another older issue. Should be already available as download. cv2pdb has very little support for DWARF3 and 4, but your dump uses DW_FORM_sec_offset which is DWARF4 (the DLL name suggests otherwise, though). I added a bit of support for that but I guess it won't help too much because a lot of functions seem to be built with frame-pointer-omission. cv2pdb needs a frame pointer for local variables. So I'd suggest trying to build with |
I build with flags " -O0 -gdwarf-2 -fno-omit-frame-pointer " but locals variables dont works |
Hmmm, this DLL still doesn't use the frame pointer very often to address local variables. For example the output of
and the respective location lists that describe where to find the variables:
without any reference to the usual frame pointer |
Seems like It's weird that To be sure that our toolchain is "sane", I think it makes sense to compile a smaller library and see if it works. Do you have by change any sample library/executable that you use for tests of new cv2pdb versions? Otherwise I will pick up a random one. Btw we could make some documentation on cv2pdb troubleshooting in the end, so other people would know what to look for (cvdump/objdump/etc). |
Any random small program should be fine. I have used this simple program for some regression tests in the past:
I run |
Debug settings for cv2pdb based on discussion in this issue: rainers/cv2pdb#30 No noticeable difference, but cv2pdb might work someday! Signed-off-by: Dakota Hawkins <[email protected]>
Debug settings for cv2pdb based on discussion in this issue: rainers/cv2pdb#30 No noticeable difference, but cv2pdb might work someday! Signed-off-by: Dakota Hawkins <[email protected]>
How to debug a program compiled with gcc?
I try to build .dll by gcc with -gdwarf option and use cv2pdb with -C option:
Visual Studio load pdb symbols but cant go into functions from .dll by F11
The text was updated successfully, but these errors were encountered: