Debug symbols in winedbg

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
sismis
Newbie
Newbie
Posts: 3
Joined: Wed Jul 31, 2024 4:09 am

Debug symbols in winedbg

Post by sismis »

Hi all!

I have a very weird error I want to debug. I develop a pet project simulation, and so far I've used SDL2+OpenGL. Now I want to add a vulkan backend. I develop on linux and produce windows binaries with the mingw cross-compiler, and run the results in wine.

Since I added the Vulkan backend everything works fine on linux, but wine crashes. After reading up on it I decided to try my luck with winedbg. My problem is that it seems to me that wine does not recognize the debug info in the exe file. I checked the wine makefile, I saw that it builds itself with -gdwarf-4, so I build with that too.

Code: Select all

objdump --syms evolife.exe
This produces a ton of lines, so debug info is definetly there.
What am I doing wrong? How should I build the exe so winedbg can recognize the debug info? Winedbg says:

Code: Select all

00fc:fixme:dbghelp_dwarf:dwarf2_lookup_type Unable to load forward reference for tag 1f
00fc:fixme:dbghelp_dwarf:dwarf2_lookup_type Unable to load forward reference for tag 1f
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x10 at debug_info(abbrev:00007E9662D00D40,symt:00007E96566D0B40) in ctx(00007FFFFEBB13B0,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x10 at debug_info(abbrev:00007E9662D00D40,symt:00007E96566D1200) in ctx(00007FFFFEBB13B0,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x10 at debug_info(abbrev:00007E9662D00D40,symt:00007E96566F3350) in ctx(00007FFFFEBB13B0,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x10 at debug_info(abbrev:00007E9662D00D40,symt:00007E96566FFAD0) in ctx(00007FFFFEBB13B0,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x10 at debug_info(abbrev:00007E9662D00D40,symt:00007E965671DF20) in ctx(00007FFFFEBB13B0,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x10 at debug_info(abbrev:00007E9662D00D40,symt:00007E9656743EE0) in ctx(00007FFFFEBB13B0,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x10 at debug_info(abbrev:00007E9662D00D40,symt:00007E965677CAD0) in ctx(00007FFFFEBB13B0,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x10 at debug_info(abbrev:00007E9662D00D40,symt:00007E96568BAE00) in ctx(00007FFFFEBB13B0,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x1 at debug_info(abbrev:00007E9662A30CC0,symt:00007E96550365D0) in ctx(00007FFFFEBB1970,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram_block Unhandled Tag type 0x1 at debug_info(abbrev:00007E96621D5EC0,symt:0000000000000000) in ctx(00007FFFFEBB1A40,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x1 at debug_info(abbrev:00007E96621D5F20,symt:00007E9655389620) in ctx(00007FFFFEBB1A40,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x1 at debug_info(abbrev:00007E96620A85A0,symt:00007E9655714980) in ctx(00007FFFFEBB1E50,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x1 at debug_info(abbrev:00007E9661FE0DA0,symt:00007E9655C81770) in ctx(00007FFFFEBB20C0,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x4106 at debug_info(abbrev:00007E9661FA0DE0,symt:00007E964ED21C60) in ctx(00007FFFFEBB2190,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x4106 at debug_info(abbrev:00007E9661FA0DE0,symt:00007E964ED21CF0) in ctx(00007FFFFEBB2190,L"evolife")
... 100s of lines of this
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x4106 at debug_info(abbrev:00007E9661FA0DE0,symt:00007E964E045F90) in ctx(00007FFFFEBB2190,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x4106 at debug_info(abbrev:00007E9661FA0DE0,symt:00007E964E046020) in ctx(00007FFFFEBB2190,L"evolife")
00fc:fixme:dbghelp_dwarf:dwarf2_parse_subprogram Unhandled Tag type 0x37 at debug_info(abbrev:00007E9661CE0CE0,symt:00007E964C125550) in ctx(00007FFFFEBB2A90,L"evolife")
sismis
Newbie
Newbie
Posts: 3
Joined: Wed Jul 31, 2024 4:09 am

Re: Debug symbols in winedbg

Post by sismis »

Forgot to mention, the backtrace is simply an offset, with zero debug symbols:

Code: Select all

Backtrace:
=>0 0x000001401766f6 in evolife (+0x1766f6) (0x007ffffe2ffe30)
0x000001401766f6 evolife+0x1766f6: orq $0x00, (%rcx)
User avatar
DarkShadow44
Level 9
Level 9
Posts: 1338
Joined: Tue Nov 22, 2016 5:39 pm

Re: Debug symbols in winedbg

Post by DarkShadow44 »

Does it work on Windows, aka is it an issue with your program or with Wine?
sismis
Newbie
Newbie
Posts: 3
Joined: Wed Jul 31, 2024 4:09 am

Re: Debug symbols in winedbg

Post by sismis »

I realized winedbg is happy with C code, but not really with C++.
I found a stackoverflow thread where they suggested a gdbserver setup:
https://stackoverflow.com/questions/399 ... e-on-linux

Code: Select all

wine Z:/usr/share/win64/gdbserver.exe localhost:12345 ./evolife.exe
x86_64-w64-mingw32-gdb evolife.exe
target extended-remote localhost:12345
I realized the stack is corrupted, so I recompiled with -fstack-protector-all.
Then I saw my failing vulkan object constructor, but with a line number pointing at the end of file.
Okay, I recompiled with -ggdb, since I am using gdb. This just works.
With the info at hand I cleaned up my constructor.

I think the compiler did something funky with it, since it was just working on linux, -Wall -Wextra -Wpendantic said nothing, but the main point: I learned how to debug under wine and my code works!
Locked