[PATCH 0/1] MR10610: dbghelp/dwarf: Handle btBool values.
This was to get rid of FIXME I had with msxml3 tests crashes. I don't know if this is the correct way, or how to test it. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10610
From: Nikolay Sivov <nsivov@codeweavers.com> --- dlls/dbghelp/dwarf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 1dce6ba0df3..038cd74245a 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -838,6 +838,11 @@ static BOOL dwarf2_fill_in_variant(struct module *module, VARIANT *v, const stru V_UI8(v) = uinteger; } } + else if (bt == btBool) + { + V_VT(v) = VT_BOOL; + V_BOOL(v) = uinteger ? VARIANT_TRUE : VARIANT_FALSE; + } else { FIXME("Unexpected base type bt=%x for form=%Ix\n", bt, attr->form); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10610
@nsivov any idea of the source code that triggered that dwarf debug information (& compiler version if avail)? what's certain is that the generated VARIANT will not be correctly handled by winedbg we need more tests to 1) guess what MS VC generates in PDB and what native dbghelp reports in that case, 2) apply it (to dbghelp and/or winedbg) there's https://gitlab.winehq.org/epo/ditto for handling these test cases (even If I have a pile of uncommitted stuff that I shall push at some point) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10610#note_135653
On Thu Apr 9 12:07:08 2026 +0000, eric pouech wrote:
@nsivov any idea of the source code that triggered that dwarf debug information (& compiler version if avail)? what's certain is that the generated VARIANT will not be correctly handled by winedbg we need more tests to 1) guess what MS VC generates in PDB and what native dbghelp reports in that case, 2) apply it (to dbghelp and/or winedbg) there's https://gitlab.winehq.org/epo/ditto for handling these test cases (even If I have a pile of uncommitted stuff that I shall push at some point) I didn't do anything special, it was wine test exe, built with mingw-w64 by usual wine build process. I didn't use winedbg interactively, the fixme happened when dumping backtrace after a crash.
If you think this is not useful, or will be fixed differently at some point, feel free to close it. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10610#note_135657
I guess that's something like ``` 00e0:fixme:dbghelp_dwarf:dwarf2_fill_in_variant Unexpected base type bt=a for form=b 00e0:fixme:dbghelp_dwarf:dwarf2_parse_variable Unsupported form for const value "use_charref_lf" (b) ``` from `msxml3/mxwriter.c write_crlf()` i'll try to see if can come up with a code fragment on msvc that triggers a similar construct in pdb) since the fixme is generated by known code (and consequence is to not store the (const) value), we'd be better of fixing it -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10610#note_135661
On Thu Apr 9 12:49:12 2026 +0000, eric pouech wrote:
I guess that's something like ``` 00e0:fixme:dbghelp_dwarf:dwarf2_fill_in_variant Unexpected base type bt=a for form=b 00e0:fixme:dbghelp_dwarf:dwarf2_parse_variable Unsupported form for const value "use_charref_lf" (b) ``` from `msxml3/mxwriter.c write_crlf()` i'll try to see if can come up with a code fragment on msvc that triggers a similar construct in pdb) since the fixme is generated by known code (and consequence is to not store the (const) value), we'd be better of fixing it Yes, this looks very close to what I remember. I don't know if it was about helpers, or VARIANT_BOOL argument in loadXML() (which isn't a variant by itself).
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10610#note_135662
did some testing... couldn't manage to get MS C compiler to generate similar debug info with PDB need a local variable, with a constant value; that constant value shall be generated depending on inlined function parameters; and reported in debug info as a constant at lowest optim level, MS C does keep variable, but doesn't report it as constant in debug info (just a regular local var), at highest optim, it's optimzed away but got clang to generate a constant local variable with bool type tested on windows with native dbghelp and I can confirm that the variant (describing the constant value) contains a signed integer so I raised https://gitlab.winehq.org/wine/wine/-/merge_requests/10621 to replace this MR -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10610#note_135802
On Fri Apr 10 09:44:10 2026 +0000, eric pouech wrote:
did some testing... couldn't manage to get MS C compiler to generate similar debug info with PDB need a local variable, with a constant value; that constant value shall be generated depending on inlined function parameters; and reported in debug info as a constant at lowest optim level, MS C does keep variable, but doesn't report it as constant in debug info (just a regular local var), at highest optim, it's optimzed away but got clang to generate a constant local variable with bool type tested on windows with native dbghelp and I can confirm that the variant (describing the constant value) contains a signed integer so I raised https://gitlab.winehq.org/wine/wine/-/merge_requests/10621 to replace this MR Thank you, closing this one then.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10610#note_135804
This merge request was closed by Nikolay Sivov. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10610
participants (3)
-
eric pouech (@epo) -
Nikolay Sivov -
Nikolay Sivov (@nsivov)