<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/test/API/lang/cpp/gmodules, 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>Reland "[lldb][Modules] Fix error handling of parseAndLoadModuleMapFile (#141220)"</title>
<updated>2025-05-29T11:06:29+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-05-29T11:03:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7bd8e376fca22cac9593e93450a545573d3ff5f4'/>
<id>7bd8e376fca22cac9593e93450a545573d3ff5f4</id>
<content type='text'>
This reverts commit 57f3151a3144259f4e830fc43a1424e4c1f15985.

LLDB was hitting an assert when compiling the `std` module. The `std`
module was being pulled in because we use `#import &lt;cstdio&gt;` in the test
to set a breakpoint on `puts`. That's redundant and to work around the
crash we just remove that include. The underlying issue of compiling the
`std` module still exists and I'll investigate that separately. The
reason it started failing after the `ClangModulesDeclVendor` patch is that we would previously just fail to load the modulemap (and thus not load any of the modules). Now we do load the modulemap (and modules) when we prepare for parsing the expression.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 57f3151a3144259f4e830fc43a1424e4c1f15985.

LLDB was hitting an assert when compiling the `std` module. The `std`
module was being pulled in because we use `#import &lt;cstdio&gt;` in the test
to set a breakpoint on `puts`. That's redundant and to work around the
crash we just remove that include. The underlying issue of compiling the
`std` module still exists and I'll investigate that separately. The
reason it started failing after the `ClangModulesDeclVendor` patch is that we would previously just fail to load the modulemap (and thus not load any of the modules). Now we do load the modulemap (and modules) when we prepare for parsing the expression.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][test] Add test for chained PCH debugging (#83582)</title>
<updated>2024-03-04T17:17:13+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2024-03-04T17:17:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=252f3c98db1383ee0e1f25020d488ffb7b4ac392'/>
<id>252f3c98db1383ee0e1f25020d488ffb7b4ac392</id>
<content type='text'>
Adds a test-case for debugging a program with a
pch chain, that is, the main executable depends
on a pch that itself included another pch.

Currently clang doesn't emit the sekeleton CUs
required for LLDB to track all types on the pch chain. Thus this test is
XFAILed for now.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds a test-case for debugging a program with a
pch chain, that is, the main executable depends
on a pch that itself included another pch.

Currently clang doesn't emit the sekeleton CUs
required for LLDB to track all types on the pch chain. Thus this test is
XFAILed for now.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][ClangASTImporter] Import record layouts from origin if available (#83295)</title>
<updated>2024-02-29T21:40:02+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2024-02-29T21:40:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=07ffb7e294767b74e43f90e9ab3d713da929b907'/>
<id>07ffb7e294767b74e43f90e9ab3d713da929b907</id>
<content type='text'>
Layout information for a record gets stored in the `ClangASTImporter`
associated with the `DWARFASTParserClang` that originally parsed the
record. LLDB sometimes moves clang types from one AST to another (in the
reproducer the origin AST was a precompiled-header and the destination
was the AST backing the executable). When clang then asks LLDB to
`layoutRecordType`, it will do so with the help of the
`ClangASTImporter` the type is associated with. If the type's origin is
actually in a different LLDB module (and thus a different
`DWARFASTParserClang` was used to set its layout info), we won't find
the layout info in our local `ClangASTImporter`.

In the reproducer this meant we would drop the alignment info of the
origin type and misread a variable's contents with `frame var` and
`expr`.

There is logic in `ClangASTSource::layoutRecordType` to import an
origin's layout info. This patch re-uses that infrastructure to import
an origin's layout from one `ClangASTImporter` instance to another.

rdar://123274144</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Layout information for a record gets stored in the `ClangASTImporter`
associated with the `DWARFASTParserClang` that originally parsed the
record. LLDB sometimes moves clang types from one AST to another (in the
reproducer the origin AST was a precompiled-header and the destination
was the AST backing the executable). When clang then asks LLDB to
`layoutRecordType`, it will do so with the help of the
`ClangASTImporter` the type is associated with. If the type's origin is
actually in a different LLDB module (and thus a different
`DWARFASTParserClang` was used to set its layout info), we won't find
the layout info in our local `ClangASTImporter`.

In the reproducer this meant we would drop the alignment info of the
origin type and misread a variable's contents with `frame var` and
`expr`.

There is logic in `ClangASTSource::layoutRecordType` to import an
origin's layout info. This patch re-uses that infrastructure to import
an origin's layout from one `ClangASTImporter` instance to another.

rdar://123274144</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][Py Reformat] Reformat python files in lldb</title>
<updated>2023-05-25T19:54:09+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2023-05-25T15:48:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2238dcc39358353cac21df75c3c3286ab20b8f53'/>
<id>2238dcc39358353cac21df75c3c3286ab20b8f53</id>
<content type='text'>
This is an ongoing series of commits that are reformatting our Python
code. Reformatting is done with `black` (23.1.0).

If you end up having problems merging this commit because you have made
changes to a python file, the best way to handle that is to run `git
checkout --ours &lt;yourfile&gt;` and then reformat it with black.

RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Differential revision: https://reviews.llvm.org/D151460
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is an ongoing series of commits that are reformatting our Python
code. Reformatting is done with `black` (23.1.0).

If you end up having problems merging this commit because you have made
changes to a python file, the best way to handle that is to run `git
checkout --ours &lt;yourfile&gt;` and then reformat it with black.

RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Differential revision: https://reviews.llvm.org/D151460
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][test] 2 - Add gmodules test category explicitly where previously done implicitly</title>
<updated>2022-09-26T18:54:24+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2022-09-23T22:39:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1c6826e8fc6d5c47c3ffff573efd8d080939a932'/>
<id>1c6826e8fc6d5c47c3ffff573efd8d080939a932</id>
<content type='text'>
Since we don't compile with `gmodules` implicitly via
debug-info test replication, we should mark all implicit
`gmodules` tests with the appropriate category so the API
tests get actually run as intended.

