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