summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Embed swig version into lldb.py in a different wayPavel Labath2019-02-153-22/+44
| | | | | | | | | | | | | | | | | | | | | | | Summary: Instead of doing string chopping on the resulting python file, get swig to output the version for us. The two things which make slightly non-trivial are: - in order to get swig to expand SWIG_VERSION for us, we cannot use %pythoncode directly, but we have to go through an intermediate macro. - SWIG_VERSION is a hex number, but it's components are supposed to be interpreted decimally, so there is a bit of integer magic needed to get the right number to come out. I've tested that this approach works both with the latest (3.0.12) and oldest (1.3.40) supported swig. Reviewers: zturner, jingham, serge-sans-paille Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D58172 llvm-svn: 354104
* Remove redundant semicolon after namespace-closing '}'Pavel Labath2019-02-151-1/+1
| | | | llvm-svn: 354103
* Fix for build bot problem from last changeAaron Smith2019-02-151-3/+3
| | | | llvm-svn: 354100
* Implement GetLoadAddress for the Windows process pluginAaron Smith2019-02-155-41/+111
| | | | | | | | | | | | | | | | Summary: When a process is loaded, update its sections with the load address to resolve any created breakpoints. For the remote debugging case, the debugged process is launched remotely so GetLoadAddress is intended to pass the load address from remote to LLDB (client). Reviewers: zturner, llvm-commits, clayborg, labath Reviewed By: labath Subscribers: mgorny, sas, Hui, clayborg, labath, lldb-commits Differential Revision: https://reviews.llvm.org/D56237 llvm-svn: 354099
* [lldb] [MainLoop] Remove redundant termination clause (NFCI)Michal Gorny2019-02-141-3/+0
| | | | | | | | | | | | | Remove the redundant termination clause from within the loop. Since the check is done at the end of the loop, it's entirely redundant to the 'while' condition. If termination was requested, the latter will become false and the 'while' loop will terminate, resulting in the 'return' statement below the loop being executed (which is equivalent to the one used inside 'if'). Differential Revision: https://reviews.llvm.org/D58227 llvm-svn: 354050
* Add explicit language specifier to test.Adrian Prantl2019-02-141-1/+1
| | | | llvm-svn: 354048
* [dotest] Fix compiler version number comparisonFrederic Riss2019-02-141-4/+5
| | | | | | | | | | | | | | | dotest's version comparision function is just a lexicographical compare of the version strings. This is obviously wrong. This patch implements the comparison using distutils.version.LooseVersion as suggested by Zachary. Reviewers: zturner, labath, serge-sans-paille Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D58219 llvm-svn: 354047
* [ExpressionParser] Reuse the FileManager from the compiler instance.Jonas Devlieghere2019-02-142-13/+5
| | | | | | | | | | | | I was looking at the ClangExpressionParser and noticed that we have a FileManager owned by the expression parser and later ask the compiler instance to create a new FileManager, owned by the clang CI. Looking at the code I don't see a good reason for having two instances. This patch removes the one owned by LLDB. Differential revision: https://reviews.llvm.org/D58222 llvm-svn: 354041
* Don't source local .lldbinit in the test suiteRaphael Isemann2019-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: As suggested by Pavel, we shouldn't let our tests parse the local .lldbinit to prevent random test failures due to changed settings. Fixes Minidump/Windows/Sigsegv/sigsegv.test (and probably others too). Reviewers: labath, serge-sans-paille Reviewed By: labath Subscribers: abidh, lldb-commits, zturner Tags: #lldb Differential Revision: https://reviews.llvm.org/D58235 llvm-svn: 354038
* [CMake] Fix RPATH handling for LLDB.frameworkStefan Granitz2019-02-142-10/+13
| | | | | | | | | | | | | | | | | Summary: Generator expressions are not supported in the `BUILD_RPATH` target property. `BUILD_RPATH` is only supported in 3.8+ https://cliutils.gitlab.io/modern-cmake/chapters/intro/newcmake.html `LLDB_FRAMEWORK_INSTALL_DIR` should not overwrite, but rather add an install RPATH (and it should be the first) Reviewers: xiaobai, lanza Reviewed By: xiaobai Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D57989 llvm-svn: 354037
* Move UnwindTable from ObjectFile to ModulePavel Labath2019-02-148-52/+50
| | | | | | | | | | | | | | | Summary: This is a preparatory step to enable adding extra unwind strategies by symbol file plugins. This has been discussed on the lldb-dev mailing list: <http://lists.llvm.org/pipermail/lldb-dev/2019-February/014703.html>. Reviewers: jasonmolenda, clayborg, espindola Subscribers: lemo, emaste, lldb-commits, arichardson Differential Revision: https://reviews.llvm.org/D58129 llvm-svn: 354033
* [lldb] [lldb-server] Catch and report errors from main loopMichal Gorny2019-02-141-1/+6
| | | | | | | | | | Catch the possible error from lldb-gdbserver's main loop, and report it verbosely. Currently, if the loop fails the server exits normally, rendering the problem indistinguishable from regular termination. Differential Revision: https://reviews.llvm.org/D58228 llvm-svn: 354030
* [lldb] [MainLoop] Report errno for failed kevent()Michal Gorny2019-02-141-1/+1
| | | | | | | | | | Modify the kevent() error reporting to use errno rather than returning the return value. At least on FreeBSD and NetBSD, kevent() always returns -1 in case of error, and the actual error is returned via errno. Differential Revision: https://reviews.llvm.org/D58229 llvm-svn: 354029
* [gdb-remote] Sanity check platform pointerAaron Smith2019-02-141-2/+5
| | | | llvm-svn: 354012
* [lldb-server] Add remote platform capabilities for WindowsAaron Smith2019-02-146-275/+217
| | | | | | | | | | | | | | | | | | Summary: Implement a few routines for Windows to support some basic process interaction and file system operations. Reviewers: zturner, llvm-commits, labath, jingham Reviewed By: labath Subscribers: emaste, jdoerfert, Hui, labath, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D56232 llvm-svn: 354010
* Add missing includeAdrian Prantl2019-02-131-0/+1
| | | | llvm-svn: 353979
* [CMake] Make lldb-test-deps a dependency of check-lldbJonas Devlieghere2019-02-132-1/+4
| | | | | | | We have a custom target for lldb's test dependencies but it must have gotten lost in one of the recent CMake refactorings. llvm-svn: 353978
* Add missing includeAdrian Prantl2019-02-131-0/+1
| | | | llvm-svn: 353971
* Deserialize Clang module search path from DWARFAdrian Prantl2019-02-1326-108/+219
| | | | | | | | | | | | This patch properly extracts the full submodule path as well as its search paths from DWARF import decls and passes it on to the ClangModulesDeclVendor. rdar://problem/47970144 Differential Revision: https://reviews.llvm.org/D58090 llvm-svn: 353961
* Revert "Fix one more string/bytes issue in lldb-server tests"Pavel Labath2019-02-131-1/+1
| | | | | | | | | | | | | It looks like I was too hasty to submit the previous patch. It does fix some tests on python3, but it also breaks one tests with python2. This happens because the gdb-remote protocol can sometimes (but not very often) contain binary data, and attempting to parse this as utf8 characters fails. This reverts commit r353944. llvm-svn: 353945
* Fix one more string/bytes issue in lldb-server testsPavel Labath2019-02-131-1/+1
| | | | | | This fixes about a dozen tests with python3. llvm-svn: 353944
* [lldb] [cmake] Use install directories for LLVM_* variablesMichal Gorny2019-02-131-3/+3
| | | | | | | | | | | | | Restore the previous behavior of using install directories for LLVM_MAIN_INCLUDE_DIR, LLVM_LIBRARY_DIR and LLVM_BINARY_DIR. The update from llvm-config to CMake has changed the values of those values to use LLVM_BUILD_* which is plain wrong and breaks stand-alone builds. Instead, use the CMake counterparts of the values returned by llvm-config. Differential Revision: https://reviews.llvm.org/D57995 llvm-svn: 353925
* ObjectFilePECOFF: Create a "container" section spanning the entire module imagePavel Labath2019-02-136-32/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is coming from the discussion in D55356 (the most interesting part happened on the mailing list, so it isn't reflected on the review page). In short the issue is that lldb assumes that all bytes of a module image in memory will be backed by a "section". This isn't the case for PECOFF files because the initial bytes of the module image will contain the file header, which does not correspond to any normal section in the file. In particular, this means it is not possible to implement GetBaseAddress function for PECOFF files, because that's supposed point to the first byte of that header. If my (limited) understanding of how PECOFF files work is correct, then the OS is expecded to load the entire module into one continuous chunk of memory. The address of that chunk (+/- ASLR) is given by the "image base" field in the COFF header, and it's size by "image size". All of the COFF sections are then loaded into this range. If that's true, then we can model this behavior in lldb by creating a "container" section to represent the entire module image, and then place other sections inside that. This would make be consistent with how MachO and ELF files are modelled (except that those can have multiple top-level containers as they can be loaded into multiple discontinuous chunks of memory). This change required a small number of fixups in the PDB plugins, which assumed a certain order of sections within the object file (which obivously changes now). I fix this by changing the lookup code to use section IDs (which are unchanged) instead of indexes. This has the nice benefit of removing spurious -1s in the plugins as the section IDs in the pdbs match the 1-based section IDs in the COFF plugin. Besides making the implementation of GetBaseAddress possible, this also improves the lookup of addresses in the gaps between the object file sections, which will now be correctly resolved as belonging to the object file. Reviewers: zturner, amccarth, stella.stamenova, clayborg, lemo Reviewed By: clayborg, lemo Subscribers: JDevlieghere, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D56537 llvm-svn: 353916
* Replace 'ap' with 'up' suffix in variable names. (NFC)Jonas Devlieghere2019-02-13190-1959/+1963
| | | | | | | | | | | | | | | | | The `ap` suffix is a remnant of lldb's former use of auto pointers, before they got deprecated. Although all their uses were replaced by unique pointers, some variables still carried the suffix. In r353795 I removed another auto_ptr remnant, namely redundant calls to ::get for unique_pointers. Jim justly noted that this is a good opportunity to clean up the variable names as well. I went over all the changes to ensure my find-and-replace didn't have any undesired side-effects. I hope I didn't miss any, but if you end up at this commit doing a git blame on a weirdly named variable, please know that the change was unintentional. llvm-svn: 353912
* [Reproducers] Integrate FileProvider with clangJonas Devlieghere2019-02-135-3/+79
| | | | | | | | | | This patch hooks up clang and lldb's reproducers functionality. It ensures that when capturing a reproducer, headers and modules imported through the expression parser are collected. Differential revision: https://reviews.llvm.org/D58076 llvm-svn: 353906
* [testsuite] Add a comment explaining what this test does.Davide Italiano2019-02-121-0/+1
| | | | llvm-svn: 353896
* [testsuite] Convert TestSingleQuote to lit.Davide Italiano2019-02-125-85/+8
| | | | | | Nothing crazy, this is pretty mechanical. llvm-svn: 353894
* [lldb-instr] Pass PCHContainerOperations to ClangToolJonas Devlieghere2019-02-122-1/+8
| | | | | | | | | | | | On a local modules build this would cause an error. > fatal error: no handler registered for module format 'obj' > LLVM ERROR: unknown module format Interestingly enough, this didn't trigger on the GreenDragon CMake bot, which is configured with modules. llvm-svn: 353869
* [lldb] [unittest] Avoid mixing '127.0.0.1' and 'localhost'Michal Gorny2019-02-122-3/+3
| | | | | | | | | | | | | | | | | | | Fix the tests not to use '127.0.0.1' and 'localhost' interchangeably. More specifically, since tests bind specifically to 127.0.0.1, connect to that address as well; using 'localhost' can resolve to IPv6 address which can cause issues -- for example, if the matching port happens to be used by some other process, the tests hang forever waiting for the client to connect. While technically the case of randomly selected IPv4 port being taken on IPv6 loopback is not very likely, NetBSD happens to be suffering from some weird kernel issue where connection to that port succeeds nevertheless. Until we can really figure out what goes wrong there, this saves us from the tests hanging randomly. Differential Revision: https://reviews.llvm.org/D58131 llvm-svn: 353868
* Fix Xcode project for RemoteAwarePlatform files.Greg Clayton2019-02-121-7/+10
| | | | llvm-svn: 353856
* Have Stream::PutCStringAsRawHex8 take llvm::StringRefPavel Labath2019-02-129-52/+50
| | | | | | | | | This enables the function to be called with a StringRef without jumping through any hoops. I rename the function to "PutStringAsRawHex8" to honor the extended interface. I also remove ".c_str()" from any calls to this function I could find. llvm-svn: 353841
* Extract common PlatformPOSIX/Windows code into a separate classPavel Labath2019-02-127-359/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The two classes contained a lot of duplicated code, but there wasn't a good place to factor it to. It couldn't be the base Platform class, since we also have platforms which are only remote (such as PlatformGDBRemoteServer), and so it did not make sense for those to have an m_remote_platform member. This patch creates a new class, RemoteAwarePlatform, which can serve as a base class for platforms which can both serve as a host, and forward actions to a remote system. It is motivated partly by D56232 (which was about to add a bunch of additional duplicated methods), and partly by my own need to modify a function which happens to be implemented in both places identically. The patch moves the methods which are trivially identical in the two classes into the common base class, there were one or two more methods which could probably be merged into one, but this wasn't completely trivial, so I did not attempt to do that now. Reviewers: jingham, zturner, clayborg, asmith Subscribers: emaste, mgorny, Hui, lldb-commits Differential Revision: https://reviews.llvm.org/D58052 llvm-svn: 353812
* [NativePDB] Process virtual bases in the correct orderAleksandr Urakov2019-02-124-12/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch makes virtual bases to be added in the correct order to the bases list. It is important because `VTableContext` (`MicrosoftVTableContext` in our case) uses then the order of virtual bases in the list to restore the virtual table indexes. These indexes are used then to resolve the layout of the virtual bases. We haven't enough information about offsets of virtual bases regarding to the object (moreover, in a common case we can't rely on such information, see the example here: https://reviews.llvm.org/D53506#1272306 ), but there should be enough information to restore the layout of the virtual bases from the indexes in runtime. After D53506 this information is used whenever possible, so there should be no problems with virtual bases' fields reading. Reviewers: zturner, rnk, stella.stamenova Subscribers: abidh, teemperor, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D56904 llvm-svn: 353806
* Remove redundant ::get() for smart pointer. (NFC)Jonas Devlieghere2019-02-1252-191/+187
| | | | | | | | This commit removes redundant calls to smart pointer’s ::get() method. https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-smartptr-get.html llvm-svn: 353795
* [Thread] Update the correct variableJonas Devlieghere2019-02-121-4/+2
| | | | | | | The new shared pointer was assigning to the temporary instead of the member (m_curr_frames_sp). llvm-svn: 353783
* Define _ENABLE_EXTENDED_ALIGNED_STORAGE on Windows.Jonas Devlieghere2019-02-122-8/+18
| | | | | | | | | | Apparently there are multiple places where MSVC complains about instantiations with extended aligment. I think it's better to define `_ENABLE_EXTENDED_ALIGNED_STORAGE` as suggested by the error message. I don't have access to a Windows machine so this is all speculative. llvm-svn: 353778
* [ObjectFileMachO] Revert std::make_sharedJonas Devlieghere2019-02-111-14/+8
| | | | | | | This caused a rather interesting error message on MSVC: error C2338 and I'm not sure how to properly fix it. llvm-svn: 353769
* Some cleanup after moving to std::make_sharedJonas Devlieghere2019-02-112-21/+13
| | | | | | Addresses Tatyana Krasnukha's feedback from D57990. llvm-svn: 353768
* Use std::make_shared in LLDB (NFC)Jonas Devlieghere2019-02-1198-443/+645
| | | | | | | | | | | Unlike std::make_unique, which is only available since C++14, std::make_shared is available since C++11. Not only is std::make_shared a lot more readable compared to ::reset(new), it also performs a single heap allocation for the object and control block. Differential revision: https://reviews.llvm.org/D57990 llvm-svn: 353764
* Fixed function name in log statementRaphael Isemann2019-02-111-2/+2
| | | | llvm-svn: 353753
* Use of `@return` is not appropriate for a function with a void return type.Jonas Devlieghere2019-02-111-2/+0
| | | | | | | | The comment for this declaration causes a warning with -Wdocumentation: Invalid @return in documentation comment SetCollectingStats() in SBTarget.h. llvm-svn: 353752
* Update SymbolVendorMacOSX for new GetUUID interfaceJonas Devlieghere2019-02-111-5/+4
| | | | | | The interface changed in r353714. llvm-svn: 353721
* Simplify ObjectFile::GetUUIDPavel Labath2019-02-1113-71/+55
| | | | | | | | | instead of returning the UUID through by-ref argument and a boolean value indicating success, we can just return it directly. Since the UUID class already has an invalid state, it can be used to denote the failure without the additional bool. llvm-svn: 353714
* [build.py] Add `-fms-compatibility-version=19` to `build.py`Aleksandr Urakov2019-02-111-0/+1
| | | | | | | | | | | | | | | | | | | Summary: `clang-cl` can't compile tests containing `char16_t` and `char32_t` types without the MSVC compatibility option passed. This patch adds the option to the `clang-cl` call in the `build.py` script by default. Reviewers: zturner, labath, stella.stamenova, serge-sans-paille Reviewed By: labath Subscribers: lldb-commits, leonid.mashinskiy Tags: #lldb Differential Revision: https://reviews.llvm.org/D57809 llvm-svn: 353709
* Breakpad: auto-detect path style of file entriesPavel Labath2019-02-1111-19/+57
| | | | | | | | | | | | | | | | | | | | | | | Summary: This adds support for auto-detection of path style to SymbolFileBreakpad (similar to how r351328 did the same for DWARF). We guess each file entry separately, as we have no idea which file came from which compile units (and different compile units can have different path styles). The breakpad generates should have already converted the paths to absolute ones, so this guess should be reasonable accurate, but as always with these kinds of things, it is hard to give guarantees about anything. In an attempt to bring some unity to the path guessing logic, I move the guessing logic from inside SymbolFileDWARF into the FileSpec class and have both symbol files use it to implent their desired behavior. Reviewers: clayborg, lemo, JDevlieghere Subscribers: aprantl, markmentovai, lldb-commits Differential Revision: https://reviews.llvm.org/D57895 llvm-svn: 353702
* [lldb] [lit] Fix finding lld-link when it is not in 'compiler dir'Michal Gorny2019-02-111-7/+5
| | | | | | | | | | | Fix the build helper to find lld-link via PATH lookup, rather than making a fragile assumption that it will be present in the 'compiler directory'. This fixes tests on Gentoo where clang and lld are installed in different directories. Differential Revision: https://reviews.llvm.org/D58001 llvm-svn: 353701
* [lldb] [test] Skip lldb-mi test if LLDB_DISABLE_PYTHON is usedMichal Gorny2019-02-113-1/+5
| | | | | | | | | | Skip running lldb-mi tests when Python support is disabled. This causes lldb-mi to unconditionally fail, and therefore all the relevant tests fail as well. Differential Revision: https://reviews.llvm.org/D58000 llvm-svn: 353700
* Revert "minidump: Add ability to attach (breakpad) symbol files to ↵Pavel Labath2019-02-115-116/+51
| | | | | | | | | | | placeholder modules" The commit has broken TestMiniDump.py on windows. Reverting while I investigate. This reverts r353677. llvm-svn: 353686
* [lldb] [lldb-instr] Add missing linkage to clang librariesMichal Gorny2019-02-111-0/+3
| | | | | | | | | Fix build errors against shared clang by adding all the libraries used in the code. Differential Revision: https://reviews.llvm.org/D57999 llvm-svn: 353680
* minidump: Add ability to attach (breakpad) symbol files to placeholder modulesPavel Labath2019-02-115-51/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The reason this wasn't working was that ProcessMinidump was creating odd object-file-less modules, and SymbolFileBreakpad required the module to have an associated object file because it needed to get its base address. This fixes that by introducing a PlaceholderObjectFile to serve as a dummy object file. The general idea for this is taken from D55142, but I've reworked it a bit to avoid the need for the PlaceholderModule class. Now that we have an object file, our modules are sufficiently similar to regular modules that we can use the regular Module class almost out of the box -- the only thing I needed to tweak was the Module::CreateModuleFromObjectFile functon to set the module's FileSpec in addition to it's architecture. This wasn't needed for ObjectFileJIT (the other user of CreateModuleFromObjectFile), but it shouldn't hurt it either, and the change seems like a straightforward extension of this function. Reviewers: clayborg, lemo, amccarth Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D57751 llvm-svn: 353677
OpenPOWER on IntegriCloud