summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* [lldb/Reproducer] Add SBReproducer::Replay overload (again)Jonas Devlieghere2020-01-102-1/+6
| | | | | | | I modified the SBAPI under the assumption that nobody was using the old API yet. However, that turns out to be false. So instead of adding the deafault argument I've reintroduced the old API and made the new one an overload.
* lldbutil: Forward ASan launch info to test inferiorsVedant Kumar2020-01-102-1/+14
| | | | | | | | | This allows an unsanitized test process which loads a sanitized DSO (the motivating example is a Swift runtime dylib) to launch on Darwin. rdar://57290132 Differential Revision: https://reviews.llvm.org/D71379
* [lldb/Utils] Remove vim-lldbJonas Devlieghere2020-01-109-1834/+0
| | | | | | | | | The vim-lldb plugin is unmaintained and doesn't work with a recent vim installation that uses Python 3. This removes it from the LLDB repository. The code is still available under lldb-tools on GitHub like we did with for lldb-mi. (https://github.com/lldb-tools/vim-lldb) Differential revision: https://reviews.llvm.org/D72541
* [lldb/Test] Bypass LLDB_TEST_COMMON_ARGS for certain dotest args (NFC)Jonas Devlieghere2020-01-104-15/+39
| | | | | | | | Rather than serializing every argument through LLDB_TEST_COMMON_ARGS, we can pass some of them directly using their CMake variable. Although this does introduce some code duplication between lit's site config and the lldb-dotest utility, it also means that it becomes easier to override these values (WIP).
* [lldb/Scripts] Move android script from underneath Python dirJonas Devlieghere2020-01-102-26/+0
| | | | | The scripts root directory already contains python scripts. No need to keep this one nested under a dedicated Python directory.
* [lldb/Scripts] Remove remote-build.pyJonas Devlieghere2020-01-101-312/+0
| | | | With Xcode gone this is no longer relevant.
* [lldb/Scripts] Remove buildbot.pyJonas Devlieghere2020-01-101-196/+0
| | | | | This file is outdated and still references SVN. Buildbots are configured through the zorg repository.
* [lldb] Fix TestClangASTContext.TestFunctionTemplateInRecordConstruction in ↵Raphael Isemann2020-01-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Debug builds Summary: In Debug builds we call VerifyDecl in ClangASTContext::CreateFunctionDeclaration which in turn calls `getAccess` on the created FunctionDecl. As we passed in a RecordDecl as the DeclContext for the FunctionDecl, we end up hitting the assert in `getAccess` that checks that we never have a Decl inside a Record without a valid AccessSpecifier. FunctionDecls are never in RecordDecls (that would be a CXXMethodDecl) so setting a access specifier would not be the correct way to fix this. Instead this patch does the same thing that DWARFASTParserClang::ParseSubroutine is doing: We pass in the FunctionDecl with the TranslationUnit as the DeclContext. That's not ideal but it is how we currently do it when creating our debug info AST, so the unit test should do the same. Reviewers: shafik Reviewed By: shafik Subscribers: aprantl, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72359
* [lldb] Make CompleteTagDeclsScope completion order deterministicRaphael Isemann2020-01-101-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We iterate over `m_decls_to_complete` to complete declarations. As `m_decls_to_complete` is a set the iteration order can be non-deterministic. The order is currently only non-deterministic when we have a large set of decls that need to be completed (i.e. more than 32 decls, as otherwise the SmallPtrSet is just a linear-searched list). This doesn't really fix any specific bug or has any really observable change in behavior as the order in which we import should not influence any semantics. However the order we create decls/types is now always deterministic which should make debugging easier. Reviewers: labath, mib, shafik, davide Reviewed By: shafik, davide Subscribers: davide, abidh, JDevlieghere, lldb-commits, mgrang Tags: #lldb Differential Revision: https://reviews.llvm.org/D72495
* [lldb/Lua] Support loading Lua modulesJonas Devlieghere2020-01-106-0/+69
| | | | | | Implements the command script import command for Lua. Differential revision: https://reviews.llvm.org/D71825
* [lldb] Remove FieldDecl stealing hack by rerouting indirect imports to the ↵Raphael Isemann2020-01-102-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | original AST Summary: This is a port of D67803 that was about preventing indirect importing to our scratch context when evaluating expressions. D67803 already has a pretty long explanation of how this works, but the idea is that instead of importing declarations indirectly over the expression AST (i.e., Debug info AST -> Expression AST -> scratch AST) we instead directly import the declaration from the debug info AST to the scratch AST. The difference from D67803 is that here we have to do this in the ASTImporterDelegate (which is our ASTImporter subclass we use in LLDB). It has the same information as the ExternalASTMerger in D67803 as it can access the ClangASTImporter (which also keeps track of where Decls originally came from). With this patch we can also delete the FieldDecl stealing hack in the ClangASTSource (this was only necessary as the indirect imports caused the creation of duplicate Record declarations but we needed the fields in the Record decl we originally found in the scratch ASTContext). This also fixes the current gmodules failures where we fail to find std::vector fields after an indirect import over the expression AST (where it seems even our FieldDecl stealing hack can't save us from). Reviewers: shafik, aprantl Reviewed By: shafik Subscribers: JDevlieghere, lldb-commits, mib, labath, friss Tags: #lldb Differential Revision: https://reviews.llvm.org/D72507
* Add missing nullptr checks.Adrian Prantl2020-01-108-29/+42
| | | | | | | | | | 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
* [lldb][tests] Make it possible to expect failure for a whole categoryTatyana Krasnukha2020-01-104-4/+24
| | | | | | | | | | | | | There already are decorators and "--excluded" option to mark test-cases/files as expected to fail. However, when a new test file is added and it which relates to a feature that a target doesn't support, this requires either adding decorators to that file or modifying the file provided as "--excluded" option value. The purpose of this patch is to avoid any modifications in such cases. E.g. if a target doesn't support "watchpoints" and passes "--xfail-category watchpoint" to dotest, a testing job will not fail after a new watchpoint-related test file is added. Differential Revision: https://reviews.llvm.org/D71906
* [lldb][tests][NFC] Unify variable naming conventionTatyana Krasnukha2020-01-105-45/+45
|
* RangeDataVector: Support custom sorting for D63540Jan Kratochvil2020-01-102-23/+54
| | | | | | | | | | | As suggested by @labath extended RangeDataVector so that user can provide custom sorting of the Entry's `data' field for D63540. https://reviews.llvm.org/D63540 RangeData functions were used just by RangeDataVector (=after I removed them LLDB still builds fine) which no longer uses them so I removed them. Differential revision: https://reviews.llvm.org/D72460
* [lldb][tests] Cleanup '.categories'Tatyana Krasnukha2020-01-106-5/+1
|
* [lldb][test] NFC, re-use _getTestPath() functionTatyana Krasnukha2020-01-101-21/+14
|
* [lldb][tests] Take into account all parent's categories when traverse ↵Tatyana Krasnukha2020-01-102-12/+13
| | | | | | | | | | | | folders upwards This is needed to not re-write parent's categories by categories of a nested folder, e.g. commands/expression/completion specify "cmdline" category, however it still belongs to parent's "expression" category. The sentinel ".categories" in the test-suite root directory is no longer needed. Differential Revision: https://reviews.llvm.org/D71905
* [lldb] Surpress "bitfield too small" gcc warningPavel Labath2020-01-101-3/+3
| | | | | | | Gcc produces this (technically correct) warning when storing an explicitly-sized enum in a bitfield. Surpress that by changing the type of the bitfield to an integer. The same approach is used elsewhere in llvm (e.g. 56b5eab12).
* [lldb/DWARF] Don't automatically search dwo unit attributesPavel Labath2020-01-104-23/+7
| | | | | | | | | | | | This patch removes the code (deep inside DWARFDebugInfoEntry) which automagically returned the attributes of the dwo unit DIE when asking for the attributes of the skeleton unit. This is fairly hacky, and not consistent with how llvm DWARF parser operates. Instead, I change the code the explicitly request (via GetNonSkeletonUnit) the right unit to search (there were just two places that needed this). If it turns out we need this more often, we can create a utility function (external to DWARFUnit) for doing this.
* [lldb/lua] Make convenience_variables.test compatible with lua-5.1Pavel Labath2020-01-101-5/+5
|
* Data formatters: Look through array element typedefsJaroslav Sevcik2020-01-106-6/+54
| | | | | | | | | | | | | | | | | Summary: Motivation: When formatting an array of typedefed chars, we would like to display the array as a string. The string formatter currently does not trigger because the formatter lookup does not resolve typedefs for array elements (this behavior is inconsistent with pointers, for those we do look through pointee typedefs). This patch tries to make the array formatter lookup somewhat consistent with the pointer formatter lookup. Reviewers: teemperor, clayborg Reviewed By: teemperor, clayborg Subscribers: clayborg, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72133
* When reading Aux file in chunks, read consecutive byte rangesJason Molenda2020-01-092-1/+161
| | | | | | | | | | | | | | | | | | | | | | | qemu has a very small maximum packet size (4096) and it actually only uses half of that buffer for some implementation reason, so when lldb asks for the register target definitions, the x86_64 definition is larger than 4096/2 and we need to fetch it in two parts. This patch and test is fixing a bug in GDBRemoteCommunicationClient::ReadExtFeature when reading a target file in multiple parts. lldb was assuming that it would always get back the maximum packet size response (4096) instead of using the actual size received and asking for the next group of bytes. We now have two tests in gdb_remote_client for unique features of qemu - TestNestedRegDefinitions.py would test the ability of lldb to follow multiple levels of xml includes; I opted to create a separate TestRegDefinitionInParts.py test to test this wrinkle in qemu's gdb remote serial protocol stub implementation. Instead of combining both tests into a single test file. <rdar://problem/49537922>
* [lldb] Remove spurious fileJonas Devlieghere2020-01-091-51/+0
|
* [lldb/Lua] Add lua typemaps for INOUT paramsJonas Devlieghere2020-01-092-0/+2
|
* [lldb/SWIG] Undo incorrect substitutionJonas Devlieghere2020-01-091-1/+1
| | | | The Python directory for the script interpreter is still capitalized.
* [lldb/SWIG] Fix capitalization for case sensitive file systems.Jonas Devlieghere2020-01-091-4/+4
| | | | | When moving the Python directory I renamed it to python (lowercase) but didn't update the python.swig file.
* [lldb/Bindings] Move bindings into their own subdirectoryJonas Devlieghere2020-01-0980-18/+17
| | | | | | | | | | | | All the code required to generate the language bindings for Python and Lua lives under scripts, even though the majority of this code aren't scripts at all, and surrounded by scripts that are totally unrelated. I've reorganized these files and moved everything related to the language bindings into a new top-level directory named bindings. This makes the corresponding files self contained and much more discoverable. Differential revision: https://reviews.llvm.org/D72437
* [lldb/Lua] Make lldb.debugger et al available to LuaJonas Devlieghere2020-01-0910-3/+89
| | | | | | | | The Python script interpreter makes the current debugger, target, process, thread and frame available to interactive scripting sessions through convenience variables. This patch does the same for Lua. Differential revision: https://reviews.llvm.org/D71801
* [lldb/SWIG] Add missing '\' in macros againJonas Devlieghere2020-01-091-2/+2
| | | | | | Making the string conversion operator a macro unintentionally dropped the backslash before '\n' and '\r' and was therefore incorrectly stripping 'n' and 'r' from the object description.
* [lldb] Modernize OptionValue::SetValueChangedCallbackPavel Labath2020-01-0910-132/+70
| | | | | instead of a function pointer + void*, take a std::function. This removes a bunch of repetitive, unsafe void* casts.
* [lldb/DWARF] Fix mixed v4+v5 location listsPavel Labath2020-01-0910-75/+184
| | | | | | | | | | | | | | | | | | | | | | Summary: Our code was expecting that a single (symbol) file contains only one kind of location lists. This is not correct (on non-apple platforms, at least) as a file can compile units with different dwarf versions. This patch moves the deteremination of location list flavour down to the compile unit level, fixing this problem. I have also tried to rougly align the code with the llvm DWARFUnit. Fully matching the API is not possible because of how lldb's DWARFExpression lives separately from the rest of the DWARF code, but this is at least a step in the right direction. Reviewers: JDevlieghere, aprantl, clayborg Subscribers: dblaikie, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71751
* [lldb/DWARF] Add is_dwo member to DWARFUnitPavel Labath2020-01-097-20/+19
| | | | | | | | | | | | | | | | | | | | | | Summary: A skeleton unit can easily be detected by checking the m_dwo_symbol_file member, but we cannot tell a split unit from a normal unit from the "inside", which is sometimes useful. This patch adds a m_is_dwo member to enable this, and align the code with llvm::DWARFUnit. Right now it's only used to avoid creating a split unit inside another split unit (which removes one override from SymbolFileDWARFDwo and brings us a step closer to deleting it), but my main motivation is fixing the handling of location lists in mixed v4&v5 files. This comes in a separate patch. Reviewers: JDevlieghere, aprantl, clayborg Subscribers: dblaikie, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71750
* [lldb] Fix that TestNoSuchArch.py was passing for the wrong reasonRaphael Isemann2020-01-091-2/+2
| | | | | | The command here failed due to the type in 'create' but the expect did not actually check for the error message. This fixes the typo and adds a check for the actuall error message we should see.
* [lldb/SWIG] Refactor extensions to be non Python-specific (3/3)Jonas Devlieghere2020-01-0818-253/+59
| | | | | | | | | | | The current SWIG extensions for the string conversion operator is Python specific because it uses the PythonObjects. This means that the code cannot be reused for other SWIG supported languages such as Lua. This reimplements the extensions in a more generic way that can be reused. It uses a SWIG macro to reduce code duplication. Differential revision: https://reviews.llvm.org/D72377
* Save more descriptive error msg from FBS/BKS, relay it up to lldb.Jason Molenda2020-01-081-20/+26
| | | | | | | | | | | | | | | | | | | When lldb requests an app launch through FrontBoard/BackBoard, we get back an NSError object if there was a problem with an integer error code and a descriptive text string. debugserver would log the descriptive text string to the console, but it would only save the error code value, ask for the much-less-specific name of that error code, and send that very generic error word back to lldb. This patch saves the longer description of the failure when available, and sends that to lldb. If unavailable, it falls back to sending up the generic description of the error code as it was doing before. This only impacts the iOS on-device debugserver. <rdar://problem/49953304>
* [lldb] Remove various dead Compare functionsAlex Langford2020-01-084-139/+0
|
* [lldb/SWIG] Refactor extensions to be non Python-specific (2/2)Jonas Devlieghere2020-01-0825-287/+95
| | | | | | | | | | | The current SWIG extensions for the string conversion operator is Python specific because it uses the PythonObjects. This means that the code cannot be reused for other SWIG supported languages such as Lua. This reimplements the extensions in a more generic way that can be reused. It uses a SWIG macro to reduce code duplication. Differential revision: https://reviews.llvm.org/D72377
* Delete dead code.Adrian Prantl2020-01-081-48/+0
| | | | https://reviews.llvm.org/D58856
* [lldb/CMake] Only auto-enable Lua when SWIG is foundJonas Devlieghere2020-01-082-1/+32
| | | | | | Just like Python, Lua should only be auto-enabled if SWIG is found as well. This moves the logic of finding SWIG and Lua as a whole into a new CMake package.
* [lldb/SWIG] Refactor extensions to be non Python-specificJonas Devlieghere2020-01-084-14/+18
| | | | | | | | | | | The current SWIG extensions for the string conversion operator is Python specific because it uses the PythonObjects. This means that the code cannot be reused for other SWIG supported languages such as Lua. This reimplements the extensions in a more generic way that can be reused. Differential revision: https://reviews.llvm.org/D72377
* [lldb/CMake] Use LLDB's autodetection logic for libxml2Jonas Devlieghere2020-01-082-12/+17
| | | | | | | Libxml2 is already an optional dependency. It should use the same infrastructure as the other dependencies. Differential revision: https://reviews.llvm.org/D72290
* [lldb] Remove default llvm::Triple argument from ClangASTContext constructorRaphael Isemann2020-01-082-3/+4
| | | | | | | | | | | Creating an ASTContext with an unknown triple is rarely a good idea (as usually all our ASTs have a valid triple that is either from the host or the target) and the default argument makes it far to easy to implicitly create such an AST. Let's remove it and force people to pass a triple. The only place where we don't pass a triple is a DWARFASTParserClangTests where we now just pass the host triple instead (the test doesn't depend on any triple so this shouldn't change anything).
* [lldb][NFC] Remove redundant ClangASTContext constructor that takes ArchSpecRaphael Isemann2020-01-082-30/+23
| | | | | | | ArchSpec has a superset of the information of llvm::Triple but the ClangASTContext just uses the Triple part of it. This deletes the ArchSpec constructor and all the code creating ArchSpecs and instead just uses the llvm::Triple constructor for ClangASTContext.
* [lldb/CMake] Only auto-enable Python when SWIG is foundJonas Devlieghere2020-01-072-36/+37
| | | | | | | | | As correctly pointed out by Martin on the mailing list, Python should only be auto-enabled if SWIG is found as well. This moves the logic of finding SWIG into FindPythonInterpAndLibs to make that possible. To make diagnosing easier I've included a status message to convey why Python support is disabled.
* [lldb/Test] Try to appease the Windows botJonas Devlieghere2020-01-071-1/+0
| | | | | | | | | | | | In TestConvenienceVariables I changed %t from a file to a directory. This tripped up mkdir which can't deal with an existing file at the given location. In order to solve this issue on the bots I added an `rm -rf %t` statement, but now the Windows bot complains that "This function is not supported on this system". If you never ran the test suite wit this temporary workaround, the test might fail. If this happens please remove what %t expands to in the lit output and rerun the test.
* Revert "Re-land "[lldb/Lua] Add string conversion operator for SBTarget.""Jonas Devlieghere2020-01-074-12/+12
| | | | | | This was returning a pointer to a stack-allocated memory location. This works for Python where we return a PythonString which must own the underlying string.
* Rewrite comment about what watchpoints Aarch64 supports.Jason Molenda2020-01-071-21/+29
|
* Re-land "[lldb/Lua] Add string conversion operator for SBTarget."Jonas Devlieghere2020-01-074-12/+12
| | | | | | | Extend the SBTarget class with a string conversion operator and reuse the same code between Python and Lua. This should happen for all the SB classes, but I'm doing just this one as an example and for use in a test case.
* [lldb/Test] Remove old binary created by TestConvenienceVariablesJonas Devlieghere2020-01-071-0/+1
| | | | | On a dirty build directory the new mkdir fails because the file already exists and is not a directory.
OpenPOWER on IntegriCloud