Differential Revision: https://reviews.llvm.org/D134574
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since we don't compile with `gmodules` implicitly via
debug-info test replication, we should mark all implicit
`gmodules` tests with the appropriate category so the API
tests get actually run as intended.

Differential Revision: https://reviews.llvm.org/D134574
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][ASTImporter] DeclContext::localUncachedLookup: Continue lookup into decl chain when regular lookup fails</title>
<updated>2022-09-16T16:38:50+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2022-09-15T02:37:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e456d2ba8bcadaa63386b339a4f2abcb39505502'/>
<id>e456d2ba8bcadaa63386b339a4f2abcb39505502</id>
<content type='text'>
The uncached lookup is mainly used in the ASTImporter/LLDB code-path
where we're not allowed to load from external storage. When importing
a FieldDecl with a DeclContext that had no external visible storage
(but came from a Clang module or PCH) the above call to `lookup(Name)`
the regular `DeclContext::lookup` fails because:
1. `DeclContext::buildLookup` doesn't set `LookupPtr` for decls
   that came from a module
2. LLDB doesn't use the `SharedImporterState`

In such a case we would never continue with the "slow" path of iterating
through the decl chain on the DeclContext. In some cases this means that
ASTNodeImporter::VisitFieldDecl ends up importing a decl into the
DeclContext a second time.

The patch removes the short-circuit in the case where we don't find
any decls via the regular lookup.

**Tests**

* Un-skip the failing LLDB API tests

Differential Revision: https://reviews.llvm.org/D133945
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The uncached lookup is mainly used in the ASTImporter/LLDB code-path
where we're not allowed to load from external storage. When importing
a FieldDecl with a DeclContext that had no external visible storage
(but came from a Clang module or PCH) the above call to `lookup(Name)`
the regular `DeclContext::lookup` fails because:
1. `DeclContext::buildLookup` doesn't set `LookupPtr` for decls
   that came from a module
2. LLDB doesn't use the `SharedImporterState`

In such a case we would never continue with the "slow" path of iterating
through the decl chain on the DeclContext. In some cases this means that
ASTNodeImporter::VisitFieldDecl ends up importing a decl into the
DeclContext a second time.

The patch removes the short-circuit in the case where we don't find
any decls via the regular lookup.

**Tests**

* Un-skip the failing LLDB API tests

