summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* [CMake] Python bindings generation polishingStefan Granitz2019-01-043-46/+39
| | | | | | | | | | | | | | | | | Summary: Simplify SWIG invocation and handling of generated files. The `swig_wrapper` target can generate `LLDBWrapPython.cpp` and `lldb.py` in its own binary directory, so we can get rid of a few global variables and their logic. We can use the swig_wrapper's BINARY_DIR target property to refer to it and liblldb's LIBRARY_OUTPUT_DIRECTORY to refer to the framework/shared object output directory. Reviewers: JDevlieghere, aprantl, stella.stamenova, beanz, zturner, xiaobai Reviewed By: aprantl Subscribers: mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D55332 llvm-svn: 350393
* [CMake] Revised RPATH handlingStefan Granitz2019-01-045-4/+67
| | | | | | | | | | | | | | | | | | | | | | | Summary: If we build LLDB.framework, dependant tools need appropriate RPATHs in both locations, the build-tree (for testing) and the install-tree (for deployment). Luckily, CMake can handle it for us: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling. * In the build-tree, tools use the absolute path to the framework's actual output location. * In the install-tree, tools get a list of RPATHs to look for the framework when deployed. `LLDB_FRAMEWORK_INSTALL_DIR` is added to the `CMAKE_INSTALL_PREFIX` to change the relative location of LLDB.framework in the install-tree. If it is not empty, it will be added as an additional RPATH to all dependant tools (so they are functional in the install-tree). If it is empty, LLDB.framework goes to the root and tools will not be functional in the directory structure of the LLVM install-tree. For historical reasons `LLDB_FRAMEWORK_INSTALL_DIR` defaults to "Library/Frameworks". Reviewers: xiaobai, JDevlieghere, aprantl, clayborg Reviewed By: JDevlieghere Subscribers: ki.stfu, mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D55330 llvm-svn: 350392
* [CMake] Revised LLDB.framework buildsStefan Granitz2019-01-0413-173/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add features to LLDB CMake builds that have so far only been available in Xcode. Clean up a few inconveniences and prepare further improvements. Options: * `LLDB_FRAMEWORK_BUILD_DIR` determines target directory (in build-tree) * `LLDB_FRAMEWORK_INSTALL_DIR` **only** determines target directory in install-tree * `LLVM_EXTERNALIZE_DEBUGINFO` allows externalized debug info (dSYM on Darwin, emitted to `bin`) * `LLDB_FRAMEWORK_TOOLS` determines which executables will be copied to the framework's Resources (dropped symlinking, removed INCLUDE_IN_SUITE, removed dummy targets) Other changes: * clean up `add_lldb_executable()` * include `LLDBFramework.cmake` from `source/API/CMakeLists.txt` * use `*.plist.in` files, which are typical for CMake and independent from Xcode * add clang headers to the framework bundle Reviewers: xiaobai, JDevlieghere, aprantl, davide, beanz, stella.stamenova, clayborg, labath Reviewed By: aprantl Subscribers: friss, mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D55328 llvm-svn: 350391
* [CMake] Move debugserver options to separate debugserverConfig.cmakeStefan Granitz2019-01-042-2/+4
| | | | | | | | | | | | | | | Summary: One place for debugserver options, analog to LLDBConfig for LLDB options (see D55317). It was discussed in earlier reviews already, e.g. D55013. Reviewers: JDevlieghere, aprantl, xiaobai Reviewed By: aprantl, xiaobai Subscribers: mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D55320 llvm-svn: 350390
* [CMake] Aggregate options for LLDB in LLDBConfig.cmakeStefan Granitz2019-01-042-38/+34
| | | | | | | | | | | | | | Summary: In preparation for LLDB.framework changes, collect options for LLDB in LLDBConfig.cmake (used for both, standalone and in-tree builds of LLDB). Reviewers: JDevlieghere, aprantl, xiaobai Reviewed By: aprantl Subscribers: srhines, mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D55317 llvm-svn: 350389
* [CMake] Streamline code signing for debugserver #2Stefan Granitz2019-01-048-79/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Major fixes after D54476 (use Diff1 as base for comparison to see only recent changes): * In standalone builds target directory for debugserver must be LLDB's bin, not LLVM's bin * Default identity for code signing must not force-override LLVM_CODESIGNING_IDENTITY globally We have a lot of cases, make them explicit: * ID used for code signing (debugserver and in tests): ** `LLDB_CODESIGN_IDENTITY` if set explicitly, or otherwise ** `LLVM_CODESIGNING_IDENTITY` if set explicitly, or otherwise ** `lldb_codesign` as the default * On Darwin we have a debugserver target that: * On other systems, the debugserver target is not defined, which is equivalent to **[3A]** Common configurations on Darwin: * **[1A]** `cmake -GNinja ../llvm` builds debugserver from source and signs with `lldb_codesign`, no code signing for other binaries (prints status: //lldb debugserver: /path/to/bin/debugserver//) * **[1A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_CODESIGN_IDENTITY=lldb_codesign ../llvm` builds debugserver from source and signs with `lldb_codesign`, ad-hoc code signing for other binaries (prints status: //lldb debugserver: /path/to/bin/debugserver//) * **[2A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_USE_SYSTEM_DEBUGSERVER=ON ../llvm` copies debugserver from system, ad-hoc code signing for other binaries (prints status: //Copy system debugserver from: /path/to/system/debugserver//) * **[2B]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- ../llvm` same, but prints additional warning: //Cannot code sign debugserver with identity '-'. Will fall back to system's debugserver. Pass -DLLDB_CODESIGN_IDENTITY=lldb_codesign to override the LLVM value for debugserver.// * **[3A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_NO_DEBUGSERVER=ON ../llvm` debugserver not available (prints status: //lldb debugserver will not be available)// Reviewers: JDevlieghere, beanz, davide, vsk, aprantl, labath Reviewed By: JDevlieghere, labath Subscribers: mgorny, #lldb, lldb-commits Differential Revision: https://reviews.llvm.org/D55013 llvm-svn: 350388
* Symtab: Remove one copy of symbol size computation codePavel Labath2019-01-041-26/+2
| | | | | | | | | | | | | | | Summary: The implementation in CalculateSymbolSizes has been made redundant in D19004, as this patch added another copy of size computation code into InitAddressIndexes (which is called by CalculateSymbolSizes). Reviewers: clayborg, jasonmolenda, tberghammer Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D56132 llvm-svn: 350384
* RangeMap.h: merge RangeDataArray and RangeDataVectorPavel Labath2019-01-045-277/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The main difference between the classes was supposed to be the fact that one is backed by llvm::SmallVector, and the other by std::vector. However, over the years, they have accumulated various other differences too. This essentially removes the std::vector version, as that is pretty much identical to llvm::SmallVector<T, 0>, and combines their interfaces. It does not attempt to do a more significant refactoring, even though there is still a lot of duplication in this file, as it is hard to tell which quirk of some API is depended on by somebody (and, a previous, more ambitious attempt at this in D16769 has failed). I also add some tests, including one which demonstrates one of the quirks/bugs of the API I have noticed in the process. Reviewers: clayborg, teemperor, tberghammer Subscribers: mgorny, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D56170 llvm-svn: 350380
* [lldb] Fix ObjCExceptionRecognizedStackFrame to populate the list of ↵Kuba Mracek2019-01-042-0/+14
| | | | | | | | recognized arguments Differential Revision: https://reviews.llvm.org/D56027 llvm-svn: 350376
* [lldb] Check SafeToCallFunctions before calling functions in ↵Kuba Mracek2019-01-041-0/+3
| | | | | | | | GetExceptionObjectForThread Differential Revision: https://reviews.llvm.org/D56115 llvm-svn: 350375
* symbols.enable-external-lookup=false on all hosts (not just OSX)Jan Kratochvil2019-01-036-24/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is already in use: lit/lit-lldb-init: settings set symbols.enable-external-lookup false packages/Python/lldbsuite/test/lldbtest.py: self.runCmd('settings set symbols.enable-external-lookup false') But those are not in effect during MI part of the testsuite. Another problem is that symbols.enable-external-lookup (read by GetEnableExternalLookup) has been currently read only by LocateMacOSXFilesUsingDebugSymbols and therefore it had no effect on Linux. On Red Hat platforms (Fedoras, RHEL-7) there is DWZ in use and so MiSyntaxTestCase-test_lldbmi_output_grammar FAILs due to: AssertionError: error: inconsistent pattern ''^.+?\n'' for state 0x5f (matched string: warning: (x86_64) /lib64/libstdc++.so.6 unsupported DW_FORM values: 0x1f20 0x1f21 It is the only testcase with this error. It happens due to: (lldb) target create "/lib64/libstdc++.so.6" Current executable set to '/lib64/libstdc++.so.6' (x86_64). (lldb) b main warning: (x86_64) /lib64/libstdc++.so.6 unsupported DW_FORM values: 0x1f20 0x1f21 Breakpoint 1: no locations (pending). WARNING: Unable to resolve breakpoint to any actual locations. which happens only with gcc-base-debuginfo rpm installed (similarly for other packages). It should also speed up the testsuite as it no longer needs to read /usr/lib/debug symbols which have no effect (and should not have any effect) on the testsuite results. Differential Revision: https://reviews.llvm.org/D55859 llvm-svn: 350368
* TestQueues: Move the synchronisation code into the binary itself.Adrian Prantl2019-01-032-43/+14
| | | | | | Thanks to Pavel Labath for the suggestion! llvm-svn: 350360
* PECOFF: Remove tabs introduced accidentally in r350094Pavel Labath2019-01-031-61/+61
| | | | llvm-svn: 350298
* Fix some -Wreorder warnings introduced in r350274Pavel Labath2019-01-031-5/+6
| | | | llvm-svn: 350294
* Simplify ObjectFile::GetArchitecturePavel Labath2019-01-0325-109/+83
| | | | | | | | | | | | | | | | Summary: instead of returning the architecture through by-ref argument and a boolean value indicating success, we can just return the ArchSpec directly. Since the ArchSpec already has an invalid state, it can be used to denote the failure without the additional bool. Reviewers: clayborg, zturner, espindola Subscribers: emaste, arichardson, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D56129 llvm-svn: 350291
* Check that a pointer is valid and fix a log message on WindowsAaron Smith2019-01-031-2/+2
| | | | llvm-svn: 350281
* Rearrange bitfield to allow for more space in file_idx.Adrian Prantl2019-01-021-20/+24
| | | | | | | | | | | | This is an alternate patch for the bug reported in https://bugs.llvm.org/show_bug.cgi?id=39816 ("lldb doesn't show a file of line entry for big project"). This limits the number of lines in a source file to 32M, which I think is reasonable even for preprocessed source inputs. Differential Revision: https://reviews.llvm.org/D56218 llvm-svn: 350274
* [Driver] Remove unused importsJonas Devlieghere2019-01-021-7/+0
| | | | | | Removes some unneeded includes from the driver. llvm-svn: 350267
* Add file-based synching to places missed in r350247.Adrian Prantl2019-01-022-10/+15
| | | | llvm-svn: 350266
* Remove Range.* from Xcode projectAdrian Prantl2019-01-021-6/+0
| | | | llvm-svn: 350264
* Try to fix Green Dragon bot.Zachary Turner2019-01-021-2/+2
| | | | | | | It doesn't like this std::tie() for some reason, hopefuly this fixes it. llvm-svn: 350262
* Add file-based synchronization to flaky testAdrian Prantl2019-01-022-3/+38
| | | | | | | | | | TestQueues is failing randomly on green dragon and I suspect it is because the enqueued threads haven't executed by the time we expect them. This patch adds file-based synchronization to the queues. Differential Revision: https://reviews.llvm.org/D56208 llvm-svn: 350247
* Use map::insert instead of try_emplace.Zachary Turner2019-01-021-1/+1
| | | | | | try_emplace is C++17. llvm-svn: 350244
* [NativePDB] Implement ParseDeclsForContext.Zachary Turner2019-01-027-51/+443
| | | | | | | | | | | This is a first step towards getting lldb-test symbols working with the native plugin. There is a remaining issue, which is that the plugin expects that ParseDeclsForContext will also create lldb symbols rather than just the decls, but the native pdb plugin doesn't currently do this. This will be addressed in a followup patch. llvm-svn: 350243
* [NativePDB] Update function-types-classes test to check VarDecls.Zachary Turner2019-01-021-3/+13
| | | | | | | | A Previous patch added support for creating VarDecls for global variables. This patch updates this test to be more strict and actually check these, not just the types. llvm-svn: 350242
* [NativePDB] Fix setting breakpoint by file and line.Zachary Turner2019-01-027-18/+70
| | | | | | | | | | | | | | | | | | | There were several problems preventing this from working. The first is that when the PDB had an absolute path to the main source file, we would construct an invalid path by prepending the compilation directory to it anyway. So we needed to check if the path is already absolute first. Second, LLDB assumes that the zero'th item in the support file list is the main compilation unit. We were respecting this requirement, but LLDB *also* requires that file to appear somewhere in the list starting from index 1 as well. So the main compilation file should appear in the support file list twice. And when parsing a line table, it expects the LineEntry records to be constructed using the 1-based index. With these two fixes we can now set breakpoints by file and line using the native PDB reader. llvm-svn: 350240
* NativeProcessProtocolTest: fix -Winconsistent-missing-override warningPavel Labath2019-01-021-4/+7
| | | | | | | | The warning comes from the fact that the MOCK_METHOD macros don't use the override keyword internally. This makes us not use it in the manually overriden methods either, to be consistent. llvm-svn: 350209
* [DWARFUnit] Remove commented out code. NFCI.Davide Italiano2018-12-311-7/+0
| | | | llvm-svn: 350177
* [CommandInterpreter] Simplify PreprocessCommand. (NFCI)Jonas Devlieghere2018-12-301-117/+127
| | | | | | | | Simplify some code in PreprocessCommand. This change improves consistency, reduces the indentation and makes the code easier to follow overall. llvm-svn: 350166
* [Type] Simplify operator!=. NFC.Davide Italiano2018-12-301-2/+1
| | | | llvm-svn: 350164
* [TypeName] Simplify operator!=. NFCI.Davide Italiano2018-12-301-5/+1
| | | | llvm-svn: 350163
* [test] Remove flakiness decorator from TestObjCDynamicSBTypeJonas Devlieghere2018-12-301-2/+0
| | | | | | The quoted bug report (llvm.org/PR20270) was closed in 2014. llvm-svn: 350160
* [RegisterValue] Rewrite operator!= in terms of operator==. NFCI.Davide Italiano2018-12-291-26/+1
| | | | llvm-svn: 350149
* [CompilerType] Simplify operator!=. NFCI.Davide Italiano2018-12-291-2/+1
| | | | llvm-svn: 350148
* [CompilerType] Remove dead code. NFCI.Davide Italiano2018-12-291-10/+0
| | | | llvm-svn: 350147
* [SymbolContext] Rewrite operator== to be more concise.Davide Italiano2018-12-291-6/+1
| | | | | | And probably, less error prone. NFCI. llvm-svn: 350146
* Fix signed-unsigned comparisons in MinidumpParserTestPavel Labath2018-12-281-5/+5
| | | | llvm-svn: 350122
* Remove unused variable from ClangASTContextPavel Labath2018-12-281-3/+2
| | | | llvm-svn: 350121
* Reduce indentation in ObjectFilePECOFF::CreateSections via an early returnPavel Labath2018-12-271-133/+133
| | | | llvm-svn: 350094
* Fix tests for python 3.7Pavel Labath2018-12-271-1/+2
| | | | | | | | python 3.7 removes re._pattern_type. Fix the one place where we were depending on the type of regular expressions to compute the type dynamically. llvm-svn: 350093
* Fix assertion failure in NativeProcessProtocolTestPavel Labath2018-12-271-1/+2
| | | | | | | | | The assertion fired (with a debug visual studio STL) because we tried to dereference the end of a vector (although it was only to take its address again and form an end iterator). Rewrite this logic to avoid the questionable code. llvm-svn: 350091
* Fix "default argument for lambda parameter" (-Wpedantic) warningPavel Labath2018-12-271-2/+2
| | | | llvm-svn: 350089
* Delete lldb_utility::RangePavel Labath2018-12-274-138/+0
| | | | | | | This class is unused, and there is already a lldb_private::Range (defined in lldb/Core/RangeMap.h), which has similar functionality. llvm-svn: 350088
* lldb-test ir-memory-map: Use IntervalMap::containsPavel Labath2018-12-271-25/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Simplify the code by using the contains implementation in IntervalMap. There is a slight change of behavior here: We now treat an allocation of size 0, as if it was size 1. This guarantees that the returned addresses will be unique, whereas previously we would allow the allocation function to return the same zero-sized region multiple times, as long as it is not null, and not in the middle of an existing interval (but the situation when we were placing an larger interval over a zero-sized one was not detected). I think this behavior makes more sense, as that is pretty much the same guarantee as offered by malloc (except that is permitted to also return nullptr). Reviewers: vsk Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D55761 llvm-svn: 350087
* DWARF: Fix a bug in array size computationPavel Labath2018-12-273-13/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: r346165 introduced a bug, where we would fail to parse the size of an array if that size happened to match an existing die offset. The logic was: if (DWARFDIE count = die.GetReferencedDie(DW_AT_count)) num_elements = compute_vla_size(count); else num_elements = die.GetUsigned(DW_AT_count); // a fixed-size array The problem with this logic was that GetReferencedDie did not take the form class of the attribute into account, and would happily return a die reference for any form, if its value happened to match some die. As this behavior is inconsistent with how llvm's DWARFFormValue class operates, I chose to fix the problem by making our version of this class match the llvm behavior. For this to work, I had to add an explicit form class check to the .apple_XXX tables parsing code, because they do (incorrectly?) use data forms as die references. Reviewers: aprantl, clayborg Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D55991 llvm-svn: 350086
* [cmake] Suppress 'warning C4201: nonstandard extension used: nameless ↵Stella Stamenova2018-12-211-0/+1
| | | | | | | | struct/union' on Windows This warning comes up in the ObjC language plugin because of the use of nameless structs. This change suppresses the warning. llvm-svn: 349977
* [NFC] Replace `compare` with (in)equality operator where applicable.Jonas Devlieghere2018-12-2115-49/+42
| | | | | | | | Using compare is verbose, bug prone and potentially inefficient (because of early termination). Replace relevant call sites with the (in)equality operator. llvm-svn: 349972
* [Scalar] Simplify as Jonas suggested. NFCI.Davide Italiano2018-12-211-4/+5
| | | | llvm-svn: 349971
* [Scalar] Implement operator!= using operator==.Davide Italiano2018-12-212-31/+28
| | | | | | | | | | Summary: Adding some test coverage while I'm around. Reviewers: JDevlieghere, aprantl, zturner, clayborg, jingham Differential Revision: https://reviews.llvm.org/D56017 llvm-svn: 349970
* [ExpressionParser] Reserve size before copying over argsJonas Devlieghere2018-12-211-1/+2
| | | | | | | We already know the final size here so we might as well reserve it so we don't have to re-allocate during the loop. llvm-svn: 349967
OpenPOWER on IntegriCloud