<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/test/Shell/SymbolFile/NativePDB, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[LLDB][NativePDB] Add non-overlapping fields in root struct (#166243)</title>
<updated>2025-11-05T18:07:44+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-11-05T18:07:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3c162ba247d30c9d8113e66fe5d96e24156ce797'/>
<id>3c162ba247d30c9d8113e66fe5d96e24156ce797</id>
<content type='text'>
When anonymous unions are used in a struct or vice versa, their fields
are merged into the parent record when using PDB. LLDB tries to recreate
the original definition of the record _with_ the anonymous
unions/structs.

For tagged unions (like `std::optional`) where the tag followed the
anonymous union, the result was suboptimal:

```cpp
// input:
struct Foo {
  union {
    Bar b;
    char c;
  };
  bool tag;
};

// reconstructed:
struct Foo {
  union {
    Bar b;
    struct {
      char c;
      bool tag;
    };
  };
};
```

Once the algorithm is in some nested union, it can't get out.

In the above case, we can get to the correct reconstructed record if we
always add fields that don't overlap others in the root struct. So when
we see `tag`, we'll see that it comes after all other fields, so it's
possible to add it in the root `Foo`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When anonymous unions are used in a struct or vice versa, their fields
are merged into the parent record when using PDB. LLDB tries to recreate
the original definition of the record _with_ the anonymous
unions/structs.

For tagged unions (like `std::optional`) where the tag followed the
anonymous union, the result was suboptimal:

```cpp
// input:
struct Foo {
  union {
    Bar b;
    char c;
  };
  bool tag;
};

// reconstructed:
struct Foo {
  union {
    Bar b;
    struct {
      char c;
      bool tag;
    };
  };
};
```

Once the algorithm is in some nested union, it can't get out.

In the above case, we can get to the correct reconstructed record if we
always add fields that don't overlap others in the root struct. So when
we see `tag`, we'll see that it comes after all other fields, so it's
possible to add it in the root `Foo`.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB][NativePDB] Estimate symbol sizes (#165727)</title>
<updated>2025-10-31T09:33:37+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-10-31T09:33:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=44fefe70e41a3b8e68545f45798740f74f4231cd'/>
<id>44fefe70e41a3b8e68545f45798740f74f4231cd</id>
<content type='text'>
In #165604, a test was skipped on Windows, because the native PDB plugin
didn't set sizes on symbols. While the test isn't compiled with debug
info, it's linked with `-gdwarf`, causing a PDB to be created on
Windows. This PDB will only contain the public symbols (written by the
linker) and section information. The symbols themselves don't have a
size, however the DIA SDK sets a size for them.
It seems like, for these data symbols, the size given from DIA is the
distance to the next symbol (or the section end).

This PR implements the naive approach for the native plugin. The main
difference is in function/code symbols. There, DIA searches for a
corresponding `S_GPROC32` which have a "code size" that is sometimes
slightly smaller than the difference to the next symbol.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In #165604, a test was skipped on Windows, because the native PDB plugin
didn't set sizes on symbols. While the test isn't compiled with debug
info, it's linked with `-gdwarf`, causing a PDB to be created on
Windows. This PDB will only contain the public symbols (written by the
linker) and section information. The symbols themselves don't have a
size, however the DIA SDK sets a size for them.
It seems like, for these data symbols, the size given from DIA is the
distance to the next symbol (or the section end).

This PR implements the naive approach for the native plugin. The main
difference is in function/code symbols. There, DIA searches for a
corresponding `S_GPROC32` which have a "code size" that is sometimes
slightly smaller than the difference to the next symbol.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB] Use native PDB reader by default (#165363)</title>
<updated>2025-10-29T15:51:38+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-10-29T15:51:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=287ca7b243facc7185bbd9dfdaa5a6a012819e1b'/>
<id>287ca7b243facc7185bbd9dfdaa5a6a012819e1b</id>
<content type='text'>
All PDB tests now pass when compiled without DIA on Windows, so they
pass with the native reader.

With this PR, the default reader changes to the native reader.
The plan is to eventually remove the DIA reader (see
https://discourse.llvm.org/t/rfc-removing-the-dia-pdb-plugin-from-lldb/87827
and #114906).

For now, DIA can be used by setting `plugin.symbol-file.pdb.reader` to
`dia` or by setting `LLDB_USE_NATIVE_PDB_READER=0` (mostly undocumented,
but used in tests).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All PDB tests now pass when compiled without DIA on Windows, so they
pass with the native reader.

With this PR, the default reader changes to the native reader.
The plan is to eventually remove the DIA reader (see
https://discourse.llvm.org/t/rfc-removing-the-dia-pdb-plugin-from-lldb/87827
and #114906).

For now, DIA can be used by setting `plugin.symbol-file.pdb.reader` to
`dia` or by setting `LLDB_USE_NATIVE_PDB_READER=0` (mostly undocumented,
but used in tests).</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB][NativePDB] Create simple types from function arguments and return types (#163621)</title>
<updated>2025-10-27T13:40:42+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-10-27T13:40:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=51cecd3f2ec9881b07fb7c2e4c1fb92408f66eb1'/>
<id>51cecd3f2ec9881b07fb7c2e4c1fb92408f66eb1</id>
<content type='text'>
When creating all types in a compilation unit, simple types (~&gt;
primitive and pointer types) that were only used in function arguments
or return types weren't created as LLDB `Type`s.

With this PR, they're created when creating the function/method types.
This makes it possible to run the `SymbolFile/PDB/typedefs.test` with
both plugins.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When creating all types in a compilation unit, simple types (~&gt;
primitive and pointer types) that were only used in function arguments
or return types weren't created as LLDB `Type`s.

With this PR, they're created when creating the function/method types.
This makes it possible to run the `SymbolFile/PDB/typedefs.test` with
both plugins.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB][NativePDB] Require `target-windows` for `func-symbols.test` (#164406)</title>
<updated>2025-10-21T12:23:50+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-10-21T12:23:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d9556d3475510d6d0910ecd6e5e07779302c90ef'/>
<id>d9556d3475510d6d0910ecd6e5e07779302c90ef</id>
<content type='text'>
The test builds files for Windows, so the target has to be required. I
didn't add this in #163733.

Fixes the failure from
https://github.com/llvm/llvm-project/pull/163733#issuecomment-3426275296.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test builds files for Windows, so the target has to be required. I
didn't add this in #163733.

Fixes the failure from
https://github.com/llvm/llvm-project/pull/163733#issuecomment-3426275296.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB][PDB] Split `func-symbols.test` between DIA and native (#163733)</title>
<updated>2025-10-21T11:47:39+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-10-21T11:47:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e9b6d35dc8d9db44bf8f606c778f689f874a8f5c'/>
<id>e9b6d35dc8d9db44bf8f606c778f689f874a8f5c</id>
<content type='text'>
The test checks that functions have the correct type assigned. Because
of the differences between the two PDB plugins, I split the test.
DIA creates one named `Type` per function and uses identical UIDs for
`Type` and `Function`, whereas native creates one unnamed type per
signature and has different UIDs.
The native test has the same input and checks the same functions.

I also removed the `target-windows` requirement from the test, since it
only uses `lldb-test`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test checks that functions have the correct type assigned. Because
of the differences between the two PDB plugins, I split the test.
DIA creates one named `Type` per function and uses identical UIDs for
`Type` and `Function`, whereas native creates one unnamed type per
signature and has different UIDs.
The native test has the same input and checks the same functions.

I also removed the `target-windows` requirement from the test, since it
only uses `lldb-test`.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB][NativePDB] Consolidate simple types (#163209)</title>
<updated>2025-10-15T11:42:14+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-10-15T11:42:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4b89704504dde687ba7983e034cb246581fd1407'/>
<id>4b89704504dde687ba7983e034cb246581fd1407</id>
<content type='text'>
This aligns the simple types created by the native plugin with the ones
from DIA as well as LLVM and the original cvdump.

- A few type names weren't handled when creating the LLDB `Type` name
(e.g. `short`)
- 64-bit integers were created as `(u)int64_t` and are now created as
`(unsigned) long long` (matches DIA)
- 128-bit integers (only supported by clang-cl) weren't created as types
(they have `SimpleTypeKind::(U)Int128Oct`)
- All complex types had the same name - now they have `_Complex
&lt;float-type&gt;`

Some types like `SimpleTypeKind::Float48` can't be tested because they
can't be created in C++.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This aligns the simple types created by the native plugin with the ones
from DIA as well as LLVM and the original cvdump.

- A few type names weren't handled when creating the LLDB `Type` name
(e.g. `short`)
- 64-bit integers were created as `(u)int64_t` and are now created as
`(unsigned) long long` (matches DIA)
- 128-bit integers (only supported by clang-cl) weren't created as types
(they have `SimpleTypeKind::(U)Int128Oct`)
- All complex types had the same name - now they have `_Complex
&lt;float-type&gt;`

Some types like `SimpleTypeKind::Float48` can't be tested because they
can't be created in C++.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB][NativePDB] Use typedef compiler type for typedef types (#156250)</title>
<updated>2025-10-13T09:49:39+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-10-13T09:49:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=648b3aab478840cd72913d23cbbb425dc890f86a'/>
<id>648b3aab478840cd72913d23cbbb425dc890f86a</id>
<content type='text'>
Before this PR, the native PDB plugin would create the following LLDB
`Type` for `using SomeTypedef = long`:
```
Type{0x00002e03} , name = "SomeTypedef", size = 4, compiler_type = 0x000002becd8d8620 long
```
with this PR, the following is created:
```
Type{0x00002e03} , name = "SomeTypedef", size = 4, compiler_type = 0x0000024d6a7e3c90 typedef SomeTypedef
```

This matches the behavior of the DIA PDB plugin and works towards making
[`Shell/SymbolFile/PDB/typedefs.test`](https://github.com/llvm/llvm-project/blob/main/lldb/test/Shell/SymbolFile/PDB/typedefs.test)
pass with the native plugin.

I added a similar test to the `NativePDB` shell tests to capture the
current state, which doesn't quite match that of DIA yet. I'll add some
comments on what's missing on this PR, because I'm not fully sure what
the correct output would be.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this PR, the native PDB plugin would create the following LLDB
`Type` for `using SomeTypedef = long`:
```
Type{0x00002e03} , name = "SomeTypedef", size = 4, compiler_type = 0x000002becd8d8620 long
```
with this PR, the following is created:
```
Type{0x00002e03} , name = "SomeTypedef", size = 4, compiler_type = 0x0000024d6a7e3c90 typedef SomeTypedef
```

This matches the behavior of the DIA PDB plugin and works towards making
[`Shell/SymbolFile/PDB/typedefs.test`](https://github.com/llvm/llvm-project/blob/main/lldb/test/Shell/SymbolFile/PDB/typedefs.test)
pass with the native plugin.

I added a similar test to the `NativePDB` shell tests to capture the
current state, which doesn't quite match that of DIA yet. I'll add some
comments on what's missing on this PR, because I'm not fully sure what
the correct output would be.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB] Require target-x86/x86_64 for MSVC C mangling test (#162335)</title>
<updated>2025-10-07T18:05:29+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-10-07T18:05:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c16d25282e7169cb8a19d9fa385cf7220dd65ac5'/>
<id>c16d25282e7169cb8a19d9fa385cf7220dd65ac5</id>
<content type='text'>
Fixes the test failure from
https://github.com/llvm/llvm-project/pull/161678#issuecomment-3377949862.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes the test failure from
https://github.com/llvm/llvm-project/pull/161678#issuecomment-3377949862.</pre>
</div>
</content>
</entry>
<entry>
<title>Reland "[LLDB][NativePDB] Create functions with mangled name" (#161678)</title>
<updated>2025-10-07T17:27:16+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-10-07T17:27:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3b14414cbdb8bd37ff861862a99a47104b87765b'/>
<id>3b14414cbdb8bd37ff861862a99a47104b87765b</id>
<content type='text'>
Relands #149701 which was reverted in
https://github.com/llvm/llvm-project/commit/185ae5cdc695248b58ae017508cc764c19bee5b7
because it broke demangling of Itanium symbols on i386.

The last commit in this PR adds the fix for this (discussed in #160930).
On x86 environments, the prefix of `__cdecl` functions will now be
removed to match DWARF. I opened #161676 to discuss this for the other
calling conventions.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Relands #149701 which was reverted in
https://github.com/llvm/llvm-project/commit/185ae5cdc695248b58ae017508cc764c19bee5b7
because it broke demangling of Itanium symbols on i386.

The last commit in this PR adds the fix for this (discussed in #160930).
On x86 environments, the prefix of `__cdecl` functions will now be
removed to match DWARF. I opened #161676 to discuss this for the other
calling conventions.</pre>
</div>
</content>
</entry>
</feed>
