summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
Commit message (Collapse)AuthorAgeFilesLines
* [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
* Revert "Return a named error in the result object of an expression with no ↵Krasimir Georgiev2018-10-183-60/+0
| | | | | | | | | | | | | | | | | result" This reverts commit r344647. This causes build failures with [-Werror, -Wswitch]. Some cases where the newly introduced enum value is not handled in particular are in: lldb/source/Expression/REPL.cpp:350 lldb/source/Interpreter/CommandInterpreter.cpp:1529 (maybe there could be more) As I don't understand lldb to make sure the likely trivial fixes are correct and also as they might need additional tests, leaving to the author to resolve. llvm-svn: 344722
* Return a named error in the result object of an expression with no resultJim Ingham2018-10-163-0/+60
| | | | | | | | | | | | Before we returned an error that was not exposed in the SB API and no useful error message. This change returns eExpressionProducedNoResult and an appropriate error string. <rdar://problem/44539514> Differential Revision: https://reviews.llvm.org/D53309 llvm-svn: 344647
* Tiny testsuite tweaks. Don't run the apple simulatorJason Molenda2018-10-163-0/+11
| | | | | | | | | | tests when targetting a device. Add an include to safe-to-call-func to work around a modules issue with a certain combination of header files. Add rules for Darwin systems to ad-hoc codesign binaries that the testsuite builds. llvm-svn: 344635
* 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
* Don't run TestBreakpointIt.py on arm64 devices;Jason Molenda2018-10-161-0/+2
| | | | | | it is armv7 specific. llvm-svn: 344633
* [lldbsuite] Fix the mac version decorator to work on non-mac platformsStella Stamenova2018-10-161-2/+2
| | | | | | | | | | | | | | Summary: On non-mac platforms, mac_ver returns an empty string which when converted to LooseVersion has no "version" property. This causes a failure when the decorator executes. Instead, check whether the value returned from mac_ver is an empty string and avoid the LooseVersion comparison. Reviewers: labath, davide, asmith, shafik, jingham Reviewed By: jingham Subscribers: jingham, lldb-commits Differential Revision: https://reviews.llvm.org/D53208 llvm-svn: 344623
* 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
* [lldbsuite] Disable Test128BitsInteger on WindowsStella Stamenova2018-10-151-1/+4
| | | | | | | | | | | | | | Summary: This test is failing on Windows because lldb does not support JIT on Windows. Reviewers: davide, asmith Reviewed By: davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D53226 llvm-svn: 344543
* 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
* 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
* [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-123-0/+116
| | | | | | | | rdar://problem/14365983 Differential Revision: https://reviews.llvm.org/D52851 llvm-svn: 344371
* Add support for artificial tail call framesVedant Kumar2018-10-0531-0/+591
| | | | | | | | | | | | | | | | 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-053-101/+0
| | | | | | | | | | | | | | 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
* Fix typos.Bruce Mitchener2018-10-041-1/+1
| | | | | | | | | | Reviewers: lldb-commits Subscribers: srhines, ki.stfu Differential Revision: https://reviews.llvm.org/D52884 llvm-svn: 343825
* 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
* 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-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
* [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
* [lldbinline] Set directory attribute on test-specific classesVedant Kumar2018-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the "mydir" attribute of an inline test on the test-specific class, instead of on the base InlineTest class. This makes it possible to run dotest.py on a directory containing inline tests. This wasn't really possible prior to this patch, because what would happen is that one test would just run over and over again, even though the test infrastructure would claim that different tests were being run. Example: The test infrastructure claimed that all of these different tests were passing, which couldn't be true -- $ ./bin/lldb-dotest /Users/vsk/src/tailcall/lldb/test/testcases/functionalities/tail_call_frames/ -G dwarf -t 2>&1 | grep PASS PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguateTailCallSeq) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestArtificialFrameStepOutMessage) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestAmbiguousTailCallSeq1) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguatePathsToCommonSink) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguateCallSite) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestUnambiguousTailCalls) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestAmbiguousTailCallSeq2) RESULT: PASSED (7 passes, 0 failures, 0 errors, 24 skipped, 0 expected failures, 0 unexpected successes) ... because it wasn't even looking at some of these tests: $ ./bin/lldb-dotest /Users/vsk/src/tailcall/lldb/test/testcases/functionalities/tail_call_frames/ -G dwarf -t 2>&1 | grep "Change dir" Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 E.g it was only building one of them: $ ls lldb-test-build.noindex/functionalities/tail_call_frames/                         ambiguous_tail_call_seq2 Differential Revision: https://reviews.llvm.org/D52516 llvm-svn: 343023
* 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
* [lldbtest] Fix self.filecheck check file lookupVedant Kumar2018-09-201-10/+11
| | | | | | | | | | | | | | The 'test_filename' property in TestBase changes over time, so attempting to find a check file relative to the directory containing 'test_filename' is flaky. Use the absolute path of the check file as that's always correct (and simpler). This relies on the test driver changing into the test directory, which it seems we can safely assume. As a drive-by, make self.filecheck respect the trace (-t) option. llvm-svn: 342699
* [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-186-66/+127
| | | | | | | | | | | | | 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
* [DataFormatters] Add formatter for C++17 std::variantShafik Yaghmour2018-09-173-0/+148
| | | | | | | | | | rdar://problem/43691454 Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D51520 llvm-svn: 342421
* Add descriptions to completed expressionsRaphael Isemann2018-09-171-0/+33
| | | | | | | | | | | | | | | | | Summary: Completing inside the expression command now uses the new description API to also provide additional information to the user. For now this information are the types of variables/fields and the signatures of completed function calls. Reviewers: #lldb, JDevlieghere Reviewed By: JDevlieghere Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D52103 llvm-svn: 342385
* [IRInterpreter] Fall back to JIT with 128-bit values.Davide Italiano2018-09-143-0/+15
| | | | | | | | | | | | | They're not that common, and falling back is definitely better than throwing an error instead of the result. If we feel motivated, we might end up implementing support for these, but it's unclear whether it's worth the effort/complexity. Fixes PR38925. <rdar://problem/44436068> llvm-svn: 342262
* Make the eSearchDepthFunction searches work, add tests Jim Ingham2018-09-142-8/+31
| | | | | | | | using the scripted breakpoint resolver. Differential Revision: https://reviews.llvm.org/D52111 llvm-svn: 342259
* svn add the new files...Jim Ingham2018-09-134-0/+253
| | | | | | | | | I started from a clean slate to do the checkin, but forgot to svn add the new files. Do that now. Also add the one new source file to CMakeLists.txt llvm-svn: 342190
* Add a "scripted" breakpoint type to lldb.Jim Ingham2018-09-131-2/+16
| | | | | | | | | | This change allows you to write a new breakpoint type where the logic for setting breakpoints is determined by a Python callback written using the SB API's. Differential Revision: https://reviews.llvm.org/D51830 llvm-svn: 342185
* Add support for descriptions with command completions.Raphael Isemann2018-09-132-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a framework for adding descriptions to the command completions we provide. It also adds descriptions for completed top-level commands so that we can test this code. Completions are in general supposed to be displayed alongside the completion itself. The descriptions can be used to provide additional information about the completion to the user. Examples for descriptions are function signatures when completing function calls in the expression command or the binary name when providing completion for a symbol. There is still some boilerplate code from the old completion API left in LLDB (mostly because the respective APIs are reused for non-completion related purposes, so the CompletionRequest doesn't make sense to be used), so that's why I still had to change some function signatures. Also, as the old API only passes around a list of matches, and the descriptions are for these functions just another list, I had to add some code that essentially just ensures that both lists are always the same side (e.g. all the manual calls to `descriptions->AddString(X)` below a `matches->AddString(Y)` call). The initial command descriptions that come with this patch are just reusing the existing short help that is already added in LLDB. An example completion with descriptions looks like this: ``` (lldb) pl Available completions: platform -- Commands to manage and create platforms. plugin -- Commands for managing LLDB plugins. ``` Reviewers: #lldb, jingham Reviewed By: #lldb, jingham Subscribers: jingham, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D51175 llvm-svn: 342181
* [LLDB] - Improved DWARF5 support.George Rimar2018-09-132-0/+92
| | | | | | | | | This patch improves the support of DWARF5. Particularly the reporting of source code locations. Differential revision: https://reviews.llvm.org/D51935 llvm-svn: 342153
* [DWARFExpression] Read literars as unsigned values.Jonas Devlieghere2018-09-133-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | After landing r341457, we started seeing a failure on the swift-lldb bots. The change was correct and pretty straightforward, a DW_OP_constu was replaced with DW_OP_lit23, the value remaining identical. 0x000000f4: DW_TAG_variable DW_AT_location (0x00000000 [0x0000000100000a51, 0x0000000100000d47): DW_OP_lit23, DW_OP_stack_value) DW_AT_name ("number") However, this broke LLDB. (Int) number = <extracting data from value failed> The value was read correctly, but apparently the value's type was different. When reading a constu it was reading a uint64 (m_type = e_ulonglong) while for the literal, it got a signed int (m_type = e_sint). This change makes sure we read the value as an unsigned. Differential revision: https://reviews.llvm.org/D51730 llvm-svn: 342142
* Commit my attempt to test the change to ProcessGDBRemoteJason Molenda2018-09-122-0/+52
| | | | | | | | in r336956. This test doesn't actually test the change that was submitted by Venkata, but it's a good one to add. llvm-svn: 342085
OpenPOWER on IntegriCloud