summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* [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
* [lldb] [MainLoop] Initialize empty sigset_t correctlyMichal Gorny2019-02-111-4/+6
| | | | | | | | | | | | | | Fix MainLoop::RunImpl::get_sigmask() to correctly return empty sigset_t when SIGNAL_POLLING_UNSUPPORTED is true. On NetBSD (and probably on some other platforms), integers are not implicitly convertible to sigset_t, so 'return 0' is erraneous. Instead, sigset_t should be reset through sigemptyset(). While at it, move common parts out of the #ifdef. Differential Revision: https://reviews.llvm.org/D57959 llvm-svn: 353675
* Update files to the new header that were incorrectly landed with the oldChandler Carruth2019-02-112-8/+6
| | | | | | one. llvm-svn: 353663
* Fix x86 return pattern detectionRaphael Isemann2019-02-102-2/+172
| | | | | | | | | | | | | | | | Summary: Replace 0xc9 (LEAVE) with 0xcb (RETF) in ret_pattern_p(). Also put 0xc3 first, since it is the most common form and will match first. Reviewers: jasonmolenda Reviewed By: jasonmolenda Subscribers: labath, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D57928 llvm-svn: 353643
* lldb: Fix compilation on OpenBSDRaphael Isemann2019-02-101-2/+1
| | | | | | | | | | | | | | | | Summary: Update the OpenBSD Host.cpp for the new SetFile() function signature. Fixes compiling lldb on OpenBSD. Reviewers: krytarowski Reviewed By: krytarowski Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D57907 llvm-svn: 353642
* Tiny fix spotted by static analyzer; GetPath() returns a std::string,Jason Molenda2019-02-081-2/+2
| | | | | | | we get a pointer to the c-string rep and then the temporary object is destructed and we still refer to the c-string after that. llvm-svn: 353581
* [opaque pointer types] Update calls to CreateCall to pass the functionJames Y Knight2019-02-084-29/+29
| | | | | | type in lldb and polly. llvm-svn: 353549
* [lldb] [unittests] Disable MainLoopTest::DetectsEOF on NetBSDMichal Gorny2019-02-081-0/+5
| | | | | | | | | | The NetBSD kernel currently does not support detecting closed slave pty via kevent on master pty. This causes the test to hang forever. To avoid that, disable the test until the kernel is fixed. Differential Revision: https://reviews.llvm.org/D57912 llvm-svn: 353545
* [NFC] Fix license headers after r352845Aleksandr Urakov2019-02-085-20/+15
| | | | llvm-svn: 353503
* Removing some unimplemented methods from the SB headersJim Ingham2019-02-085-13/+0
| | | | | | NFC llvm-svn: 353487
* [CommandInterpreter] Early return on error (NFC)Jonas Devlieghere2019-02-071-125/+121
| | | | | | | We save two levels of indentation by returning early if the given file doesn't exists or cannot be opened. llvm-svn: 353472
* Silence fallthrough warnings in debugserver.Adrian Prantl2019-02-072-2/+5
| | | | llvm-svn: 353468
* Add missing overridesAaron Smith2019-02-071-2/+2
| | | | llvm-svn: 353447
* [lldb-server] Improve support on WindowsAaron Smith2019-02-075-37/+38
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit contains the following changes: - Rewrite vfile close/read/write packet handlers with portable routines from lldb. This removes #if(s) and allows the handlers to work on Windows. - Fix a bug in File::Write. This is intended to write data at an offset to a file but actually writes at the current position of the file. - Add a default boolean argument 'should_close_fd' to FileSystem::Open to let the user decide whether to close the fd or not. Reviewers: zturner, llvm-commits, labath Reviewed By: zturner Subscribers: Hui, labath, abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D56231 llvm-svn: 353446
* [lldb-instr] Make lldb-instr a test dependencyJonas Devlieghere2019-02-071-0/+4
| | | | llvm-svn: 353444
* [gdb-remote] Use lldb's portable Host::GetEnvironment() instead of getenvAaron Smith2019-02-074-46/+53
| | | | | | | | | | | | Reviewers: zturner, llvm-commits, labath, serge-sans-paille Reviewed By: labath Subscribers: Hui, labath, lldb-commits Differential Revision: https://reviews.llvm.org/D56230 llvm-svn: 353440
* Fix headers for files added in r353047Pavel Labath2019-02-073-12/+9
| | | | | | | I started working on that patch before the headers were updated. Since they were new files, I didn't get any conflicts during rebase. llvm-svn: 353429
* Fix signed/unsigned mismatches in ProcessInfoTest.cppPavel Labath2019-02-071-1/+1
| | | | llvm-svn: 353420
* Fix incorrect log messages in NativeProcessLinux (pr40588)Pavel Labath2019-02-071-4/+4
| | | | | | | | | | | The "signal" argument was removed from the MonitorCallback function, but not from the log statements within it. This wasn't noticed because the name "signal" suddenly started referring to the libc function with that name. This fixes that. llvm-svn: 353419
* Breakpad: temporarily XFAIL line-table testsPavel Labath2019-02-074-0/+8
| | | | | | | | | | | | The tests are failing on windows because the paths in the symbol file are parsed using the host path style. I'm working on a patch to have SymbolFileBreakpad auto-detect the correct path style (similar to dwarf r351328). I originally wanted to make this a part of the initial line-table patch, but then I simply forgot. llvm-svn: 353410
* use_lldb_suite.py: Fix potential infinite loopPavel Labath2019-02-071-3/+4
| | | | | | | | | | | | | | The loop searching for use_lldb_suite_root had a bug where if the marker file happened to be missing, it would enter an infinite loop. While this shouldn't happen in normal circumstances, it can happen accidentally, and debugging it is not very pleasant. The loop had an exit condition, but it was incorrent (os.path.dirname returning None). This will never happen as dirname will just return the same folder over and over again once it reaches the root folder. This fixes the exit condition to account for that. llvm-svn: 353406
* Fix some warnings introduced in r353324 (ReproducerInstrumentation patch)Pavel Labath2019-02-073-8/+4
| | | | | | | | | | | | GetIndexForObjectImpl generated a bunch of "conversion casts away constness warnings". Change the function to use "const void *" (and static_cast, while I'm at it), to avoid this. Driver.cpp: unused variable "replay" (this was actually caused by a subsequent partial revert of this patch). I just finish the revert by removing the variable completely. llvm-svn: 353405
* SymbolFileBreakpad: Add line table supportPavel Labath2019-02-0713-55/+504
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch teaches SymbolFileBreakpad to parse the line information in breakpad files and present it to lldb. The trickiest question here was what kind of "compile units" to present to lldb, as there really isn't enough information in breakpad files to correctly reconstruct those. A couple of options were considered - have the entire file be one compile unit - have one compile unit for each FILE record - have one compile unit for each FUNC record The main drawback of the first approach is that all of the files would be considered "headers" by lldb, and so they wouldn't be searched if target.inline-breakpoint-strategy=never. The single compile unit would also be huge, and there isn't a good way to name it. The second approach will create mostly correct compile units for cpp files, but it will still be wrong for headers. However, the biggest drawback here seemed to be the fact that this can cause a compile unit to change mid-function (for example when a function from another file is inlined or another file is #included into a function). While I don't know of any specific thing that would break in this case, it does sound like a thing that we should avoid. In the end, we chose the third option, as it didn't seem to have any major disadvantages, though it was not ideal either. One disadvantage here is that this generates a large number of compile units, and there is still a question on how to name it. We chose to simply name it after the first line record in that function. This should be correct 99.99% of the time, though it can produce somewhat strange results if the very first line record comes from an #included file. Reviewers: clayborg, zturner, lemo, markmentovai Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D56595 llvm-svn: 353404
* Fix documentation formatting for ShellExpandArgumentsRaphael Isemann2019-02-072-6/+6
| | | | llvm-svn: 353381
* [lldb] Make frame recognizers vend synthesized eValueTypeVariableArgument valuesKuba Mracek2019-02-075-1/+49
| | | | llvm-svn: 353363
* [Driver] Don't try to replay reproducer in the driver.Jonas Devlieghere2019-02-071-9/+0
| | | | | | | Because the macros for the SBReproducers have not been committed yet, the driver should not attempt to replay a reproducer this way. llvm-svn: 353362
* Fix my mistake adding SBReproducer the Xcode projectJonas Devlieghere2019-02-071-4/+8
| | | | llvm-svn: 353361
* [testsuite] Convert a pexpect test to lit.Davide Italiano2019-02-064-64/+25
| | | | | | | | | | | | | | Summary: Reviewers: JDevlieghere, friss, zturner, labath, jingham, serge-sans-paille Subscribers: llvm-commits, lldb-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57840 llvm-svn: 353345
* Add SBReproducer to Xcode projectJonas Devlieghere2019-02-061-0/+6
| | | | llvm-svn: 353326
* [Reproducers] SBReproducer framework: Capture & ReplayJonas Devlieghere2019-02-068-10/+830
| | | | | | | | | | | | | This is part two of the reproducer instrumentation framework. It contains the code to capture and replay function calls. The main user of this framework will be the SB API layer. For all the details refer to the RFC on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2019-January/014530.html Differential revision: https://reviews.llvm.org/D56322 llvm-svn: 353324
* [x64] Process the B field of the REX prefix correctly for the PUSH and POPAleksandr Urakov2019-02-062-4/+58
| | | | | | | | | | | | | | | | | | | | | instructions Summary: This patch makes `x86AssemblyInspectionEngine` to process zero value of the `B` field of the `REX` prefix in a correct way for `PUSH` and `POP` instructions. MSVC sometimes emits `pushq %rbp` instruction as `0x40 0x55`, and it was not parsed correctly before. Reviewers: jasonmolenda, labath Reviewed By: jasonmolenda, labath Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D57745 llvm-svn: 353281
* Fix strlen() of unbound array undefined behaviorJan Kratochvil2019-02-062-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | LLDB testsuite fails when built by GCC8 on: LLDB :: SymbolFile/DWARF/find-basic-namespace.cpp This is because this code in LLDB codebase has undefined behavior: #include <algorithm> #include <string.h> // lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:1731 static struct section_64 { char sectname[16]; char segname[16]; } sect64 = { {'_','_','a','p','p','l','e','_','n','a','m','e','s','p','a','c'}, "__DWARF" }; int main() { return std::min<size_t>(strlen(sect64.sectname), sizeof(sect64.sectname)); } It has been discussed as a (false) bugreport to GCC: wrong-code: LLDB testcase fails: SymbolFile/DWARF/find-basic-namespace.cpp https://bugzilla.redhat.com/show_bug.cgi?id=1672436 Differential Revision: https://reviews.llvm.org/D57781 llvm-svn: 353280
* [Reproducers] lldb-instr: tool to generate instrumentation macros.Jonas Devlieghere2019-02-067-1/+337
| | | | | | | | | | | | | | | | | This patch introduces a new tool called 'lldb-instr'. It automates the workflow of inserting LLDB_RECORD and LLDB_REGSITER macros for instrumentation. Because the tool won't be part of the build process, I didn't want to over-complicate it. SB_RECORD macros are inserted in place, while SB_REGISTER macros are printed to stdout, and have to be manually copied into the Registry's constructor. Additionally, the utility makes no attempt to properly format the inserted macros. Please use clang-format to format the changes after running the tool. Differential revision: https://reviews.llvm.org/D56822 llvm-svn: 353271
OpenPOWER on IntegriCloud