qt-labs / vstools

Other
73 stars 24 forks source link

qt6.natvis gives warnings with windbg #29

Open JVApen opened 2 months ago

JVApen commented 2 months ago

Describe the bug When linking the qt6.natvis in the pdb and than loading a dump file with windbg, we get a warning:

Error (0x80004005): Expected expression at ''\0' : char(ucs),c' (line 221 (@ 14))

To Reproduce Steps to reproduce the behavior:

  1. Use windows
  2. Use any application code that you can take a dump of
  3. When linking, use /NATVIS:<path/to/qt6.natvis>
  4. Run the application
  5. Create a full memory dump (for example via task manager)
  6. Open windbg and drag the dump file in it
  7. Run the kb command

Expected behavior See a clean callstack

Actual behavior This is printed in between the stack frames

Error (0x80004005): Expected expression at ''\0' : char(ucs),c' (line 221 (@ 14))

Desktop

Additional context The natvis for QChar contains:

<Item Name="[latin 1]">ucs > 0xff ? '\0' : char(ucs),c</Item>

I've replaced this locally with

<Item Name="[latin 1]">((ucs &gt; 0xff)?(char)0:(char)ucs),c</Item>

This seems to resolve the problem.

kaheimri commented 1 month ago

Hi and thanks for reporting the issue to us. Can you me a favor please and see it the following will work for you too:

<Item Name="[latin 1]">ucs > 0xff ? 0 : ucs,c</Item>

Many thanks.

acdemiralp commented 2 weeks ago

I can confirm that it works: Successfully parsed expression 'ucs > 0xff ? 0 : ucs,c' in type context 'QChar'.

See https://codereview.qt-project.org/c/qt-labs/vstools/+/584565 for a patch.

Any further natvis warnings will be addressed as part of https://bugreports.qt.io/browse/QTVSADDINBUG-743 and https://codereview.qt-project.org/c/qt-labs/vstools/+/545648