microsoft / MIEngine

The Visual Studio MI Debug Engine ("MIEngine") provides an open-source Visual Studio Debugger extension that works with MI-enabled debuggers such as gdb and lldb.
MIT License
818 stars 219 forks source link

Type template parameter not stringified #846

Open zhihaoy opened 5 years ago

zhihaoy commented 5 years ago

Expansion in such a form

<ExpandedItem Condition="which() ==  0" Optional="true">( $T1 *) &amp;rep_.data</ExpandedItem>

only works in cppvsdbg. $T1 is a type template parameter (rather than a non-type template parameter) and the full expansion should be treated as a cast. The expression does evaluate correctly in evaluator.

pieandcakes commented 5 years ago

@zhihaoy Is this referring to .natvis?

zhihaoy commented 5 years ago

Yes, a Natvis feature is missing in MIEngine.

pieandcakes commented 5 years ago

Do you have a sample natvis and project I can use to verify the fix?

zhihaoy commented 5 years ago

The natvis I will show later works in cppvsdbg, but not cppdbg on Linux. The problem is here https://github.com/lichray/oneof/tree/cppvsdbg , please checkout the cppvcdbg branch, which has a sample launch.js already (please update paths if needed. If you break on the stdex::oneof line in VScode debugger on Windows with MSVC, initially it shows nothing, step to the next line, you will see

image

But in Linux (after switching to cppdbg in launch.js and the paths), you don't see the debugger visualization at the same step.