Can I display a local variable as specific struct/data type while debugging?

Viewed 173

I'm debugging a program that I have the symbols of, and I'm trying to check what is the value inside a given variable - data from the WinDbg console.

The declaration of data is as follow: std::vector<unsigned char> data;, but I know that it contains a struct, let's call it MY_STRUCT.

Is there any easy way to display the values that stored in data like it has been initialized as MY_STRUCT data type?

In my case MY_STRUCT is long and complex structure that I can't understand by only looking at the output of: dv data.

Thank you.

1 Answers

Well, after searching in the documentation and trying a few methods, I have found two possible solutions:

First - using dt command:

dt -a <ADDRESS_OF_DATA> MY_STRUCT

Second option:

dt MY_STRUCT <ADDRESS_OF_DATA>
Related