|
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 |
|
| #
1b4b12a3 |
| 23-Jul-2022 |
Nico Weber <[email protected]> |
Revert "[NFC] Improve FileSpec internal APIs and usage in preparation for adding caching of resolved/absolute." and follow-ups
This reverts commit 9429b67b8e300e638d7828bbcb95585f85c4df4d.
It broke
Revert "[NFC] Improve FileSpec internal APIs and usage in preparation for adding caching of resolved/absolute." and follow-ups
This reverts commit 9429b67b8e300e638d7828bbcb95585f85c4df4d.
It broke the build on Windows, see comments on https://reviews.llvm.org/D130309
It also reverts these follow-ups:
Revert "Fix buildbot breakage after https://reviews.llvm.org/D130309." This reverts commit f959d815f4637890ebbacca379f1c38ab47e4e14.
Revert "Fix buildbot breakage after https://reviews.llvm.org/D130309." This reverts commit 0bbce7a4c2d2bff622bdadd4323f93f5d90e6d24.
Revert "Cache the value for absolute path in FileSpec." This reverts commit dabe877248b85b34878e75d5510339325ee087d0.
show more ...
|
| #
9429b67b |
| 21-Jul-2022 |
Greg Clayton <[email protected]> |
[NFC] Improve FileSpec internal APIs and usage in preparation for adding caching of resolved/absolute.
The FileSpect APIs allow users to modify instance variables directly by getting a non const ref
[NFC] Improve FileSpec internal APIs and usage in preparation for adding caching of resolved/absolute.
The FileSpect APIs allow users to modify instance variables directly by getting a non const reference to the directory and filename instance variables. This makes it impossibly to control all of the times the FileSpec object is modified so we can clear the cache. This patch modifies the APIs of FileSpec so no one can modify the directory or filename directly by adding set accessors and by removing the get accessors that are non const.
Many clients were using FileSpec::GetCString(...) which returned a unique C string from a ConstString'ified version of the result of GetPath() which returned a std::string. This caused many locations to use this convenient function incorrectly and could cause many strings to be added to the constant string pool that didn't need to. Most clients were converted to using FileSpec::GetPath().c_str() when possible. Other clients were modified to use the newly renamed version of this function which returns an actualy ConstString: ConstString FileSpec::GetPathAsConstString(bool denormalize = true) const;
This avoids the issue where people were getting an already uniqued "const char *" that came from a ConstString only to put the "const char *" back into a "ConstString" object. By returning the ConstString instead of a "const char *" clients can be more efficient with the result.
The patch: - Removes the non const GetDirectory() and GetFilename() get accessors - Adds set accessors to replace the above functions: SetDirectory() and SetFilename(). - Adds ClearDirectory() and ClearFilename() to replace usage of the FileSpec::GetDirectory().Clear()/FileSpec::GetFilename().Clear() call sites - Fixed all incorrect usage of FileSpec::GetCString() to use FileSpec::GetPath().c_str() where appropriate, and updated other call sites that wanted a ConstString to use the newly returned ConstString appropriately and efficiently.
Differential Revision: https://reviews.llvm.org/D130309
show more ...
|
| #
8184b252 |
| 12-Jul-2022 |
Michael Buch <[email protected]> |
[LLDB][ClangExpression] Allow expression evaluation from within C++ Lambdas
This patch adds support for evaluating expressions which reference a captured `this` from within the context of a C++ lamb
[LLDB][ClangExpression] Allow expression evaluation from within C++ Lambdas
This patch adds support for evaluating expressions which reference a captured `this` from within the context of a C++ lambda expression. Currently LLDB doesn't provide Clang with enough information to determine that we're inside a lambda expression and are allowed to access variables on a captured `this`; instead Clang simply fails to parse the expression.
There are two problems to solve here: 1. Make sure `clang::Sema` doesn't reject the expression due to an illegal member access. 2. Materialize all the captured variables/member variables required to evaluate the expression.
To address (1), we currently import the outer structure's AST context onto `$__lldb_class`, making the `contextClass` and the `NamingClass` match, a requirement by `clang::Sema::BuildPossibleImplicitMemberExpr`.
To address (2), we inject all captured variables as locals into the expression source code.
**Testing**
* Added API test
show more ...
|
| #
b74a01a8 |
| 12-Jul-2022 |
Zequan Wu <[email protected]> |
Reland "[LLDB][NFC] Decouple dwarf location table from DWARFExpression."
This reland 227dffd0b6d78154516ace45f6ed28259c7baa48 and 562c3467a6738aa89203f72fc1d1343e5baadf3c with failed api tests fixed
Reland "[LLDB][NFC] Decouple dwarf location table from DWARFExpression."
This reland 227dffd0b6d78154516ace45f6ed28259c7baa48 and 562c3467a6738aa89203f72fc1d1343e5baadf3c with failed api tests fixed by keeping function base file addres in DWARFExpressionList.
show more ...
|
| #
4d26faa5 |
| 08-Jul-2022 |
Michael Buch <[email protected]> |
[LLDB][ClangExpression] Remove unused StructVars::m_object_pointer_type
This member variable was removed a while ago in 443427357f539f5ac97e664a53aa9e50788abce9. It was previously used in materializ
[LLDB][ClangExpression] Remove unused StructVars::m_object_pointer_type
This member variable was removed a while ago in 443427357f539f5ac97e664a53aa9e50788abce9. It was previously used in materialization code paths that have since been removed. Nowadays, `m_object_pointer_type` gets set but not used anywhere.
This patch simply removes all remaining instances of it and any supporting code.
**Testing**
* API tests pass
Differential Revision: https://reviews.llvm.org/D129367
show more ...
|
| #
e4c5bca5 |
| 07-Jul-2022 |
Jonas Devlieghere <[email protected]> |
Revert "[LLDB][NFC] Decouple dwarf location table from DWARFExpression."
This reverts commit 227dffd0b6d78154516ace45f6ed28259c7baa48 and its follow up 562c3467a6738aa89203f72fc1d1343e5baadf3c becau
Revert "[LLDB][NFC] Decouple dwarf location table from DWARFExpression."
This reverts commit 227dffd0b6d78154516ace45f6ed28259c7baa48 and its follow up 562c3467a6738aa89203f72fc1d1343e5baadf3c because it breaks a bunch of tests on GreenDragon:
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/45155/
show more ...
|
|
Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4 |
|
| #
227dffd0 |
| 13-May-2022 |
Zequan Wu <[email protected]> |
[LLDB][NFC] Decouple dwarf location table from DWARFExpression.
Differential Revision: https://reviews.llvm.org/D125509
|
| #
f000de87 |
| 17-Jun-2022 |
Adrian Prantl <[email protected]> |
[LLDB][ExpressionParser] Fix indices inside format-strings passed to LLDB_LOG
llvm::formatv expects the parameter indexes to start with 0. Unfortunately it doesn't detect out-of-bounds accesses in t
[LLDB][ExpressionParser] Fix indices inside format-strings passed to LLDB_LOG
llvm::formatv expects the parameter indexes to start with 0. Unfortunately it doesn't detect out-of-bounds accesses in the format string at compile-time, of which we had several inside ClangExpressionDeclMap.
This patch fixes these out-of-bounds format accesses.
Example output
Before
ClangExpressionDeclMap::FindExternalVisibleDecls for '$__lldb_class' in a 'TranslationUnit' CEDM::FEVD Searching the root namespace CEDM::FEVD Adding type for $__lldb_class: 1
After
ClangExpressionDeclMap::FindExternalVisibleDecls for '$__lldb_class' in a 'TranslationUnit' CEDM::FEVD Searching the root namespace CEDM::FEVD Adding type for $__lldb_class: class (lambda)
Patch by Michael Buch!
Differential Revision: https://reviews.llvm.org/D128063
show more ...
|
|
Revision tags: llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, 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.
|
|
Revision tags: llvmorg-13.0.1-rc1 |
|
| #
93c1b3ca |
| 05-Oct-2021 |
Pavel Labath <[email protected]> |
[lldb] Remove some anonymous namespaces
.. and reduce the scope of others. They don't follow llvm coding standards (which say they should be used only when the same effect cannot be achieved with th
[lldb] Remove some anonymous namespaces
.. and reduce the scope of others. They don't follow llvm coding standards (which say they should be used only when the same effect cannot be achieved with the static keyword), and they set a bad example.
show more ...
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2 |
|
| #
c020be17 |
| 05-Aug-2021 |
Jonas Devlieghere <[email protected]> |
[lldb] Use a struct to pass function search options to Module::FindFunction
Rather than passing two booleans around, which is especially error prone with them being next to each other, use a struct
[lldb] Use a struct to pass function search options to Module::FindFunction
Rather than passing two booleans around, which is especially error prone with them being next to each other, use a struct with named fields instead.
Differential revision: https://reviews.llvm.org/D107295
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2 |
|
| #
4125b462 |
| 11-Jun-2021 |
Raphael Isemann <[email protected]> |
Revert "[lldb] Add support for evaluating expressions in static member functions"
This reverts commit 00764c36edf88ae9806e8d57a6addb782e6ceae8 and the follow up d2223c7a49973a61cc2de62992662afa8d190
Revert "[lldb] Add support for evaluating expressions in static member functions"
This reverts commit 00764c36edf88ae9806e8d57a6addb782e6ceae8 and the follow up d2223c7a49973a61cc2de62992662afa8d19065a.
The original patch broke that one could use static member variables while inside a static member functions without having a running target. It seems that LLDB currently requires that static variables are only found via the global variable lookup so that they can get materialized and mapped to the argument struct of the expression.
After 00764c36edf88ae9806e8d57a6addb782e6ceae8 static variables of the current class could be found via Clang's lookup which LLDB isn't observing. This resulting in expressions actually containing these variables as normal globals that can't be rewritten to a member of the argument struct.
More specifically, in the test TestCPPThis, the expression `expr --j false -- s_a` is now only passing if we have a runnable target.
I'll revert the patch as the possible fixes aren't trivial and it degrades the debugging experience more than the issue that the revert patch addressed.
The underlying bug can be reproduced before/after this patch by stopping in `TestCPPThis` main function and running: `e -j false -- my_a; A<int>::s_a`. The `my_a` will pull in the `A<int>` class and the second expression will be resolved by Clang on its own (which causes LLDB to not materialize the static variable).
Note: A workaround is to just do `::s_a` which will force LLDB to take the global variable lookup.
show more ...
|
|
Revision tags: llvmorg-12.0.1-rc1 |
|
| #
4c0b0de9 |
| 19-May-2021 |
Alex Langford <[email protected]> |
[lldb] Move ClangModulesDeclVendor ownership to ClangPersistentVariables from Target
More decoupling of plugins and non-plugins. Target doesn't need to manage ClangModulesDeclVendor and ClangPersist
[lldb] Move ClangModulesDeclVendor ownership to ClangPersistentVariables from Target
More decoupling of plugins and non-plugins. Target doesn't need to manage ClangModulesDeclVendor and ClangPersistentVariables is always available in situations where you need ClangModulesDeclVendor.
Differential Revision: https://reviews.llvm.org/D102811
show more ...
|
| #
00764c36 |
| 19-Apr-2021 |
Raphael Isemann <[email protected]> |
[lldb] Add support for evaluating expressions in static member functions
At the moment the expression parser doesn't support evaluating expressions in static member functions and just pretends the e
[lldb] Add support for evaluating expressions in static member functions
At the moment the expression parser doesn't support evaluating expressions in static member functions and just pretends the expression is evaluated within a non-member function. This causes that all static members are inaccessible when doing unqualified name lookup.
This patch adds support for evaluating in static member functions. It essentially just does the same setup as what LLDB is already doing for non-static member functions (i.e., wrapping the expression in a fake member function) with the difference that we now mark the wrapping function as static (to prevent access to non-static members).
Reviewed By: shafik, jarin
Differential Revision: https://reviews.llvm.org/D81550
show more ...
|
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2 |
|
| #
057efa99 |
| 11-Feb-2021 |
Adrian Prantl <[email protected]> |
Make the error condition in Value::ValueType explicit (NFC)
The comment for ValueType claims that all values <1 are errors, but not all switch statements take this into account. This patch introduce
Make the error condition in Value::ValueType explicit (NFC)
The comment for ValueType claims that all values <1 are errors, but not all switch statements take this into account. This patch introduces an explicit Error case and deletes all default: cases, so we get warned about incomplete switch coverage.
https://reviews.llvm.org/D96537
show more ...
|
| #
9f175998 |
| 12-Feb-2021 |
Shafik Yaghmour <[email protected]> |
[LLDB] Fix LLDB_LOG calls to use correct formatting
It looks like a previous change switched these from LLDB_LOGF but did not update the format strings.
Differential Revision: https://reviews.llvm.
[LLDB] Fix LLDB_LOG calls to use correct formatting
It looks like a previous change switched these from LLDB_LOGF but did not update the format strings.
Differential Revision: https://reviews.llvm.org/D96550
show more ...
|
|
Revision tags: 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 |
|
| #
47e7ecdd |
| 10-Dec-2020 |
Raphael Isemann <[email protected]> |
[lldb] Introduce separate scratch ASTs for debug info types and types imported from C++ modules.
Right now we have one large AST for all types in LLDB. All ODR violations in types we reconstruct are
[lldb] Introduce separate scratch ASTs for debug info types and types imported from C++ modules.
Right now we have one large AST for all types in LLDB. All ODR violations in types we reconstruct are resolved by just letting the ASTImporter handle the conflicts (either by merging types or somehow trying to introduce a duplicated declaration in the AST). This works ok for the normal types we build from debug information as most of them are just simple CXXRecordDecls or empty template declarations.
However, with a loaded `std` C++ module we have alternative versions of pretty much all declarations in the `std` namespace that are much more fleshed out than the debug information declarations. They have all the information that is lost when converting to DWARF, such as default arguments, template default arguments, the actual uninstantiated template declarations and so on.
When we merge these C++ module types into the big scratch AST (that might already contain debug information types) we give the ASTImporter the tricky task of somehow creating a consistent AST out of all these declarations. Usually this ends in a messy AST that contains a mostly broken mix of both module and debug info declarations. The ASTImporter in LLDB is also importing types with the MinimalImport setting, which usually means the only information we have when merging two types is often just the name of the declaration and the information that it contains some child declarations. This makes it pretty much impossible to even implement a better merging logic (as the names of C++ module declarations and debug info declarations are identical).
This patch works around this whole merging problem by separating C++ module types from debug information types. This is done by splitting up the single scratch AST into two: One default AST for debug information and a dedicated AST for C++ module types.
The C++ module AST is implemented as a 'specialised AST' that lives within the default ScratchTypeSystemClang. When we select the scratch AST we can explicitly request that we want such a isolated sub-AST of the scratch AST. I kept the infrastructure more general as we probably can use the same mechanism for other features that introduce conflicting types (such as programs that are compiled with a custom -wchar-size= option).
There are just two places where we explicitly have request the C++ module AST: When we export persistent declarations (`$mytype`) and when we create our persistent result variable (`$0`, `$1`, ...). There are a few formatters that were previously assuming that there is only one scratch AST which I cleaned up in a preparation revision here (D92757).
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D92759
show more ...
|
| #
594308c7 |
| 04-Dec-2020 |
Raphael Isemann <[email protected]> |
[lldb][NFC] Rename TypeSystemClang::GetScratch to ScratchTypeSystemClang::GetForTarget
Also add some documentation while I'm at it.
|
|
Revision tags: llvmorg-11.0.1-rc1 |
|
| #
cb81e662 |
| 14-Oct-2020 |
Raphael Isemann <[email protected]> |
[lldb] Reject redefinitions of persistent variables
Currently one can redefine a persistent variable and LLDB will just silently ignore the second definition:
``` (lldb) expr int $i = 1 (lldb) expr
[lldb] Reject redefinitions of persistent variables
Currently one can redefine a persistent variable and LLDB will just silently ignore the second definition:
``` (lldb) expr int $i = 1 (lldb) expr int $i = 2 (lldb) expr $i (int) $i = 1 ```
This patch makes this an error and rejects the expression with the second definition.
A nice follow up would be to refactor LLDB's persistent variables to not just be a pair of type and name, but also contain some way to obtain the original declaration and source code that declared the variable. That way we could actually make a full diagnostic as we would get from redefining a variable twice in the same expression.
Reviewed By: labath, shafik, JDevlieghere
Differential Revision: https://reviews.llvm.org/D89310
show more ...
|
|
Revision tags: llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3 |
|
| #
502773d7 |
| 30-Jun-2020 |
Raphael Isemann <[email protected]> |
[lldb][NFC] Remove ImportInProgress lock in ClangASTSource
Summary:
The ClangASTSource has a lock that globally disables all lookups into the external AST source when we explicitly "guarded" copy a
[lldb][NFC] Remove ImportInProgress lock in ClangASTSource
Summary:
The ClangASTSource has a lock that globally disables all lookups into the external AST source when we explicitly "guarded" copy a type. It's not used for anything else, so importing declarations or importing types that are dependencies of a declaration actually won't activate that lock. The lookups it is supposed to prevent also don't actually happen in our test suite. The check in `ClangExpressionDeclMap::FindExternalVisibleDecls` is never executed and the check in the `ClangASTSource::FindExternalVisibleDeclsByName` is only ever reached by the `Import-std-module` tests (which explicitly do a lookup into the expression context on purpose).
This lock was added in 6abfabff6158076eccdf6fcac5a12894039de2c9 as a replacement for a list of types we already looked up which appeared to be an optimisation strategy. I assume back then this lock had a purpose but these days the ASTImporter and LLDB seem to be smart enough to avoid whatever lookups this tried to prevent.
I would say we remove it from LLDB. The main reason is that it blocks D81561 (which explicitly does a specific lookup to resolve placeholder types produced by `-flimit-debug-info`) but it's semantics are also very confusing. The naming implies it's a flag to indicate when we import something at the moment which is practically never true as described above. Also the fact that it makes our ExternalASTSource alternate between doing lookups into the debug info and pretending it doesn't know any external decls could really break our lookup in some weird way if Clang decides to cache a fake empty lookup result that was generated while the lock was active.
Reviewers: labath, shafik, JDevlieghere, aprantl
Reviewed By: labath, JDevlieghere, aprantl
Subscribers: aprantl, abidh
Differential Revision: https://reviews.llvm.org/D81749
show more ...
|
|
Revision tags: llvmorg-10.0.1-rc2 |
|
| #
834708a6 |
| 10-Jun-2020 |
Raphael Isemann <[email protected]> |
[lldb][NFC] Rename ClangExpressionDeclMap::AddThisType and clarify documentation
|
| #
aa04ce76 |
| 20-May-2020 |
Raphael Isemann <[email protected]> |
[lldb][NFC] Minor NamespaceMap refactor
|
|
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 ...
|