summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* [lldb/Lua] Implement a Simple Lua Script Interpreter PrototypeJonas Devlieghere2019-12-2014-12/+235
| | | | | | | | | | | | | | | This implements a very elementary Lua script interpreter. It supports running a single command as well as running interactively. It uses editline if available. It's still missing a bunch of stuff though. Some things that I intentionally ingored for now are that I/O isn't properly hooked up (so every print goes to stdout) and the non-editline support which is not handling a bunch of corner cases. The latter is a matter of reusing existing code in the Python interpreter. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2019-December/015812.html Differential revision: https://reviews.llvm.org/D71234
* In 'thread step-out' command, only insert a breakpoint in executable memory.Jim Ingham2019-12-204-1/+63
| | | | | | | | | Previously, if the current function had a nonstandard stack layout/ABI, and had a valid data pointer in the location where the return address is usually located, data corruption would occur when the breakpoint was written. This could lead to an incorrectly reported crash or silent corruption of the program's state. Now, if the above check fails, the command safely aborts. Differential Revision: https://reviews.llvm.org/D71372
* ThreadPlanTracer::TracingStarted can't call virtual methods on Thread.Jim Ingham2019-12-201-4/+5
| | | | | | | | | | TracingStarted gets called in the Thread constructor, which means you can't call a virtual method of the class. So delay setting up the m_register_values till you need them. NFC as lldb just crashes if you don't do this. The thread tracing is an only occasionally useful feature, and it only sort of works. I'm not adding tests etc. at this point, I'm just poking at it a bit. If I get it working better I'll write tests and so forth.
* [lldb][NFC] Remove utility methods in TestClangASTImporterRaphael Isemann2019-12-201-35/+8
| | | | | We have a central header for all these methods so we can just use those for creating ClangASTContexts.
* [lldb][NFC] Remove redundant ASTContext args to CopyDecl/DeportDeclRaphael Isemann2019-12-206-28/+14
| | | | | | We already pass a Decl here and the additional ASTContext needs to match the Decl. We might as well just pass the Decl and then extract the ASTContext from that.
* [lldb/cmake] Delete LLDB_LINKER_SUPPORTS_GROUPSPavel Labath2019-12-201-6/+0
| | | | The variable is unused.
* [lldb] Fix an unused variable warningPavel Labath2019-12-201-1/+1
|
* [lldb/cmake] Remove support for LLDB_DISABLE_CURSESPavel Labath2019-12-201-6/+1
| | | | The buildbot which necessitated this is fixed.
* [lldb][NFC] Move utility functions from ClangASTImporter and ↵Raphael Isemann2019-12-204-84/+129
| | | | ClangExpressionDeclMap to own header
* [lldb] Put the headers in unittests/TestingSupport/ into modulesRaphael Isemann2019-12-201-0/+11
|
* [lldb] Fix a -Wreturn-type warning on gccPavel Labath2019-12-201-0/+1
|
* [lldb/pexpect] Force-set the TERM environment variablePavel Labath2019-12-201-1/+7
| | | | | | | | | In some environments (typically, buildbots), this variable may not be available. This can cause tests to behave differently. Explicitly set the variable to "vt100" to ensure consistent test behavior. It should not matter that we do not inherit the process TERM variable, as the child process runs in a new virtual terminal anyway.
* [lldb] Add tests for ClangASTImporter's DeportType and DeportDecl methodsRaphael Isemann2019-12-201-11/+82
|
* [lldb] Fix test using lld on non-linux systemsJohannes Altmanninger2019-12-202-4/+4
|
* [lldb] Make that we can call HostInfo::Initialize and HostInfo::Terminate ↵Raphael Isemann2019-12-201-44/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | multiple times Summary: HostInfo's state isn't actually fully rested after calling ::Terminate. Currently we only reset the values of all the `HostInfoBaseFields` but not all the variables with static storage that keep track of whether the fields need to be initialised. This breaks random unit tests as running them twice (or running multiple test instances in one run) will cause that the second time we ask HostInfo for any information we get the default value back for any field. This patch moves all the once_flag's into the `HostInfoBaseFields` so that they also get reseted by ::Terminate and removes all the `success` bools. We should also rewrite half this code but I would prefer if my tests aren't broken over the holidays so let's just put some duct tape on it for now. Reviewers: labath Reviewed By: labath Subscribers: abidh, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71748
* [lldb] Added test for objc_direct calls with categoriesRaphael Isemann2019-12-201-0/+13
| | | | As pointed out in D71694 this wasn't tested before in LLDB.
* [lldb] Remove XFAIL from TestDeadStrip.pyPavel Labath2019-12-201-2/+0
| | | | Fixed by 92211b.
* [LLDB] Fix address computation for inline functionJohannes Altmanninger2019-12-203-3/+40
| | | | | | | | | | | | | | | | | | | | Summary: Fixes PR41237 - SIGSEGV on call expression evaluation when debugging clang When linking multiple compilation units that define the same functions, the functions is merged but their debug info is not. This ignores debug info entries for functions in a non-executable sections; those are functions that were definitely dropped by the linker. Reviewers: spyffe, clayborg, jasonmolenda Reviewed By: clayborg Subscribers: labath, aprantl, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71487
* [ASTImporter][LLDB] Modifying ImportDeclContext(...) to ensure that we ↵shafik2019-12-193-1/+44
| | | | | | | | | | complete each FieldDecl of a RecordDecl when we are importing the definiton This fix was motivated by a crashes in expression parsing during code generation in which we had a RecordDecl that had incomplete FieldDecl. During code generation when computing the layout for the RecordDecl we crash because we have several incomplete FieldDecl. This fixes the issue by assuring that during ImportDefinition(...) for a RecordDecl we also import the definitions for each FieldDecl. Differential Revision: https://reviews.llvm.org/D71378
* [lldb/Lua] Add Boilerplate for a Lua Script InterpreterJonas Devlieghere2019-12-199-0/+146
| | | | | | | | | | | This adds the boilerplate necessary to support the Lua script interpreter. The interpreter is not functional yet and just reports that it's not implemented. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2019-December/015812.html Differential revision: https://reviews.llvm.org/D71232
* [lldb][NFC] Change if statements in ClangASTImporter to follow LLVM code styleRaphael Isemann2019-12-192-24/+13
|
* [lldb/Scripting] Simplify code by removing the #if.Jonas Devlieghere2019-12-181-11/+3
| | | | | | | | | The "none" script interpreter does not depend on Python so it doesn't make sense to have it withing the if-block. The only goal seems to be to have a slightly different error for when there's no script interpreter, but as per the comment this doesn't make sense for more than one scripting language. I think the existing error is perfectly clear, so I just removed this altogether.
* make err msg in MachSymtabSectionInfo::GetSection clear about the fileJason Molenda2019-12-181-2/+8
| | | | | | This error message didn't specify which file was malformed, so there's some hunting-around required if it comes up. We have the filename; include it in the error message.
* [lldb/test] Move script interpreter testsJonas Devlieghere2019-12-182-2/+4
| | | | | | Create a new test for lldb launched without a script interpreter and move it under a new `ScriptInterpreter` directory. Also move crashlog.test there for consistency.
* Add prototype for a function we call.Jason Molenda2019-12-181-0/+2
|
* [lldb/MachO] "Fix" intentional out-of-bounds error (NFC)Jonas Devlieghere2019-12-182-6/+8
| | | | | | | Remove the hack that populates the cpsr register in the gpr struct by writing past the end of the array. This was tripping up ASan. Patch by: Reva Cuthbertson
* [lldb][NFC] Add unit test for persistent variable lookup with ↵Raphael Isemann2019-12-183-23/+126
| | | | | | | | | ClangExpressionDeclMap This adds a unit test for looking up persistent declarations in the scratch AST context. Also adds the `GetPersistentDecl` hook to the ClangExpressionDeclMap that this unit test can emulate looking up persistent variables without having a lldb_private::Target.
* [lldb][NFC] Use StringRef in CreateRecordType and CreateObjCClassRaphael Isemann2019-12-176-18/+22
|
* [lldb][NFC] Rename ClangASTImporter::InsertRecordDecl to SetRecordLayout and ↵Raphael Isemann2019-12-176-7/+14
| | | | | | | document it This function is just setting the layout for the given RecordDecl so the current name is not very descriptive. Also add some documentation for it.
* [lldb][NFC] Allow creating ClangExpressionDeclMap and ClangASTSource without ↵Raphael Isemann2019-12-179-21/+109
| | | | | | | | | | a Target and add basic unit test The ClangExpressionDeclMap should be testable from a unit test. This is currently impossible as they have both dependencies on Target/ExecutionContext from their constructor. This patch allows constructing these classes without an active Target and adds the missing tests for running without a target that we can do at least a basic lookup test without crashing.
* [lldb] Remove modern-type-lookupRaphael Isemann2019-12-1724-463/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As discussed on the mailing list [1] we have to make a decision for how to proceed with the modern-type-lookup. This patch removes modern-type-lookup from LLDB. This just removes all the code behind the modern-type-lookup setting but it does *not* remove any code from Clang (i.e., the ExternalASTMerger and the clang-import-test stay around for now). The motivation for this is that I don't think that the current approach of implementing modern-type-lookup will work out. Especially creating a completely new lookup system behind some setting that is never turned on by anyone and then one day make one big switch to the new system seems wrong. It doesn't fit into the way LLVM is developed and has so far made the transition work much more complicated than it has to be. A lot of the benefits that were supposed to come with the modern-type-lookup are related to having a better organization in the way types move across LLDB and having less dependencies on unrelated LLDB code. By just looking at the current code (mostly the ClangASTImporter) I think we can reach the same goals by just incrementally cleaning up, documenting, refactoring and actually testing the existing code we have. [1] http://lists.llvm.org/pipermail/lldb-dev/2019-December/015831.html Reviewers: shafik, martong Subscribers: rnkovacs, christof, arphaman, JDevlieghere, usaxena95, lldb-commits, friss Tags: #lldb Differential Revision: https://reviews.llvm.org/D71562
* [lldb][NFC] Remove all unnecessary includes for ClangASTSourceCommon.hRaphael Isemann2019-12-175-5/+3
| | | | | These files only need the definition of ClangASTMetadata (which was previously in the ClangASTSourceCommon.h) or don't need the include at all.
* [lldb-vscode] Centrally skip debug info variants for vscode testsPavel Labath2019-12-1710-25/+2
| | | | Previously each test was annotated manually. This does the same thing.
* [lldb][NFC] Remove implementation of GetOriginalDecl and just call ↵Raphael Isemann2019-12-171-12/+1
| | | | | | | | GetDeclOrigin instead Those functions have the same semantics beside some small optimization of not creating a new empty ASTContextMetadataSP value in the metadata map. We never actually hit this optimization according to test coverage so let's just call GetDeclOrigin instead.
* [lldb] Add support for calling objc_direct methods from LLDB's expression ↵Raphael Isemann2019-12-177-3/+109
| | | | | | | | | | | | | | | | | | | | | evaluator. Summary: D69991 introduced `__attribute__((objc_direct))` that allows directly calling methods without message passing. This patch adds support for calling methods with this attribute to LLDB's expression evaluator. The patch can be summarised in that LLDB just adds the same attribute to our module AST when we find a method with `__attribute__((objc_direct))` in our debug information. Reviewers: aprantl, shafik Reviewed By: shafik Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71196
* [lldb][NFC] Make clang-format happy by removing trailing space in ArchSpec.cppRaphael Isemann2019-12-171-1/+1
|
* [lldb] Fix unused variable warning in ThreadPlanStepRange.cppRaphael Isemann2019-12-171-1/+0
| | | | | This was added in 434905b97d961531286d4b49c7ee1969f7cbea0e. Remove it to fix the compiler warnings for this.
* Explicitly specify -std=c++11 and include <mutex> and <condition_variable>.Jim Ingham2019-12-164-0/+6
| | | | These files built on macos but not on Debian Linux. Let's see if this fixes it.
* Run all threads when extending a next range over a call.Jim Ingham2019-12-1612-94/+232
| | | | | | | | | If you don't do this you end up running arbitrary code with only one thread allowed to run, which can cause deadlocks. <rdar://problem/56422478> Differential Revision: https://reviews.llvm.org/D71440
* [lldb] Respect previously set values of LLDB_TABLEGEN_EXEAlex Langford2019-12-161-11/+13
| | | | | | | If you set LLDB_TABLEGEN_EXE in a CMake cache file or in the CMake invocation line, your setting isn't respected. Setting up the tablegen for the host will overwrite the value that we set LLDB_TABLEGEN_EXE to, which defeats the whole point of setting it in the first place.
* [lldb] Use file-based synchronization in TestVSCode_attachPavel Labath2019-12-162-14/+26
| | | | The is the best method we have at the moment for attach-style tests.
* [lldb] Add unit test for ClangASTImporterRaphael Isemann2019-12-162-0/+221
|
* [lldb][NFC] Remove all overloads of Copy/DeportType in ClangASTImporterRaphael Isemann2019-12-164-72/+42
| | | | | | | The overloads that don't take a CompilerType serve no purpose as we always have a CompilerType in the scope where we call them. Instead just call the overload that takes a CompilerType and delete the now unused other overloaded methods.
* [lldb] Centralize desugaring of decltype-like types in ClangASTContextPavel Labath2019-12-162-78/+48
| | | | | | | | | | | | | | | | | | | | | | Summary: These types were handled in some places, but not others. This resulted in (for example) not being able to display members of structs whose types were defined using these constructs. Using getLocallyUnqualifiedSingleStepDesugaredType for these types is not fully equivalent, as it will only desugar them if the types are not instantiation-dependent, whereas previously we did that unconditionally. It's not clear to me which behavior is correct here, but the test suite does not seem to care either way. Reviewers: teemperor, shafik Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71405
* [lldb][NFC] Move definition of ClangASTMetadata out of ↵Raphael Isemann2019-12-166-104/+138
| | | | | | | | | | ClangExternalASTSourceCommon.h Changing metadata of a ClangASTContext currently requires to include the unrelated ClangExternalASTSourceCommon.h header because it actually defines the ClangASTMetadata class. This also removes the dependency from ClangASTImporter to ClangExternalASTSourceCommon.
* [lldb][NFC] Fix file header of TestClangASTContext.cppRaphael Isemann2019-12-161-3/+1
|
* [lldb][NFC] Remove ClangASTImporter::ResolveDeclOriginRaphael Isemann2019-12-164-56/+30
| | | | ResolveDeclOrigin was just an inconvenience method around GetDeclOrigin.
* [lldb][NFC] Remove unnecessary includes in source/CommandsRaphael Isemann2019-12-1644-122/+0
| | | | | | | | | | | | | | Summary: This removes most of unnecessary includes in the `source/Commands` directory. This was generated by IWYU and a script that fixed all the bogus reports from IWYU. Patch is tested on Linux and macOS. Reviewers: JDevlieghere Reviewed By: JDevlieghere Subscribers: krytarowski, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71489
* [lldb][NFC] Replace ClangASTImporter's use of map/set with SmallPtrSet and ↵Raphael Isemann2019-12-162-10/+8
| | | | | | | | DenseMap We have several pointer->pointer mappings in the ClangASTImporter implemented using STL data structures. This moves these variables to the appropriate LLVM data structures that are intended for mapping pointers.
* [lldb] Remove RTTI in ClangExternalASTSourceCommon based on a global map of ↵Raphael Isemann2019-12-153-61/+25
| | | | | | | | | | | | | | | | | | | | | | known instances Summary: Currently we do our RTTI check for ClangExternalASTSourceCommon by using this global map of ClangExternalASTSourceCommon where every instance is registering and deregistering itself on creation/destruction. Then we can do the RTTI check by looking up in this map from ClangASTContext. This patch removes this whole thing and just adds LLVM-style RTTI support to ClangExternalASTSourceCommon which is possible with D71397. Reviewers: labath, aprantl Reviewed By: labath Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71398
OpenPOWER on IntegriCloud