Differential Revision: https://reviews.llvm.org/D133945
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][tests][gmodules] Test for expression evaluator crash for types referencing the same template</title>
<updated>2022-09-16T16:38:49+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2022-09-15T02:36:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3004a759bcdf7b0a2a3a4220ed216d20defbd081'/>
<id>3004a759bcdf7b0a2a3a4220ed216d20defbd081</id>
<content type='text'>
The problem here is that the ASTImporter adds
the template class member FieldDecl to
the DeclContext twice. This happens because
we don't construct a `LookupPtr` for decls
that originate from modules and thus the
ASTImporter never realizes that the FieldDecl
has already been imported. These duplicate
decls then break the assumption of the LayoutBuilder
which expects only a single member decl to
exist.

The test will be fixed by a follow-up revision
and is thus skipped for now.

Differential Revision: https://reviews.llvm.org/D133944
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The problem here is that the ASTImporter adds
the template class member FieldDecl to
the DeclContext twice. This happens because
we don't construct a `LookupPtr` for decls
that originate from modules and thus the
ASTImporter never realizes that the FieldDecl
has already been imported. These duplicate
decls then break the assumption of the LayoutBuilder
which expects only a single member decl to
exist.

The test will be fixed by a follow-up revision
and is thus skipped for now.

Differential Revision: https://reviews.llvm.org/D133944
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][tests] Move C++ gmodules tests into new gmodules/ subdirectory</title>
<updated>2022-09-14T18:45:35+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2022-09-14T16:31:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3b44c9af8efd95aba7b4f351e5175ebf02e7b396'/>
<id>3b44c9af8efd95aba7b4f351e5175ebf02e7b396</id>
<content type='text'>
This is in preparation for adding more gmodules
tests.

Differential Revision: https://reviews.llvm.org/D133876
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is in preparation for adding more gmodules
tests.

Differential Revision: https://reviews.llvm.org/D133876
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][tests] Automatically call compute_mydir (NFC)</title>
<updated>2022-06-17T21:34:49+00:00</updated>
<author>
<name>Dave Lee</name>
<email>davelee.com@gmail.com</email>
</author>
<published>2022-06-17T00:38:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4cc8f2a017c76af25234afc7c380550e9c93135c'/>
<id>4cc8f2a017c76af25234afc7c380550e9c93135c</id>
<content type='text'>
Eliminate boilerplate of having each test manually assign to `mydir` by calling
`compute_mydir` in lldbtest.py.

Differential Revision: https://reviews.llvm.org/D128077
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Eliminate boilerplate of having each test manually assign to `mydir` by calling
`compute_mydir` in lldbtest.py.

Differential Revision: https://reviews.llvm.org/D128077
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Add assertState function to the API test suite</title>
<updated>2022-06-08T23:16:38+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2022-06-08T22:57:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ce825e46743be3e402820484bef639d12deefc2a'/>
<id>ce825e46743be3e402820484bef639d12deefc2a</id>
<content type='text'>
Add a function to make it easier to debug a test failure caused by an
unexpected state.

Currently, tests are using assertEqual which results in a cryptic error
message: "AssertionError: 5 != 10". Even when a test provides a message
to make it clear why a particular state is expected, you still have to
figure out which of the two was the expected state, and what the other
value corresponds to.

We have a function in lldbutil that helps you convert the state number
into a user readable string. This patch adds a wrapper around
assertEqual specifically for comparing states and reporting better error
messages.

The aforementioned error message now looks like this: "AssertionError:
stopped (5) != exited (10)". If the user provided a message, that
continues to get printed as well.

Differential revision: https://reviews.llvm.org/D127355
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a function to make it easier to debug a test failure caused by an
unexpected state.

Currently, tests are using assertEqual which results in a cryptic error
message: "AssertionError: 5 != 10". Even when a test provides a message
to make it clear why a particular state is expected, you still have to
figure out which of the two was the expected state, and what the other
value corresponds to.

We have a function in lldbutil that helps you convert the state number
into a user readable string. This patch adds a wrapper around
assertEqual specifically for comparing states and reporting better error
messages.

The aforementioned error message now looks like this: "AssertionError:
stopped (5) != exited (10)". If the user provided a message, that
continues to get printed as well.

Differential revision: https://reviews.llvm.org/D127355
</pre>
</div>
</content>
</entry>
</feed>
