3 Commits

Author SHA1 Message Date
Nerixyz
3dc46e9fff
[lldb] Use clang_cl_host to build vbases.test (#186857) 2026-03-17 08:10:16 +01:00
Nerixyz
77f9793425
[lldb][NativePDB] Compile vbases.test without default libraries (#186510)
#185735 added the `vbases.test`, which compiles with
`--target=x86_64-windows-msvc`. This will cause the final executable to
be linked to `libcmt.lib`. That doesn't work on ARM, so this PR changes
the command line to link without the default libraries. They're not
needed if we disable `/GS` (buffer security check) like in other tests.

We use `%clang_cl` over `%build` to be able to compile with DWARF as
well.
2026-03-16 15:24:15 +01:00
Nerixyz
fb9a0cd278
[LLDB][NativePDB] Ignore indirect virtual bases (#185735)
When a class indirectly inherits from a class with virtual bases, it
will get an `LF_IVBCLASS` record in its fieldlist, even though it
doesn't directly inherit that class.

In the following example, `UserUser` inherits from `User`, which
virtually inherits from `VBase`:

```cpp
struct User : public virtual VBase {};
struct UserUser : public User {};
```

For this we get
```
  0x1015 | LF_FIELDLIST [size = 72]
           - LF_BCLASS
             type = 0x1002 (-> 0x102A), offset = 0, attrs = public
           - LF_IVBCLASS
             base = 0x1003, vbptr = 0x1005, vbptr offset = 0, vtable index = 1
             attrs = public (...)
  0x1016 | LF_STRUCTURE [size = 48] `UserUser`
           unique name: `.?AUUserUser@@`
           vtable: <no type>, base list: <no type>, field list: 0x1015
           options: has ctor / dtor | has unique name | overloaded operator | overloaded operator=, sizeof 16
  0x1029 | LF_FIELDLIST [size = 56]
           - LF_VBCLASS
             base = 0x1003, vbptr = 0x1005, vbptr offset = 0, vtable index = 1
             attrs = public (...)
  0x102A | LF_STRUCTURE [size = 40] `User`
           unique name: `.?AUUser@@`
           vtable: <no type>, base list: <no type>, field list: 0x1029
           options: has ctor / dtor | has unique name | overloaded operator | overloaded operator=, sizeof 16
```

If I understand correctly, then `LF_IVBCLASS` indicates that if this
class (e.g. `UserUser`) is created as the most derived object, it will
host the class (e.g. `VBase`).
The VS debugger actually shows this as a separate field. LLDB on the
other hand doesn't, so I removed it.

---------

Co-authored-by: Zequan Wu <zequanwu@google.com>
2026-03-11 12:19:15 +01:00