summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities
Commit message (Collapse)AuthorAgeFilesLines
* Fix test failures that depended on module orderGreg Clayton2018-12-142-24/+24
| | | | llvm-svn: 349122
* Remove unused fileJonas Devlieghere2018-12-111-19/+0
| | | | | | | I removed the dotest-style reproducer test but forgot to delete the source file. Thanks Jim for the heads up! llvm-svn: 348901
* Rewrite pexpect-based test in LIT/FileCheck.Adrian Prantl2018-12-103-119/+0
| | | | | | | pexecpt-based tests are flakey because they involve timeouts and this test is eprfectly serializable. llvm-svn: 348808
* Re-commit "Introduce ObjectFileBreakpad"Pavel Labath2018-12-103-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This re-commits r348592, which was reverted due to a failing test on macos. The issue was that I was passing a null pointer for the "CreateMemoryInstance" callback when registering ObjectFileBreakpad, which caused crashes when attemping to load modules from memory. The correct thing to do is to pass a callback which always returns a null pointer (as breakpad files are never loaded in inferior memory). It turns out that there is only one test which exercises this code path, and it's mac-only, so I've create a new test which should run everywhere (except windows, as one cannot delete an executable which is being run). Unfortunately, this test still fails on linux for other reasons, but at least it gives us something to aim for. The original commit message was: This patch adds the scaffolding necessary for lldb to recognise symbol files generated by breakpad. These (textual) files contain just enough information to be able to produce a backtrace from a crash dump. This information includes: - UUID, architecture and name of the module - line tables - list of symbols - unwind information A minimal breakpad file could look like this: MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 a.out INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3 FILE 0 /tmp/a.c FUNC 1010 10 0 _start 1010 4 4 0 1014 5 5 0 1019 5 6 0 101e 2 7 0 PUBLIC 1010 0 _start STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^ STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 + STACK CFI 1014 .cfa: $rbp 16 + Even though this data would normally be considered "symbol" information, in the current lldb infrastructure it is assumed every SymbolFile object is backed by an ObjectFile instance. So, in order to better interoperate with the rest of the code (particularly symbol vendors). In this patch I just parse the breakpad header, which is enough to populate the UUID and architecture fields of the ObjectFile interface. The rough plan for followup patches is to expose the individual parts of the breakpad file as ObjectFile "sections", which can then be used by other parts of the codebase (SymbolFileBreakpad ?) to vend the necessary information. Reviewers: clayborg, zturner, lemo, amccarth Subscribers: mgorny, fedor.sergeev, markmentovai, lldb-commits Differential Revision: https://reviews.llvm.org/D55214 llvm-svn: 348773
* [lldbsuite] Disable TestStopPCs when there's no XML supportStella Stamenova2018-12-061-0/+2
| | | | | | The test relies on xml support to setup the correct registers. If there's no XML support, the test is going to fail. llvm-svn: 348435
* [Reproducers] Change how reproducers are initialized.Jonas Devlieghere2018-12-032-54/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the way the reproducer is initialized. Rather than making changes at run time we now do everything at initialization time. To make this happen we had to introduce initializer options and their SB variant. This allows us to tell the initializer that we're running in reproducer capture/replay mode. Because of this change we also had to alter our testing strategy. We cannot reinitialize LLDB when using the dotest infrastructure. Instead we use lit and invoke two instances of the driver. Another consequence is that we can no longer enable capture or replay through commands. This was bound to go away form the beginning, but I had something in mind where you could enable/disable specific providers. However this seems like it adds very little value right now so the corresponding commands were removed. Finally this change also means you now have to control this through the driver, for which I replaced --reproducer with --capture and --replay to differentiate between the two modes. Differential revision: https://reviews.llvm.org/D55038 llvm-svn: 348152
* Skip TestRequireHWBreakpoints on WindowsJonas Devlieghere2018-11-301-0/+4
| | | | | | | | | The test assumes that HW breakpoints are not implemented by the debug server. Windows doesn't use these and might actually support HW breakpoints so these tests are expected fail because they don't raise the expected error. llvm-svn: 348010
* [Target] Do not skip a stop on a breakpoint if a plan was completedAleksandr Urakov2018-11-303-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes the next situation. On Windows clang-cl makes no stub before the main function, so the main function is located exactly on module entry point. May be it is the same on other platforms. So consider the following sequence: - set a breakpoint on main and stop there; - try to evaluate expression, which requires a code execution on the debuggee side. Such an execution always returns to the module entry, and the plan waits for it there; - the plan understands that it is complete now and removes its breakpoint. But the breakpoint site is still there, because we also have a breakpoint on entry; - StopInfo analyzes a situation. It sees that we have stopped on the breakpoint site, and it sees that the breakpoint site has owners, and no one logical breakpoint is internal (because the plan is already completed and it have removed its breakpoint); - StopInfo thinks that it's a user breakpoint and skips it to avoid recursive computations; - the program continues. So in this situation the program continues without a stop right after the expression evaluation. To avoid this an additional check that the plan was completed was added. Reviewers: jingham, zturner, boris.ulasevich Reviewed by: jingham Tags: #lldb Differential Revision: https://reviews.llvm.org/D53761 llvm-svn: 347974
* [lldbsuite] Each lldb suite test must have a unique class nameStella Stamenova2018-11-271-1/+1
| | | | | | A couple of new tests have been added that use existing class names. This causes failures on Windows if the tests run at the same time and on any platform it results in the logs being overwritten. llvm-svn: 347717
* Skip TestTargetCreateDepsJonas Devlieghere2018-11-201-1/+1
| | | | | | Skip this test because Windows deals differently with shared libraries. llvm-svn: 347283
* Revert "Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD"Zachary Turner2018-11-185-101/+0
| | | | | | | This breaks many tests on Windows, which now all fail with an error such as "Unable to read memory at address <xxxxxxxx>". llvm-svn: 347174
* Rewrite stop-hook tests as a couple of FileCheck testsFrederic Riss2018-11-167-447/+0
| | | | | | | | Those tests were using pexpect and being flaky on some of ours bots. This patch reimplmeents the tests usinf FileCheck, and it also extends the test coverage to a few more stop-hook options. llvm-svn: 347109
* Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLDNathan Lanza2018-11-155-0/+101
| | | | | | | | | | | | | | | Summary: This commit implements basic DidAttach and DidLaunch for the windows DynamicLoader plugin which allow us to load shared libraries from the inferior. Reviewers: sas, zturner Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D54544 llvm-svn: 346994
* Add setting to require hardware breakpoints.Jonas Devlieghere2018-11-154-1/+121
| | | | | | | | | | | | | | | | When debugging read-only memory we cannot use software breakpoint. We already have support for hardware breakpoints and users can specify them with `-H`. However, there's no option to force LLDB to use hardware breakpoints internally, for example while stepping. This patch adds a setting target.require-hardware-breakpoint that forces LLDB to always use hardware breakpoints. Because hardware breakpoints are a limited resource and can fail to resolve, this patch also extends error handling in thread plans, where breakpoints are used for stepping. Differential revision: https://reviews.llvm.org/D54221 llvm-svn: 346920
* Add GDB remote packet reproducer.Jonas Devlieghere2018-11-133-0/+73
| | | | llvm-svn: 346780
* Remove header grouping comments.Jonas Devlieghere2018-11-119-9/+9
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* Add extra diagnostics to testAdrian Prantl2018-11-101-0/+4
| | | | llvm-svn: 346572
* Work with a gdb-remote target that doesn't handle theJason Molenda2018-11-091-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | qWatchpointSupportInfo packet correctly. In GDBRemoteCommunicationClient::GetWatchpointSupportInfo, if the response to qWatchpointSupportInfo does not include the 'num' field, then we did not get an answer we understood, mark this target as not supporting that packet. In Target.cpp, rename the very confusingly named CheckIfWatchpointsExhausted to CheckIfWatchpointsSupported, and check the error status returned by Process::GetWatchpointSupportInfo. If we cannot determine what the number of supported watchpoints are, assume that they will work. We'll handle the failure later when we try to create/enable the watchpoint if the Z2 packet isn't supported. Add a gdb_remote_client test case. <rdar://problem/42621432> llvm-svn: 346561
* [lldb] Introduce StackFrameRecognizer [take 3]Kuba Mracek2018-10-314-0/+161
| | | | | | | | This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector). Differential Revision: https://reviews.llvm.org/D44603 llvm-svn: 345693
* Revert r345686 due to build failuresKuba Mracek2018-10-314-161/+0
| | | | llvm-svn: 345688
* [lldb] Introduce StackFrameRecognizer [take 2]Kuba Mracek2018-10-314-0/+161
| | | | | | | | This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector). Differential Revision: https://reviews.llvm.org/D44603 llvm-svn: 345686
* Revert r345678 (build failure on Linux machines).Kuba Mracek2018-10-314-161/+0
| | | | llvm-svn: 345680
* [lldb] Introduce StackFrameRecognizerKuba Mracek2018-10-314-0/+161
| | | | | | | | This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector). Differential Revision: https://reviews.llvm.org/D44603 llvm-svn: 345678
* [DataFormatters] Adding formatters for libc++ std::u16string and std::u32stringShafik Yaghmour2018-10-263-3/+9
| | | | | | | | rdar://problem/41302849 Differential Revision: https://reviews.llvm.org/D53656 llvm-svn: 345402
* Update test that checks auto-completion for settings set.Jonas Devlieghere2018-10-261-0/+5
| | | | | | | This reverts r345350 and updates the test rather than removing it. Now we check that `--g` auto-completes to `--global`. llvm-svn: 345351
* Remove test that checks auto-completion for settings set.Jonas Devlieghere2018-10-261-5/+0
| | | | | | | With the new `-f` option for `settings set`, `-` (dash) no longer auto-complete to `-g`. llvm-svn: 345350
* [API] Extend the `SBThreadPlan` interfaceAleksandr Urakov2018-10-254-0/+93
| | | | | | | | | | | | | | | | | | Summary: This patch extends the `SBThreadPlan` to allow retrieving of thread plans for scripted steps. Reviewers: labath, zturner, jingham Reviewed By: jingham Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D53361 llvm-svn: 345247
* Support nwere versions of the Segger J-Link jtag board software.Jason Molenda2018-10-232-2/+154
| | | | | | | | | | | | | | | | | | | | | | Add support in ProcessGDBRemote::GetGDBServerRegisterInfo for recognizing a generic "arm" architecture that will be used if nothing better is available so that we don't ignore the register definitions if we didn't already have an architecture set. Also in ProcessGDBRemote::DoConnectRemote don't set the target arch unless we have a valid architecture to set it to. Platform::ConnectProcess will try to get the current target's architecture, or the default architecture, when creating the target for the connection to be attempted. If lldb was started with a target binary, we want to create this target with that architecture in case the remote gdb stub doesn't supply a qHostInfo arch. Add logging to Target::MergeArchitecture. <rdar://problem/34916465> llvm-svn: 345106
* Skip test with older versions of clangJonas Devlieghere2018-10-231-0/+1
| | | | | | | | | This was failing for the bots that build with older clangs: http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-clang-5.0.2/ http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-clang-6.0.1/ llvm-svn: 345061
* [lldbsuite, windows] Disable two tail call frames tests that fail on WindowsStella Stamenova2018-10-192-0/+5
| | | | | | | | | | | | | | Summary: These tests fail on Windows because of known limitations (a.k.a. bugs) with the current implementation of GetFrameAtIndex Reviewers: asmith, vsk Reviewed By: vsk Subscribers: abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D53415 llvm-svn: 344788
* [lldbsuite] Mark the TestScriptedResolver tests as XFAIL on WindowsStella Stamenova2018-10-181-0/+4
| | | | | | | | | | | | Summary: They fail similarly to some of the other breakpoint tests on Windows, so I suspect the cause is the same. I've linked to the same bug. Reviewers: asmith, zturner, jingham Subscribers: abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D53331 llvm-svn: 344744
* Use a relaxed substring check for function names in a testVedant Kumar2018-10-161-2/+7
| | | | | | | | | | | The TestTailCallFrameSBAPI.py test checks that function names in a backtrace are equal to an expected value. Use a relaxed substring check because function dislpay names are platform-dependent. E.g we see "void sink(void)" on Windows, but "sink()" on Darwin. This seems like a bug -- just work around it for now. llvm-svn: 344634
* Use assertEqual to improve test failure loggingVedant Kumar2018-10-162-12/+12
| | | | | | | Some tests in test/functionalities/tail_call_frames are failing on non-Darwin platforms. Use assertEqual to improve logging on failure. llvm-svn: 344581
* [lldbsuite] Make the names of test classes uniqueStella Stamenova2018-10-151-1/+1
| | | | | | | | | | | | | | | Summary: If the names are not unique, the tests overwrite each other's results and logs. This also causes failures on platforms where the files are locked for writing. The names of the class/test pairs *have to* always be unique. The easiest way to achieve that is to name each class differently (usually the same as the file name). Reviewers: jasonmolenda, asmith Subscribers: clayborg, nemanjai, kbarton, lldb-commits Differential Revision: https://reviews.llvm.org/D53297 llvm-svn: 344547
* Changing test names in TestDataFormatterLibcxxVariant.py and ↵Shafik Yaghmour2018-10-121-1/+1
| | | | | | TestStdFunctionStepIntoCallable.py to be unique, NFC llvm-svn: 344407
* Add support for artificial tail call framesVedant Kumar2018-10-0530-0/+567
| | | | | | | | | | | | | | | | 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
* 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
* Remove unnecessary fieldAdrian Prantl2018-10-021-1/+1
| | | | llvm-svn: 343624
* DWARFExpression: Resolve file addresses in the linked moduleAdrian Prantl2018-10-024-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Enable C++ tests to run in the -gmodules configuration on Darwin.Adrian Prantl2018-10-011-4/+0
| | | | | | | | This addresses PR36048 (http://llvm.org/bugs/show_bug.cgi?id=36048) rdar://problem/36776281 llvm-svn: 343545
* [SBAPI/Target] Expose SetStatistics(bool enable)/GetStatistics().Davide Italiano2018-09-281-0/+9
| | | | | | <rdar://problem/44875808> llvm-svn: 343368
* Change the unwinder to not use a hard-coded limit on theJason Molenda2018-09-253-0/+50
| | | | | | | | | | max number of stack frames to backtrace, make it a setting, target.process.thread.max-backtrace-depth. Add a test case for the setting. <rdar://problem/28759559> llvm-svn: 343029
* XFAIL some tests in TestTargetCreateDeps on linuxPavel Labath2018-09-251-0/+4
| | | | | | | | On linux, we do not support automatic loading of dependent modules, so the module list will always contain just one module (until the target is launched). llvm-svn: 343016
* Skip test if gcc version is less than 7.1 since it doesn't support ↵Tatyana Krasnukha2018-09-211-0/+4
| | | | | | -gcolumn-info option llvm-svn: 342732
* [target] Change target create's behavior wrt loading dependent files.Jonas Devlieghere2018-09-205-0/+151
| | | | | | | | | | | | | | | | | | | | When creating a target, lldb loads all dependent files (i.e. libs in LC_LOAD_DYLIB for Mach-O). This can be confusing, especially when two versions of the same library end up in the shared cache. It's possible to change this behavior, by specifying target create -d <target> these dependents are not loaded. This patch changes the default behavior to only load dependent files only when the target is an executable. When creating a target for a library, it is now no longer necessary to pass -d. The user can still override this behavior by specifying the -d option to change this behavior. rdar://problem/43721382 Differential revision: https://reviews.llvm.org/D51934 llvm-svn: 342634
* [DataFormatters] Add formatter for C++17 std::variantShafik Yaghmour2018-09-193-0/+148
| | | | | | | | | | rdar://problem/43691454 Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D51520 llvm-svn: 342563
* Allow use of self.filecheck in LLDB tests (c.f self.expect)Vedant Kumar2018-09-181-1/+6
| | | | | | | | | | | | | Add a "filecheck" method to the LLDB test base. This allows test authors to pattern match command output using FileCheck, making it possible to write stricter tests than what `self.expect` allows. For context (motivation, examples of stricter checking, etc), see the lldb-dev thread: "Using FileCheck in lldb inline tests". Differential Revision: https://reviews.llvm.org/D50751 llvm-svn: 342508
* Revert "[DataFormatters] Add formatter for C++17 std::variant"Shafik Yaghmour2018-09-173-148/+0
| | | | | | | | This reverts commit r342421. Because it breaks build bot http://green.lab.llvm.org/green/job/lldb-cmake-clang-5.0.2//418/console llvm-svn: 342424
OpenPOWER on IntegriCloud