<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55040>55040</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            lldb::SBTypeMember has no way to distinguish static fields
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          siggi-alpheus
      </td>
    </tr>
</table>

<pre>
    I had a hiccup trying to figure the virtual pointer layout of [this class from google/glog](https://github.com/google/glog/blob/master/src/logging.cc#L433). The heuristic used in the [types.py](https://github.com/llvm/llvm-project/blob/main/lldb/examples/python/types.py) example looks for an initial field that starts at a pointer-size offset into the class. When the first field of a class is static, it appears this heuristic will fail, as the static member returns a zero offset.

I haven't found any good way to identify or filter out static members, [it appears the data isn't there at all](https://github.com/llvm/llvm-project/blob/main/lldb/include/lldb/Symbol/Type.h#L346).
Maybe SBTypeMember needs an IsStatic() function, or perhaps GetOffsetInBytes() could return a sentinel value to indicate that the member does not have this pointer offset?

Here's what the "offending" code looks like:
```
class LogFileObject : public base::Logger {
 public:
  LogFileObject(LogSeverity severity, const char* base_filename);
  ~LogFileObject();
...
 private:
  static const uint32 kRolloverAttemptFrequency = 0x20;

  Mutex lock_;
...
};
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVE1v4zYQ_TXyZRBBpmTHOujgbOo2wAYLNAvscUFJI4kNTar8cKL99R1SUhK3h8UCBQyZnzNv3nvDWrdT9QADb4HDIJrGj-DMJFQPTkMnem8Q3IBwEcZ5LmHUQjk0IPmkvQPdQbK7c4Ow0EhuLXRGn6HXupeYsFMvdZ_s7hN2GJwbbZIfaTGsCzf4Om30OUyuTrNTLXVNf2duKRENrGnoS3s9wUobmuSfizxPWJnCV4I2oDfCOtGAt9iCUBFwgDWNaNNx-ikCKS_r381o9F_YuI84hIqbbZjhKz-PEi0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