summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* Fix double import of _lldb module.Vadim Chugunov2018-10-142-5/+8
| | | | | | | | | | | | Fix llvm.org/pr39054: - Register _lldb as a built-in module during initialization of script interpreter, - Reverse the order of imports in __init__.py: first try to import by absolute name, which will find the built-in module in the context of lldb (and other hosts that embed liblldb), then try relative import, in case the module is being imported from Python interpreter. This works for SWIG>=3.0.11; before that, SWIG did not support custom module import code. Differential revision: https://reviews.llvm.org/D52404 llvm-svn: 344474
* Add REQUIRES: lld to SymbolFileNativePDB tests.Zachary Turner2018-10-123-28/+31
| | | | llvm-svn: 344431
* Try to fix some failures on MacOSX with the NativePDB patch.Zachary Turner2018-10-124-8/+15
| | | | | | | | | | This adds -- before any filenames, so that /U doesn't get interpreted as a command line. It also adds better error checking, so that we don't get assertions on the failure path when a file fails to parse as a PDB. llvm-svn: 344429
* Change the default handling for SIGPIPE to pass/,no-stop/no-notify.Jim Ingham2018-10-121-1/+1
| | | | | | | | | Most of the time SIGPIPE is just annoying, and so we should pass it on silently it by default. <rdar://problem/39359145> llvm-svn: 344418
* Add NativePDB subdir again.Jason Molenda2018-10-121-0/+35
| | | | llvm-svn: 344414
* Fix failure in get_filecheck_path when filecheck is NoneStella Stamenova2018-10-121-1/+1
| | | | | | If the path was not specified (and it's None), lexists throws an exception rather than returning False. get_filecheck_path now checks whether filecheck is set before calling lexists llvm-svn: 344410
* Resubmit "Add SymbolFileNativePDB plugin."Zachary Turner2018-10-1222-6/+2210
| | | | | | | | | | This was originally reverted due to some test failures on Linux. Those problems turned out to require several additional patches to lld and clang in order to fix, which have since been submitted. This patch is resubmitted unchanged. All tests now pass on both Linux and Windows. llvm-svn: 344409
* Changing test names in TestDataFormatterLibcxxVariant.py and ↵Shafik Yaghmour2018-10-122-2/+2
| | | | | | TestStdFunctionStepIntoCallable.py to be unique, NFC llvm-svn: 344407
* [dotest] Make a missing FileCheck binary a warning, not an errorVedant Kumar2018-10-123-6/+12
| | | | | | | | | | This allows bots which haven't updated to pass in --filecheck to dotest.py to run more tests. FileCheck-dependent tests will continue to fail. Differential Revision: https://reviews.llvm.org/D53175 llvm-svn: 344401
* Add "v" as well as "var" as an alias for "frame var".Jim Ingham2018-10-121-0/+1
| | | | | | <rdar://problem/40066460> llvm-svn: 344397
* [lldbsuite] Fix the filecheck functionality to work with Python 3Stella Stamenova2018-10-121-1/+1
| | | | | | | | | | | | | | Summary: This is another string/byte conversion issue between Python 2 and 3. In Python 2, the subprocess communication expects a byte string, but in Python 3, it expects bytes. Since both versions are capable of using strings when universal_newlines is set to True AND filecheck operates on strings, force the use of strings. Reviewers: zturner, asmith, vsk Reviewed By: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D53166 llvm-svn: 344386
* Adding support to step into the callable wrapped by libc++ std::functionShafik Yaghmour2018-10-126-1/+213
| | | | | | | | rdar://problem/14365983 Differential Revision: https://reviews.llvm.org/D52851 llvm-svn: 344371
* [LLDB] - Add support for DW_FORM_implicit_const.George Rimar2018-10-1210-51/+137
| | | | | | | | | | | | | | | LLDB does not support this DWARF5 form atm. At least gcc emits it in some cases when doing optimization for abbreviations. As far I can tell, clang does not support it yet, though the rest LLVM code already knows about it. The patch adds the support. Differential revision: https://reviews.llvm.org/D52689 llvm-svn: 344328
* Remove references to source/Plugins/SymbolFile/NativePDB.Jason Molenda2018-10-121-25/+0
| | | | llvm-svn: 344323
* Revert SymbolFileNativePDB plugin.Zachary Turner2018-10-1122-2210/+6
| | | | | | | | | This was originally causing some test failures on non-Windows platforms, which required fixes in the compiler and linker. After those fixes, however, other tests started failing. Reverting temporarily until I can address everything. llvm-svn: 344279
* Fix this comment so it is consistent with all the others.Jason Molenda2018-10-111-1/+1
| | | | llvm-svn: 344277
* Don't mark an LC_BUILD_VERSION as giving us a Jason Molenda2018-10-111-1/+1
| | | | | | correct version if it has a major verison 0. llvm-svn: 344275
* Better support for POSIX paths in PDBs.Zachary Turner2018-10-113-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | While it doesn't make a *ton* of sense for POSIX paths to be in PDBs, it's possible to occur in real scenarios involving cross compilation. The tools need to be able to handle this, because certain types of debugging scenarios are possible without a running process and so don't necessarily require you to be on a Windows system. These include post-mortem debugging and binary forensics (e.g. using a debugger to disassemble functions and examine symbols without running the process). There's changes in clang, LLD, and lldb in this patch. After this the cross-platform disassembly and source-list tests pass on Linux. Furthermore, the behavior of LLD can now be summarized by a much simpler rule than before: Unless you specify /pdbsourcepath and /pdbaltpath, the PDB ends up with paths that are valid within the context of the machine that the link is performed on. Differential Revision: https://reviews.llvm.org/D53149 llvm-svn: 344269
* [lldb] Surpress copy-elison warning.Eric Liu2018-10-111-2/+2
| | | | llvm-svn: 344252
* [lldb] rename MinOS::minor to MinOS::minor_version etc. NFCEric Liu2018-10-111-8/+8
| | | | | | | The constructor initializer minor(...)/major(...) can be confused with system macros `#define minor(...)` on some platforms. llvm-svn: 344250
* Upstreaming the BridgeOS device support and the Jason Molenda2018-10-1119-35/+714
| | | | | | | | | | | | | | | LC_BUILD_VERSION load command handling - this commit is a combination of patches by Adrian Prantl and myself. llvm::Triple::BridgeOS isn't defined yet, so all references to that are currently commented out. Also update Xcode project file to build the NativePDB etc plugins. <rdar://problem/43353615> llvm-svn: 344209
* [SymbolFileNativePDB] Fix compilation errors with gcc.Zachary Turner2018-10-104-6/+11
| | | | llvm-svn: 344173
* [Windows] Fix a bug that causes lldb to freezeAaron Smith2018-10-102-5/+15
| | | | | | | | | | | | | | | | | | | | | Summary: If the process exits before any initial stop then notify the debugger of the error otherwise WaitForDebuggerConnection() will be blocked. An example of this issue is when a process fails to load a dependent DLL. In addition to the fix, remove a duplicate call to FreeProcessHandles() in DebuggerThread::HandleExitProcessEvent() and use decimal format for all thread IDs. Reviewers: rnk, zturner, aleksandr.urakov Reviewed By: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D53090 llvm-svn: 344168
* Create a SymbolFile plugin for cross-platform PDB access.Zachary Turner2018-10-1022-6/+2205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing SymbolFilePDB only works on Windows, as it is written against a closed-source Microsoft SDK that ships with their debugging tools. There are several reasons we want to bypass this and go straight to the bits of the PDB, but just to list a few: More room for optimization. We can't see inside the implementation of the Microsoft SDK, so we don't always know if we're doing things in the most efficient way possible. For example, setting a breakpoint on main of a big program currently takes several seconds. With the implementation here, the time is unnoticeable. We want to be able to symbolize Windows minidumps even if not on Windows. Someone should be able to debug Windows minidumps as if they were on Windows, given that no running process is necessary. This patch is a very crude first attempt at filling out some of the basic pieces. I've implemented FindFunctions, ParseCompileUnitLineTable, and ResolveSymbolContext for a limited subset of possible parameter values, which is just enough to get it to display something nice for the breakpoint location. I've added several tests exercising this functionality which are limited enough to work on all platforms but still exercise this functionality. I'll try to add as many tests of this nature as I can, but at some point we'll need a live process. For now, this plugin is enabled always on non-Windows, and by setting the environment variable LLDB_USE_NATIVE_PDB_READER=1 on Windows. Eventually, once it's at parity with the Windows implementation, we'll delete the Windows DIA-based implementation. Differential Revision: https://reviews.llvm.org/D53002 llvm-svn: 344154
* [LLDB] - Simplify. NFC.George Rimar2018-10-101-8/+1
| | | | | | | | | | There are several places that call `FindRanges`, all of them use `Slide` to adjust the ranges found by the base address. All except one, which does the same manually in a loop. Patch updates it to use `Slide` for consistency. llvm-svn: 344122
* [LLDB] - Add basic support for .debug_rnglists section (DWARF5)George Rimar2018-10-1012-13/+194
| | | | | | | | | This adds a basic support of the .debug_rnglists section. Only the DW_RLE_start_length and DW_RLE_end_of_list entries are supported. Differential revision: https://reviews.llvm.org/D52981 llvm-svn: 344119
* Add "var" and "vo" aliases for "frame variable" and "frame variable -O".Jim Ingham2018-10-102-1/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D53010 llvm-svn: 344102
* Add support for artificial tail call framesVedant Kumar2018-10-0552-73/+1166
| | | | | | | | | | | | | | | | This patch teaches lldb to detect when there are missing frames in a backtrace due to a sequence of tail calls, and to fill in the backtrace with artificial tail call frames when this happens. This is only done when the execution history can be determined from the call graph and from the return PC addresses of calls on the stack. Ambiguous sequences of tail calls (e.g anything involving tail calls and recursion) are detected and ignored. Depends on D49887. Differential Revision: https://reviews.llvm.org/D50478 llvm-svn: 343900
* Relax a data formatter testVedant Kumar2018-10-051-0/+1
| | | | | | | Before inspecting the contents of a list, make sure that we've stepped past the push_back() that inserts the element we're interested in. llvm-svn: 343899
* TestMultilineExpr: validate evaluation for expressions that span multiple linesStefan Granitz2018-10-054-101/+9
| | | | | | | | | | | | | | Summary: When LLDB successfully parses a command (like "expression" in this case) and determines incomplete input, the user can continue typing on multiple lines (in this case "2+3"). This should provide the correct result. Note that LLDB reverts input from the additional lines, so they are not present in the output. Reviewers: vsk, davide, aprantl Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D52270 llvm-svn: 343860
* Add EchoCommentCommands to CommandInterpreterRunOptions in addition to the ↵Stefan Granitz2018-10-0512-37/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | existing EchoCommands and expose both as interpreter settings. Summary: Add settings to control command echoing: ``` (lldb) settings set interpreter.echo-commands true (lldb) settings set interpreter.echo-comment-commands true ``` Both settings default to true, which keeps LLDB's existing behavior in non-interactive mode (echo all command inputs to the output). So far the only way to change this behavior was the `--source-quietly` flag, which disables all output including evaluation results. Now `echo-commands` allows to turn off echoing for commands, while evaluation results are still printed. No effect if `--source-quietly` was present. `echo-comment-commands` allows to turn off echoing for commands in case they are pure comment lines. No effect if `echo-commands` is false. Note that the behavior does not change immediately! The new settings take effect only with the next command source. LLDB lit test are the main motivation for this feature. So far incoming `#CHECK` line have always been echoed to the output and so they could never fail. Now we can disable it in lit-lldb-init. Todos: Finish test for this feature. Add to lit-lldb-init. Check for failing lit tests. Reviewers: aprantl, jasonmolenda, JDevlieghere Subscribers: friss, lldb-commits Differential Revision: https://reviews.llvm.org/D52788 llvm-svn: 343859
* Fix typos.Bruce Mitchener2018-10-0417-31/+31
| | | | | | | | | | Reviewers: lldb-commits Subscribers: srhines, ki.stfu Differential Revision: https://reviews.llvm.org/D52884 llvm-svn: 343825
* The Python 3 part of the script was missed when adding OpenBSD support.Brad Smith2018-10-041-2/+3
| | | | llvm-svn: 343810
* Re-commit r343500 "Fix build with GCC < 5.0 (PR39131)"Tatyana Krasnukha2018-10-041-7/+9
| | | | | | Occasionally didn't commit actual fix the first time. llvm-svn: 343769
* Fix buildbot regression by rL339929: NameError: global name 'test_directory' ↵Jan Kratochvil2018-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | is not defined With buildbot slave under test - I get after rL339929: http://lab.llvm.org:8014/builders/lldb-x86_64-fedora-28-cmake/builds/243/steps/test1/logs/stdio File "/home/buildbot/lldbroot/lldb-x86_64-fedora-28-cmake/scripts/../llvm/tools/lldb/test/dotest.py", line 7, in <module> lldbsuite.test.run_suite() File "/quad/home/buildbot/lldbroot/lldb-x86_64-fedora-28-cmake/llvm/tools/lldb/packages/Python/lldbsuite/test/dotest.py", line 1177, in run_suite configuration.results_formatter_object) File "/quad/home/buildbot/lldbroot/lldb-x86_64-fedora-28-cmake/llvm/tools/lldb/packages/Python/lldbsuite/test/dosep.py", line 1692, in main dst = core.replace(test_directory, "")[1:] NameError: global name 'test_directory' is not defined Patch by Vedant Kumar. Differential Revision: https://reviews.llvm.org/D51874 llvm-svn: 343726
* Adding skipIf to std::variant libc++ data-formatter test since get is not ↵Shafik Yaghmour2018-10-031-0/+2
| | | | | | | | available before macOS 10.14 Patch by Shafik Yaghmour llvm-svn: 343718
* Skip test with older versions of clangAdrian Prantl2018-10-031-0/+1
| | | | llvm-svn: 343695
* Pull FixupBreakpointPCAsNeeded into base classPavel Labath2018-10-036-153/+68
| | | | | | | | | | | | | | | | | Summary: This function existed (with identical code) in both NativeProcessLinux and NativeProcessNetBSD, and it is likely that it would be useful to any future implementation of NativeProcessProtocol. Therefore I move it to the base class. Reviewers: krytarowski Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D52719 llvm-svn: 343683
* Remove unnecessary fieldAdrian Prantl2018-10-021-1/+1
| | | | llvm-svn: 343624
* DWARFExpression: Resolve file addresses in the linked moduleAdrian Prantl2018-10-026-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to https://reviews.llvm.org/D46362. When evaluating a complex expression in DWARFExpression::Evaluate, file addresses must be resolved to load addresses before we can perform operations such as DW_OP_deref on them. For this the address goes through three steps 1. Read the file address as stored in the DWARF 2. Link/relocate the file address (when reading from a .dSYM, this is a no-op) 3. Convert the file address to a load address. D46362 implemented step (3) by resolving the file address using the Module that the original DWARF came from. In the case of a dSYM that is correct, but when reading from .o files, we need to look up relocated/linked addresses, so the right place to look them up is the current frame's module. This patch fixes that by setting the expression's Module to point to the linked debugmap object. A word a bout the unorthodox testcase: The motivating testcase for this fix is in Swift, but I managed to hand-modify LLVM-IR for a trivial C program to exhibit the same problem, so we can fix this in llvm.org. rdar://problem/44689915 Differential Revision: https://reviews.llvm.org/D52678 llvm-svn: 343612
* Remove GetPythonDir declaration from HostInfoBase classTatyana Krasnukha2018-10-021-4/+0
| | | | llvm-svn: 343609
* Enable C++ tests to run in the -gmodules configuration on Darwin.Adrian Prantl2018-10-012-4/+4
| | | | | | | | This addresses PR36048 (http://llvm.org/bugs/show_bug.cgi?id=36048) rdar://problem/36776281 llvm-svn: 343545
* Fix tests affected by printing change.Jonas Devlieghere2018-10-012-2/+2
| | | | | | | I forgot to update some tests that were affected by the escaping of backticks in the format string, landed in r343471. llvm-svn: 343502
* Fix build with GCC < 5.0 (PR39131)Tatyana Krasnukha2018-10-011-1/+1
| | | | llvm-svn: 343500
* [lldb] Start a new line for the next output if there are no symbols in the ↵Aaron Smith2018-10-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | current symtab Summary: If there is no newline the "lldb" prompt could be on the wrong line. To reproduce the missing newline you can do 'image dump smytab' on any binary. Previously Symtab, file = D:\upstream\build\Debug\bin\clang-diff.exe, num_symbols = 0(lldb) Now Symtab, file = D:\upstream\build\Debug\bin\clang-diff.exe, num_symbols = 0 (lldb) Reviewers: zturner, aleksandr.urakov, lldb-commits Subscribers: abidh Differential Revision: https://reviews.llvm.org/D52627 llvm-svn: 343497
* [Interpreter] Escape backticks when dumping format entities.Jonas Devlieghere2018-10-012-1/+19
| | | | | | | | | Currently we reject our own default disassembly-format string because it contains two backticks which causes everything in between to be interpreter as an expression by the command interpreter. This patch fixes that by escaping backticks when dumping format strings. llvm-svn: 343471
* Escape newlines in default disassembly format.Jonas Devlieghere2018-10-011-2/+2
| | | | | | | We can safely escape newlines in format strings because they will be ignored by the format entity parser. llvm-svn: 343470
* Fix NetBSD build for r343409Pavel Labath2018-09-301-1/+0
| | | | | | Forgot to remove the method declaration from the header. llvm-svn: 343411
* Pull GetSoftwareBreakpointPCOffset into base classPavel Labath2018-09-305-65/+34
| | | | | | | | | | | | | | | | | | | | | | Summary: This function encodes the knowledge of whether the PC points to the breakpoint instruction of the one following it after the breakpoint is "hit". This behavior mainly(*) depends on the architecture and not on the OS, so it makes sense for it to be implemented in the base class, where it can be shared between different implementations (Linux and NetBSD atm). (*) It is possible for an OS to expose a different API, perhaps by doing some fixups in the kernel. In this case, the implementation can override this function to implement custom behavior. Reviewers: krytarowski, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D52532 llvm-svn: 343409
* [SBAPI/Target] Expose SetStatistics(bool enable)/GetStatistics().Davide Italiano2018-09-284-0/+53
| | | | | | <rdar://problem/44875808> llvm-svn: 343368
OpenPOWER on IntegriCloud