|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2 |
|
| #
fd146460 |
| 22-Apr-2022 |
Shafik Yaghmour <[email protected]> |
[LLDB] Applying clang-tidy modernize-use-override over LLDB
Applied clang-tidy modernize-use-override over LLDB and added it to the LLDB .clang-tidy config.
Differential Revision: https://reviews.l
[LLDB] Applying clang-tidy modernize-use-override over LLDB
Applied clang-tidy modernize-use-override over LLDB and added it to the LLDB .clang-tidy config.
Differential Revision: https://reviews.llvm.org/D123340
show more ...
|
|
Revision tags: llvmorg-14.0.1 |
|
| #
24f9a2f5 |
| 31-Mar-2022 |
Shafik Yaghmour <[email protected]> |
[LLDB] Applying clang-tidy modernize-use-equals-default over LLDB
Applied modernize-use-equals-default clang-tidy check over LLDB.
This check is already present in the lldb/.clang-tidy config.
Dif
[LLDB] Applying clang-tidy modernize-use-equals-default over LLDB
Applied modernize-use-equals-default clang-tidy check over LLDB.
This check is already present in the lldb/.clang-tidy config.
Differential Revision: https://reviews.llvm.org/D121844
show more ...
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1 |
|
| #
c34698a8 |
| 03-Feb-2022 |
Pavel Labath <[email protected]> |
[lldb] Rename Logging.h to LLDBLog.h and clean up includes
Most of our code was including Log.h even though that is not where the "lldb" log channel is defined (Log.h defines the generic logging inf
[lldb] Rename Logging.h to LLDBLog.h and clean up includes
Most of our code was including Log.h even though that is not where the "lldb" log channel is defined (Log.h defines the generic logging infrastructure). This worked because Log.h included Logging.h, even though it should.
After the recent refactor, it became impossible the two files include each other in this direction (the opposite inclusion is needed), so this patch removes the workaround that was put in place and cleans up all files to include the right thing. It also renames the file to LLDBLog to better reflect its purpose.
show more ...
|
|
Revision tags: llvmorg-15-init |
|
| #
a007a6d8 |
| 31-Jan-2022 |
Pavel Labath <[email protected]> |
[lldb] Convert "LLDB" log channel to the new API
|
|
Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2 |
|
| #
2d303e67 |
| 25-Dec-2021 |
Kazu Hirata <[email protected]> |
Remove redundant return and continue statements (NFC)
Identified with readability-redundant-control-flow.
|
| #
76f0f1cc |
| 25-Dec-2021 |
Kazu Hirata <[email protected]> |
Use {DenseSet,SetVector,SmallPtrSet}::contains (NFC)
|
|
Revision tags: llvmorg-13.0.1-rc1 |
|
| #
84c5702b |
| 11-Nov-2021 |
Quinn Pham <[email protected]> |
[lldb][NFC] Inclusive language: rename m_master in ASTImporterDelegate
[NFC] As part of using inclusive language within the llvm project, this patch replaces `m_master` in `ASTImporterDelegate` with
[lldb][NFC] Inclusive language: rename m_master in ASTImporterDelegate
[NFC] As part of using inclusive language within the llvm project, this patch replaces `m_master` in `ASTImporterDelegate` with `m_main`.
Reviewed By: teemperor, clayborg
Differential Revision: https://reviews.llvm.org/D113720
show more ...
|
| #
360d901b |
| 10-Nov-2021 |
Jordan Rupprecht <[email protected]> |
Revert "[lldb] Disable minimal import mode for RecordDecls that back FieldDecls"
This reverts commit 3bf96b0329be554c67282b0d7d8da6a864b9e38f.
It causes crashes as reported in PR52257 and a few oth
Revert "[lldb] Disable minimal import mode for RecordDecls that back FieldDecls"
This reverts commit 3bf96b0329be554c67282b0d7d8da6a864b9e38f.
It causes crashes as reported in PR52257 and a few other places. A reproducer is bundled with this commit to verify any fix forward. The original test is left in place, but marked XFAIL as it now produces the wrong result.
Reviewed By: teemperor
Differential Revision: https://reviews.llvm.org/D113449
show more ...
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init |
|
| #
fd2433e1 |
| 02-Jul-2021 |
Jonas Devlieghere <[email protected]> |
[lldb] Replace default bodies of special member functions with = default;
Replace default bodies of special member functions with = default;
$ run-clang-tidy.py -header-filter='lldb' -checks='-*,mo
[lldb] Replace default bodies of special member functions with = default;
Replace default bodies of special member functions with = default;
$ run-clang-tidy.py -header-filter='lldb' -checks='-*,modernize-use-equals-default' -fix ,
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-default.html
Differential revision: https://reviews.llvm.org/D104041
show more ...
|
|
Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2 |
|
| #
3bf96b03 |
| 25-May-2021 |
Raphael Isemann <[email protected]> |
[lldb] Disable minimal import mode for RecordDecls that back FieldDecls
Clang adds a Decl in two phases to a DeclContext. First it adds it invisible and then it makes it visible (which will add it t
[lldb] Disable minimal import mode for RecordDecls that back FieldDecls
Clang adds a Decl in two phases to a DeclContext. First it adds it invisible and then it makes it visible (which will add it to the lookup data structures). It's important that we can't do lookups into the DeclContext we are currently adding the Decl to during this process as once the Decl has been added, any lookup will automatically build a new lookup map and add the added Decl to it. The second step would then add the Decl a second time to the lookup which will lead to weird errors later one. I made adding a Decl twice to a lookup an assertion error in D84827.
In the first step Clang also does some computations on the added Decl if it's for example a FieldDecl that is added to a RecordDecl.
One of these computations is checking if the FieldDecl is of a record type and the record type has a deleted constexpr destructor which will delete the constexpr destructor of the record that got the FieldDecl.
This can lead to a bug with the way we implement MinimalImport in LLDB and the following code:
``` struct Outer { typedef int HookToOuter; struct NestedClass { HookToOuter RefToOuter; } NestedClassMember; // We are adding this. }; ```
1. We just imported `Outer` minimally so far. 2. We are now asked to add `NestedClassMember` as a FieldDecl. 3. We import `NestedClass` minimally. 4. We add `NestedClassMember` and clang does a lookup for a constexpr dtor in `NestedClass`. `NestedClassMember` hasn't been added to the lookup. 5. The lookup into `NestedClass` will now load the members of `NestedClass`. 6. We try to import the type of `RefToOuter` which will try to import the `HookToOuter` typedef. 7. We import the typedef and while importing we check for conflicts in `Outer` via a lookup. 8. The lookup into `Outer` will cause the invisible `NestedClassMember` to be added to the lookup. 9. We continue normally until we get back to the `addDecl` call in step 2. 10. We now add `NestedClassMember` to the lookup even though we already did that in step 8.
The fix here is disabling the minimal import for RecordTypes from FieldDecls. We actually already did this, but so far we only force the definition of the type to be imported *after* we imported the FieldDecl. This just moves that code *before* we import the FieldDecl so prevent the issue above.
Reviewed By: shafik, aprantl
Differential Revision: https://reviews.llvm.org/D102993
show more ...
|
|
Revision tags: llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3 |
|
| #
2d6b767c |
| 25-Feb-2021 |
Raphael Isemann <[email protected]> |
[lldb][NFC] Remove some obsolete comments in ClangASTImporter.cpp
The first two comments are incomplete and reference obsolete code. The last one is just commented out code (that also doesn't look c
[lldb][NFC] Remove some obsolete comments in ClangASTImporter.cpp
The first two comments are incomplete and reference obsolete code. The last one is just commented out code (that also doesn't look correct).
show more ...
|
| #
2105912e |
| 24-Feb-2021 |
Raphael Isemann <[email protected]> |
[lldb] Add asserts that prevent construction of cycles in the decl origin tracking
LLDB tracks where any imported `clang::Decl` originally came from via a simple map from 'imported decl' to 'origina
[lldb] Add asserts that prevent construction of cycles in the decl origin tracking
LLDB tracks where any imported `clang::Decl` originally came from via a simple map from 'imported decl' to 'original decl'. That information is used to later complete parts of the Decl when more information is requested about a certain Decl (e.g., via the ExternalASTSource interface from Clang).
When finding the 'original decl' for a given decl, the ASTImporterDelegate essentially just recursively follows the previously mentioned map from 'imported' to 'original decl' until it can find any further 'original decl'. The final found decl is then the one that will be imported. The recursion is necessary as in LLDB we don't just import decls from one ASTContext to another, but also from one ASTContext to another via a (potentially temporary) ASTContext. For example, the expression parser creates a temporary ASTContext for parsing the current expression.
The problem with the recursion is however that if we somehow get a cycle into our mapping, then the ASTImporterDelegate will just infinite recurse. As the infinite recursion usually happens after the cycle was already created in a code path such as completing a type, the crash backtraces we get for these bugs are not very useful. However having the backtrace where the faulty map entry is created usually makes the code trivial to fix (as there should be some rogue CopyType call or something similar nearby. See for example D96366).
This patch tries to make these issues easier to track down by putting a bunch of sanity asserts in the code that fills out the map. All the asserts are just checking that there is no direct cycle (ASTContext maps to itself) when updating the origin tracking map.
The assert in the ASTImportDelegate constructor is an `lldbassert` (which also is getting checked in release builds with disabled asserts) as the code path there is pretty cold and we can reliably detect a rogue CopyType call from there.
I also had to update some code in `ClangASTImporter::ASTImporterDelegate::Imported`. This code already had a safety check for creating a cycle in the origin tracking map, but it still constructed an ASTImporter while checking for the cycle (by requesting a delegate via `GetDelegate` and passing two identical ASTContexts which looks like a rogue CopyType call to the checks).
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D97300
show more ...
|
|
Revision tags: llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3 |
|
| #
7866b914 |
| 09-Sep-2020 |
Raphael Isemann <[email protected]> |
[lldb] Fix a crash when the ASTImporter is giving us two Imported callbacks for the same target decl
The ASTImporter has an `Imported(From, To)` callback that notifies subclasses that a declaration
[lldb] Fix a crash when the ASTImporter is giving us two Imported callbacks for the same target decl
The ASTImporter has an `Imported(From, To)` callback that notifies subclasses that a declaration has been imported in some way. LLDB uses this in the `CompleteTagDeclsScope` to see which records have been imported into the scratch context. If the record was declared inside the expression, then the `CompleteTagDeclsScope` will forcibly import the full definition of that record to the scratch context so that the expression AST can safely be disposed later (otherwise we might end up going back to the deleted AST to complete the minimally imported record). The way this is implemented is that there is a list of decls that need to be imported (`m_decls_to_complete`) and we keep completing the declarations inside that list until the list is empty. Every `To` Decl we get via the `Imported` callback will be added to the list of Decls to be completed.
There are some situations where the ASTImporter will actually give us two `Imported` calls with the same `To` Decl. One way where this happens is if the ASTImporter decides to merge an imported definition into an already imported one. Another way is that the ASTImporter just happens to get two calls to `ASTImporter::Import` for the same Decl. This for example happens when importing the DeclContext of a Decl requires importing the Decl itself, such as when importing a RecordDecl that was declared inside a function.
The bug addressed in this patch is that when we end up getting two `Imported` calls for the same `To` Decl, then we would crash in the `CompleteTagDeclsScope`. That's because the first time we complete the Decl we remove the Origin tracking information (that maps the Decl back to from where it came from). The next time we try to complete the same `To` Decl the Origin tracking information is gone and we hit the `to_context_md->getOrigin(decl).ctx == m_src_ctx` assert (`getOrigin(decl).ctx` is a nullptr the second time as the Origin was deleted).
This is actually a regression coming from D72495. Before D72495 `m_decls_to_complete` was actually a set so every declaration in there could only be queued once to be completed. The set was changed to a vector to make the iteration over it deterministic, but that also causes that we now potentially end up trying to complete a Decl twice.
This patch essentially just reverts D72495 and makes the `CompleteTagDeclsScope` use a SetVector for the list of declarations to be completed. The SetVector should filter out the duplicates (as the original `set` did) and also ensure that the completion order is deterministic. I actually couldn't find any way to cause LLDB to reproduce this bug by merging declarations (this would require that we for example declare two namespaces in a non-top-level expression which isn't possible). But the bug reproduces very easily by just declaring a class in an expression, so that's what the test is doing.
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D85648
show more ...
|
|
Revision tags: llvmorg-11.0.0-rc2 |
|
| #
fdc6aea3 |
| 13-Aug-2020 |
Pavel Labath <[email protected]> |
[lldb] Check Decl kind when completing -flimit-debug-info types
The search for the complete class definition can also produce entries which are not of the expected type. This can happen for instance
[lldb] Check Decl kind when completing -flimit-debug-info types
The search for the complete class definition can also produce entries which are not of the expected type. This can happen for instance when there is a function with the same name as the class we're looking up (which means that the class needs to be disambiguated with the struct/class tag in most contexts).
Previously we were just picking the first Decl that the lookup returned, which later caused crashes or assertion failures if it was not of the correct type. This patch changes that to search for an entry of the correct type.
Differential Revision: https://reviews.llvm.org/D85904
show more ...
|
| #
f6913e74 |
| 04-Aug-2020 |
Raphael Isemann <[email protected]> |
[lldb][NFC] Document and encapsulate OriginMap in ASTContextMetadata
Just adds the respective accessor functions to ASTContextMetadata instead of directly exposing the OriginMap to the whole world.
|
|
Revision tags: llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2 |
|
| #
a03dc8c9 |
| 23-Jun-2020 |
Pavel Labath <[email protected]> |
[lldb] Add basic -flimit-debug-info support to expression evaluator
Summary: This patch adds support for evaluation of expressions referring to types which were compiled in -flimit-debug-info (a.k.a
[lldb] Add basic -flimit-debug-info support to expression evaluator
Summary: This patch adds support for evaluation of expressions referring to types which were compiled in -flimit-debug-info (a.k.a -fno-standalone-debug) in clang. In this mode it's possible that the debug information needed to fully describe a c++ type is not present in a single shared library -- for example debug info for a base class or a member of a type can only be found in another shared library. This situation is not currently handled well within lldb as we are limited to searching within a single shared library (lldb_private::Module) when searching for the definition of these types.
The way that this patch gets around this limitation is by doing the search at a later stage -- during the construction of the expression ast context. This works by having the parser (currently SymbolFileDWARF, but a similar approach is probably needed for PDBs too) mark a type as "forcefully completed". What this means is that the parser has marked the type as "complete" in the module ast context (as this is necessary to e.g. derive classes from it), but its definition is not really there. This is done via a new field on the ClangASTMetadata struct.
Later, when we are importing such a type into the expression ast, we check this flag. If the flag is set, we try to find a better definition for the type in other shared libraries. We do this by initiating a new lookup for the "forcefully completed" classes, which then imports the type from a module with a full definition.
This patch only implements this handling for base classes, but other cases (members, array element types, etc.). The changes for that should be fairly simple and mostly revolve around marking these types as "forcefully completed" at an approriate time -- the importing logic is generic already.
Another aspect, which is also not handled by this patch is viewing these types via the "frame variable" command. This does not use the AST importer and so it will need to handle these types on its own -- that will be the subject of another patch.
Differential Revision: https://reviews.llvm.org/D81561
show more ...
|
| #
3badd17b |
| 07-Jun-2020 |
Benjamin Kramer <[email protected]> |
SmallPtrSet::find -> SmallPtrSet::count
The latter is more readable and more efficient. While there clean up some double lookups. NFCI.
|
|
Revision tags: llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4 |
|
| #
143d507c |
| 04-Mar-2020 |
Adrian Prantl <[email protected]> |
Preserve the owning module information from DWARF in the synthesized AST
Types that came from a Clang module are nested in DW_TAG_module tags in DWARF. This patch recreates the Clang module hierarch
Preserve the owning module information from DWARF in the synthesized AST
Types that came from a Clang module are nested in DW_TAG_module tags in DWARF. This patch recreates the Clang module hierarchy in LLDB and 1;95;0csets the owning module information accordingly. My primary motivation is to facilitate looking up per-module APINotes for individual declarations, but this likely also has other applications.
This reapplies the previously reverted commit, but without support for ClassTemplateSpecializations, which I'm going to look into separately.
rdar://problem/59634380
Differential Revision: https://reviews.llvm.org/D75488
show more ...
|
| #
32672b87 |
| 02-Apr-2020 |
Adrian Prantl <[email protected]> |
Revert "Preserve the owning module information from DWARF in the synthesized AST"
This reverts commit 4354dfbdf5c8510a7ddff10ae67a28e16cf7cc79 while investigating bot fallout.
|
| #
4354dfbd |
| 04-Mar-2020 |
Adrian Prantl <[email protected]> |
Preserve the owning module information from DWARF in the synthesized AST
Types that came from a Clang module are nested in DW_TAG_module tags in DWARF. This patch recreates the Clang module hierarch
Preserve the owning module information from DWARF in the synthesized AST
Types that came from a Clang module are nested in DW_TAG_module tags in DWARF. This patch recreates the Clang module hierarchy in LLDB and sets the owning module information accordingly. My primary motivation is to facilitate looking up per-module APINotes for individual declarations, but this likely also has other applications.
rdar://problem/59634380
Differential Revision: https://reviews.llvm.org/D75488
show more ...
|
| #
7b00eeb5 |
| 26-Mar-2020 |
Pavel Labath <[email protected]> |
[lldb] Fix another crash in covariant type handling
Summary: D73024 seems to have fixed one set crash, but it introduced another. Namely, if a class contains a covariant method returning itself, the
[lldb] Fix another crash in covariant type handling
Summary: D73024 seems to have fixed one set crash, but it introduced another. Namely, if a class contains a covariant method returning itself, the logic in MaybeCompleteReturnType could cause us to attempt a recursive import, which would result in an assertion failure in clang::DeclContext::removeDecl.
For some reason, this only manifested itself if the class contained at least two member variables, and the class itself was imported as a result of a recursive covariant import.
This patch fixes the crash by not attempting to import classes which are already completed in MaybeCompleteReturnType. However, it's not clear to me if this is the right fix, or if this should be handled automatically by functions lower in the stack.
Reviewers: teemperor, shafik
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D76840
show more ...
|
|
Revision tags: llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1 |
|
| #
8be30215 |
| 29-Jan-2020 |
Alex Langford <[email protected]> |
[lldb] Move clang-based files out of Symbol
Summary: This change represents the move of ClangASTImporter, ClangASTMetadata, ClangExternalASTSourceCallbacks, ClangUtil, CxxModuleHandler, and TypeSyst
[lldb] Move clang-based files out of Symbol
Summary: This change represents the move of ClangASTImporter, ClangASTMetadata, ClangExternalASTSourceCallbacks, ClangUtil, CxxModuleHandler, and TypeSystemClang from lldbSource to lldbPluginExpressionParserClang.h
This explicitly removes knowledge of clang internals from lldbSymbol, moving towards a more generic core implementation of lldb.
Reviewers: JDevlieghere, davide, aprantl, teemperor, clayborg, labath, jingham, shafik
Subscribers: emaste, mgorny, arphaman, jfb, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73661
show more ...
|