summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.cpp
diff options
context:
space:
mode:
authornerix <nerixdev@outlook.de>2025-11-05 19:07:44 +0100
committerGitHub <noreply@github.com>2025-11-05 19:07:44 +0100
commit3c162ba247d30c9d8113e66fe5d96e24156ce797 (patch)
treef7159b690f8592f3bf1c83a7125635984df49ae6 /lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.cpp
parentd49c6707d07389e4bccdb23951dc9d3bc20996b1 (diff)
[LLDB][NativePDB] Add non-overlapping fields in root struct (#166243)
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`.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.cpp')
0 files changed, 0 insertions, 0 deletions