|
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 |
|
| #
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 ...
|
|
Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1 |
|
| #
28c878ae |
| 14-Mar-2022 |
Shafik Yaghmour <[email protected]> |
[LLDB] Applying clang-tidy modernize-use-default-member-init over LLDB
Applied modernize-use-default-member-init clang-tidy check over LLDB. It appears in many files we had already switched to in cl
[LLDB] Applying clang-tidy modernize-use-default-member-init over LLDB
Applied modernize-use-default-member-init clang-tidy check over LLDB. It appears in many files we had already switched to in class member init but never updated the constructors to reflect that. This check is already present in the lldb/.clang-tidy config.
Differential Revision: https://reviews.llvm.org/D121481
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, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
| #
a3939e15 |
| 15-Oct-2021 |
Pavel Labath <[email protected]> |
[lldb] Return StringRef from PluginInterface::GetPluginName
There is no reason why this function should be returning a ConstString.
While modifying these files, I also fixed several instances where
[lldb] Return StringRef from PluginInterface::GetPluginName
There is no reason why this function should be returning a ConstString.
While modifying these files, I also fixed several instances where GetPluginName and GetPluginNameStatic were returning different strings.
I am not changing the return type of GetPluginNameStatic in this patch, as that would necessitate additional changes, and this patch is big enough as it is.
Differential Revision: https://reviews.llvm.org/D111877
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, 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 |
|
| #
38dfb235 |
| 24-Feb-2021 |
Jonas Devlieghere <[email protected]> |
[lldb] Support debugging utility functions
LLDB uses utility functions to run code in the inferior for its own internal purposes, such as reading classes from the Objective-C runtime for example. Be
[lldb] Support debugging utility functions
LLDB uses utility functions to run code in the inferior for its own internal purposes, such as reading classes from the Objective-C runtime for example. Because these expressions should be transparent to the user, we ignore breakpoints and unwind the stack on errors, which makes them hard to debug.
This patch adds a new setting target.debug-utility-expression that, when enabled, changes these options to facilitate debugging. It enables breakpoints, disables unwinding and writes out the utility function source code to disk so it shows up in the source view.
Differential revision: https://reviews.llvm.org/D97249
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 |
|
| #
a8350ce7 |
| 16-Nov-2020 |
Raphael Isemann <[email protected]> |
[lldb] Add support for using variables with C++ keywords names in non-C++ expressions
LLDB is currently always activating C++ when parsing expressions as LLDB itself is using C++ features when creat
[lldb] Add support for using variables with C++ keywords names in non-C++ expressions
LLDB is currently always activating C++ when parsing expressions as LLDB itself is using C++ features when creating the final AST that will be codegen'd (specifically, references to variables, namespaces and using declarations are used).
This is causing problems for users that have variables in non-C++ programs (e.g. plain C or Objective-C) that have names which are keywords in C++. Expressions referencing those variables fail to parse as LLDB's Clang parser thinks those identifiers are C++ keywords and not identifiers that may belong to a declaration.
We can't just disable C++ in the expression parser for those situations as replacing the functionality of the injected C++ code isn't trivial. So this patch is just disabling most keywords that are exclusive to C++ in LLDB's Clang parser when we are in a non-C++ expression. There are a few keywords we can't disable for now:
* `using` as that's currently used in some situations to inject variables into the expression function. * `__null` as that's used by LLDB to define `NULL`/`Nil`/`nil`.
Getting rid of these last two keywords is possible but is a large enough change that this will be handled in follow up patches.
Note that this only changes the keyword status of those tokens but this patch does not remove any C++ functionality from the expression parser. The type system still follows C++ rules and so does the rest of the expression parser.
There is another small change that gives the hardcoded macro definitions in LLDB a higher precedence than the macros imported from the Objective-C modules. The reason for this is that the Objective-C modules in LLDB are actually parsed in Objective-C++ mode and they end up providing the C++ definitions of certain system macros (like `NULL` being defined as `nullptr`). So we have to move the LLDB definition forward and surround the definition from the module with an `#ifdef` to make sure that we use the correct LLDB definition that doesn't reference C++ keywords. Or to give an example, this is how the expression source code changes:
Before: ``` #define NULL (nullptr) // injected module definition #ifndef NULL #define NULL (__null) // hardcoded LLDB definition #endif ```
After: ``` #ifndef NULL #define NULL (__null) // hardcoded LLDB definition #endif #ifndef NULL #define NULL (nullptr) // injected module definition #endif ```
Fixes rdar://10356912
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D82770
show more ...
|
| #
b333d6e1 |
| 20-Oct-2020 |
Duncan P. N. Exon Smith <[email protected]> |
lldb: Migrate to MemoryBufferRef for createFileID (after 51d1d585e5838ea0f02f1271f7543c4e43639969)
I missed these two lldb users before deleting the `UnownedTag` API for `createFileID` in 51d1d585e5
lldb: Migrate to MemoryBufferRef for createFileID (after 51d1d585e5838ea0f02f1271f7543c4e43639969)
I missed these two lldb users before deleting the `UnownedTag` API for `createFileID` in 51d1d585e5838ea0f02f1271f7543c4e43639969. This should fix the build.
show more ...
|
| #
f96e16bc |
| 20-Oct-2020 |
Duncan P. N. Exon Smith <[email protected]> |
lldb: Update for change in `clang::Lexer`'s constructor
b3eff6b7bb31e7ef059a3d238de138849839fbbd updated `Lexer::Lexer` to take `clang::MemoryBufferRef` instead of `clang::MemoryBuffer*`. Update LLD
lldb: Update for change in `clang::Lexer`'s constructor
b3eff6b7bb31e7ef059a3d238de138849839fbbd updated `Lexer::Lexer` to take `clang::MemoryBufferRef` instead of `clang::MemoryBuffer*`. Update LLDB to fix the bots.
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, llvmorg-10.0.1-rc2 |
|
| #
2b37c5b5 |
| 01-Jun-2020 |
Raphael Isemann <[email protected]> |
[lldb][NFC] Make ClangExpressionSourceCode's wrapping logic more consistent
Summary: ClangExpressionSourceCode has different ways to wrap the user expression based on which context the expression is
[lldb][NFC] Make ClangExpressionSourceCode's wrapping logic more consistent
Summary: ClangExpressionSourceCode has different ways to wrap the user expression based on which context the expression is executed in. For example, if we're in a C++ member function we put the expression inside a fake member function of a fake class to make the evaluation possible. Similar things are done for Objective-C instance/static methods. There is also a default wrapping where we put the expression in a normal function just to make it possible to execute it.
The way we currently define which kind of wrapping the expression needs is based on the `wrapping_language` we keep passing to the ClangExpressionSourceCode instance. We repurposed the language type enum for that variable to distinguish the cases above with the following mapping: * language = C_plus_plus -> member function wrapping * language = ObjC -> instance/static method wrapping (`is_static` distinguished between those two). * language = C -> normal function wrapping * all other cases like C_plus_plus11, Haskell etc. make our class a no-op that does mostly nothing.
That mapping is currently not documented and just confusing as the `language` is unrelated to the expression language (and in the ClangUserExpression we even pretend that it *is* the actual language, but luckily never used it for anything). Some of the code in ClangExpressionSourceCode is also obviously thinking that this is the actual language of the expression as it checks for non-existent cases such as `ObjC_plus_plus` which is not part of the mapping.
This patch makes a new enum to describe the four cases above (with instance/static Objective-C methods now being their own case). It also make that enum just a member of ClangExpressionSourceCode instead of having to pass the same value to the class repeatedly. This gets also rid of all the switch-case-checks for 'unknown' language such as C_plus_plus11 as this is no longer necessary.
Reviewers: labath, JDevlieghere
Reviewed By: labath
Subscribers: abidh
Differential Revision: https://reviews.llvm.org/D80793
show more ...
|
|
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, llvmorg-10.0.0-rc3 |
|
| #
e08464fb |
| 29-Feb-2020 |
Reid Kleckner <[email protected]> |
Avoid including FileManager.h from SourceManager.h
Most clients of SourceManager.h need to do things like turning source locations into file & line number pairs, but this doesn't require bringing in
Avoid including FileManager.h from SourceManager.h
Most clients of SourceManager.h need to do things like turning source locations into file & line number pairs, but this doesn't require bringing in FileManager.h and LLVM's FS headers.
The main code change here is to sink SM::createFileID into the cpp file. I reason that this is not performance critical because it doesn't happen on the diagnostic path, it happens along the paths of macro expansion (could be hot) and new includes (less hot).
Saves some includes: 309 - /usr/local/google/home/rnk/llvm-project/clang/include/clang/Basic/FileManager.h 272 - /usr/local/google/home/rnk/llvm-project/clang/include/clang/Basic/FileSystemOptions.h 271 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/VirtualFileSystem.h 267 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/FileSystem.h 266 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Chrono.h
Differential Revision: https://reviews.llvm.org/D75406
show more ...
|
|
Revision tags: llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1 |
|
| #
adcd0268 |
| 28-Jan-2020 |
Benjamin Kramer <[email protected]> |
Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here.
This is mostly m
Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here.
This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies.
This doesn't actually modify StringRef yet, I'll do that in a follow-up.
show more ...
|
| #
80814287 |
| 24-Jan-2020 |
Raphael Isemann <[email protected]> |
[lldb][NFC] Fix all formatting errors in .cpp file headers
Summary: A *.cpp file header in LLDB (and in LLDB) should like this: ``` //===-- TestUtilities.cpp ----------------------------------------
[lldb][NFC] Fix all formatting errors in .cpp file headers
Summary: A *.cpp file header in LLDB (and in LLDB) should like this: ``` //===-- TestUtilities.cpp -------------------------------------------------===// ``` However in LLDB most of our source files have arbitrary changes to this format and these changes are spreading through LLDB as folks usually just use the existing source files as templates for their new files (most notably the unnecessary editor language indicator `-*- C++ -*-` is spreading and in every review someone is pointing out that this is wrong, resulting in people pointing out that this is done in the same way in other files).
This patch removes most of these inconsistencies including the editor language indicators, all the different missing/additional '-' characters, files that center the file name, missing trailing `===//` (mostly caused by clang-format breaking the line).
Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73258
show more ...
|
|
Revision tags: llvmorg-11-init |
|
| #
e9331a56 |
| 08-Jan-2020 |
Adrian Prantl <[email protected]> |
Add missing nullptr checks.
GetPersistentExpressionStateForLanguage() can return a nullptr if it cannot construct a typesystem. This patch adds missing nullptr checks at all uses.
Inspired by rdar:
Add missing nullptr checks.
GetPersistentExpressionStateForLanguage() can return a nullptr if it cannot construct a typesystem. This patch adds missing nullptr checks at all uses.
Inspired by rdar://problem/58317195
Differential Revision: https://reviews.llvm.org/D72413
show more ...
|
|
Revision tags: llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1 |
|
| #
7dd7a360 |
| 16-Oct-2019 |
Jason Molenda <[email protected]> |
Add arm64_32 support to lldb, an ILP32 codegen that runs on arm64 ISA targets, specifically Apple watches.
Differential Revision: https://reviews.llvm.org/D68858
llvm-svn: 375032
|
| #
bd2a910a |
| 24-Sep-2019 |
Raphael Isemann <[email protected]> |
Ignore generated @import statements in the expression evaluator
Summary: The ClangModulesDeclVendor is currently interpreting all injected `@import` statements in our expression wrapper as modules t
Ignore generated @import statements in the expression evaluator
Summary: The ClangModulesDeclVendor is currently interpreting all injected `@import` statements in our expression wrapper as modules that the user has explicitly requested to be persistently loaded. As we inject `@import` statements with our std module prototype, the ClangModulesDeclVendor will start compiling and loading unrelated C++ modules because it thinks the user has requested that it should load them. As the ClangModulesDeclVendor is lacking the setup to compile these modules (e.g. it lacks the include paths), it will then actually just fail to compile them and cause the whole expression evaluation to fail. This causes these tests to fail on systems that enable the ClangModulesDeclVendor (such as macOS).
This patch fixes this by preventing the ClangModulesDeclVendor from interpreting `@import` statements in the wrapper source code. This is done by check if the import happens in the fake source file containing our wrapper code (which implies it was generated by LLDB).
This patch doesn't reenable the tests as there is more work needed to get the tests running on macOS (D67760)
Reviewers: aprantl, shafik, jingham
Subscribers: lldb-commits
Tags: #c_modules_in_lldb, #lldb
Differential Revision: https://reviews.llvm.org/D61565
llvm-svn: 372690
show more ...
|
| #
1442efea |
| 18-Sep-2019 |
Raphael Isemann <[email protected]> |
[lldb] Print better diagnostics for user expressions and modules
Summary: Currently our expression evaluators only prints very basic errors that are not very useful when writing complex expressions.
[lldb] Print better diagnostics for user expressions and modules
Summary: Currently our expression evaluators only prints very basic errors that are not very useful when writing complex expressions.
For example, in the expression below the user made a type error, but it's not clear from the diagnostic what went wrong: ``` (lldb) expr printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) error: invalid operands to binary expression ('int' and 'double') ```
This patch enables full Clang diagnostics in our expression evaluator. After this patch the diagnostics for the expression look like this:
``` (lldb) expr printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) error: <user expression 1>:1:54: invalid operands to binary expression ('int' and 'float') printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) ~~~~~~^~~~ ```
To make this possible, we now emulate a user expression file within our diagnostics. This prevents that the user is exposed to our internal wrapper code we inject.
Note that the diagnostics that refer to declarations from the debug information (e.g. 'note' diagnostics pointing to a called function) will not be improved by this as they don't have any source locations associated with them, so caret or line printing isn't possible. We instead just suppress these diagnostics as we already do with warnings as they would otherwise just be a context message without any context (and the original diagnostic in the user expression should be enough to explain the issue).
Fixes rdar://24306342
Reviewers: JDevlieghere, aprantl, shafik, #lldb
Reviewed By: JDevlieghere, #lldb
Subscribers: usaxena95, davide, jingham, aprantl, arphaman, kadircet, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D65646
llvm-svn: 372203
show more ...
|
|
Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1 |
|
| #
e21fc877 |
| 18-Jul-2019 |
Raphael Isemann <[email protected]> |
Add offsetof support to expression evaluator.
Summary: We currently don't support offsetof in the expression evaluator as it is implemented as a macro (which then calls __builtin_offsetof) in stddef
Add offsetof support to expression evaluator.
Summary: We currently don't support offsetof in the expression evaluator as it is implemented as a macro (which then calls __builtin_offsetof) in stddef.h. The best solution would be to include that header (or even better, import Clang's builtin module), but header-parsing and (cross-platform) importing modules is not ready yet.
Until we get this working with modules I would say we add the macro to our existing macro list as we already do with other macros from stddef.h/stdint.h. We should be able to drop all of them once we can import the relevant modules by default.
rdar://26040641
Reviewers: shafik, davide
Reviewed By: davide
Subscribers: clayborg, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D64917
llvm-svn: 366476
show more ...
|
|
Revision tags: llvmorg-10-init |
|
| #
01718666 |
| 10-Jul-2019 |
Raphael Isemann <[email protected]> |
[lldb] Fix handling of dollar characters in expr command
llvm-svn: 365698
|
|
Revision tags: llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1 |
|
| #
090a5b29 |
| 03-May-2019 |
Raphael Isemann <[email protected]> |
Fixed some minor style issues in rLLDB359921 [NFC]
Ran clang-format on the added test file and use the new StringRef comparison over the temporary ConstStrings. Also aligned the end of one of the co
Fixed some minor style issues in rLLDB359921 [NFC]
Ran clang-format on the added test file and use the new StringRef comparison over the temporary ConstStrings. Also aligned the end of one of the code string literals.
llvm-svn: 359931
show more ...
|
| #
e5cbe782 |
| 03-May-2019 |
Shafik Yaghmour <[email protected]> |
Fix for ambiguous lookup in expressions between local variable and namespace
Summary: In an Objective-C context a local variable and namespace can cause an ambiguous name lookup when used in an expr
Fix for ambiguous lookup in expressions between local variable and namespace
Summary: In an Objective-C context a local variable and namespace can cause an ambiguous name lookup when used in an expression. The solution involves mimicking the existing C++ solution which is to add local using declarations for local variables. This causes a different type of lookup to be used which eliminates the namespace during acceptable results filtering.
Differential Revision: https://reviews.llvm.org/D59960
llvm-svn: 359921
show more ...
|
| #
71569d0d |
| 02-May-2019 |
Raphael Isemann <[email protected]> |
Inject only relevant local variables in the expression evaluation context
Summary: In r259902, LLDB started injecting all the locals in every expression evaluation. This fixed a bunch of issues, but
Inject only relevant local variables in the expression evaluation context
Summary: In r259902, LLDB started injecting all the locals in every expression evaluation. This fixed a bunch of issues, but also caused others, mostly performance regressions on some codebases. The regressions were bad enough that we added a setting in r274783 to control the behavior and we have been shipping with the setting off to avoid the perf regressions.
This patch changes the logic injecting the local variables to only inject the ones present in the expression typed by the user. The approach is fairly simple and just scans the typed expression for every local name. Hopefully this gives us the best of both world as it just realizes the types of the variables really used by the expression.
Landing this requires the 2 other issues I pointed out today to be addressed but I wanted to gather comments right away.
Original patch by Frédéric Riss!
Reviewers: jingham, clayborg, friss, shafik
Reviewed By: jingham, clayborg
Subscribers: teemperor, labath, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D46551
llvm-svn: 359773
show more ...
|
| #
05cfdb0e |
| 26-Apr-2019 |
Raphael Isemann <[email protected]> |
Allow direct comparison of ConstString against StringRef
Summary: When we want to compare a ConstString against a string literal (or any other non-ConstString), we currently have to explicitly turn
Allow direct comparison of ConstString against StringRef
Summary: When we want to compare a ConstString against a string literal (or any other non-ConstString), we currently have to explicitly turn the other string into a ConstString. This makes sense as comparing ConstStrings against each other is only a fast pointer comparison.
However, currently we (rather incorrectly) use in several places in LLDB temporary ConstStrings when we just want to compare a given ConstString against a hardcoded value, for example like this: ``` if (extension != ConstString(".oat") && extension != ConstString(".odex")) ```
Obviously this kind of defeats the point of ConstStrings. In the comparison above we would construct two temporary ConstStrings every time we hit the given code. Constructing a ConstString is relatively expensive: we need to go to the StringPool, take a read and possibly an exclusive write-lock and then look up our temporary string in the string map of the pool. So we do a lot of heavy work for essentially just comparing a <6 characters in two strings.
I initially wanted to just fix these issues by turning the temporary ConstString in static variables/ members, but that made the code much less readable. Instead I propose to add a new overload for the ConstString comparison operator that takes a StringRef. This comparison operator directly compares the ConstString content against the given StringRef without turning the StringRef into a ConstString.
This means that the example above can look like this now: ``` if (extension != ".oat" && extension != ".odex") ``` It also no longer has to unlock/lock two locks and call multiple functions in other TUs for constructing the temporary ConstString instances. Instead this should end up just being a direct string comparison of the two given strings on most compilers.
This patch also directly updates all uses of temporary and short ConstStrings in LLDB to use this new comparison operator. It also adds a some unit tests for the new and old comparison operator.
Reviewers: #lldb, JDevlieghere, espindola, amccarth
Reviewed By: JDevlieghere, amccarth
Subscribers: amccarth, clayborg, JDevlieghere, emaste, arichardson, MaskRay, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D60667
llvm-svn: 359281
show more ...
|
|
Revision tags: llvmorg-8.0.0 |
|
| #
6c0bbfc0 |
| 12-Mar-2019 |
Raphael Isemann <[email protected]> |
Add ability to import std module into expression parser to improve C++ debugging
Summary: This patch is the MVP version of importing the std module into the expression parser to improve C++ debuggin
Add ability to import std module into expression parser to improve C++ debugging
Summary: This patch is the MVP version of importing the std module into the expression parser to improve C++ debugging.
What happens in this patch is that we inject a `@import std` into our expression source code. We also modify our internal Clang instance for parsing this expression to work with modules and debug info at the same time (which is the main change in terms of LOC). We implicitly build the `std` module on the first use. The C++ include paths for building are extracted from the debug info, which means that this currently only works if the program is compiled with `-glldb -fmodules` and uses the std module. The C include paths are currently specified by LLDB.
I enabled the tests currently only for libc++ and Linux because I could test this locally. I'll enable the tests for other platforms once this has landed and doesn't break any bots (and I implemented the platform-specific C include paths for them).
With this patch we can now: * Build a libc++ as a module and import it into the expression parser. * Read from the module while also referencing declarations from the debug info. E.g. `std::abs(local_variable)`.
What doesn't work (yet): * Merging debug info and C++ module declarations. E.g. `std::vector<CustomClass>` doesn't work. * Pretty much anything that involves the ASTImporter and templated code. As the ASTImporter is used for saving the result declaration, this means that we can't call yet any function that returns a non-trivial type. * Use libstdc++ for this, as it requires multiple include paths and Clang only emits one include path per module. Also libstdc++ doesn't support Clang modules without patches.
Reviewers: aprantl, jingham, shafik, friss, davide, serge-sans-paille
Reviewed By: aprantl
Subscribers: labath, mgorny, abidh, jdoerfert, lldb-commits
Tags: #c_modules_in_lldb, #lldb
Differential Revision: https://reviews.llvm.org/D58125
llvm-svn: 355939
show more ...
|