Are there any analog of the C++ this
keyword, that can be used in natvis expressions when debugging C code?
I would like to do the following and have no mind how to do it without this
.
Consider we have some struct in C:
typedef struct
{
int state;
//other fields follow
}TCB;
Also there is global variable:
TCB* Running;
I want to make natvis rules that will show the state of the object based on the state
field and Running
variable. If it was C++, I would write:
<Type Name="TCB">
<DisplayString Condition="state==0">Empty</DisplayString>
<DisplayString Condition="state==0x80 && Running!=this">Ready</DisplayString>
<DisplayString Condition="state==0x80 && Running==this">Running</DisplayString>
</Type>
How it can be done in C?
Thanks!
P.S. natvis file is used in VSCode with gdb debugger.