title: ghidra: how to get static variables using ghidra python api?
body: <p>I have a following c code (from a benchmark):</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
    static   char buf[10] = "";
  
  
    /*  OK  */
    buf[9] = 'A';
  
  
    return 0;
  }
  </code></pre>
  
  <p>I am using ghidra api to get some information out of the binary (precompiled using flag <code>-g</code>).  I want to get the variables defined in the function (or globally).</p>
  
  <pre><code>function.getStackFrame().getStackVariables()
  </code></pre>
  
  <p>gives me variables defined within the function, but it doesn't detect <code>buf</code>, as it is defined as <code>static</code>. From ghidra gui I was able to see that the variables is defined in the "main" under namespaces.</p>
  
  <p>Is there way to get these type of variables (or global variables in general)?</p>