summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/commands
Commit message (Collapse)AuthorAgeFilesLines
* [lldb] Add expect_expr function for testing expression evaluation in dotests.Raphael Isemann2020-01-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a new function to lldbtest: `expect_expr`. This function is supposed to replace the current approach of calling `expect`/`runCmd` with `expr`, `p` etc. `expect_expr` allows evaluating expressions and matching their value/summary/type/error message without having to do any string matching that might allow unintended passes (e.g., `self.expect("expr 3+4", substrs=["7"])` can unexpectedly pass for results like `(Class7) $0 = 7`, `(int) $7 = 22`, `(int) $0 = 77` and so on). This only uses the function in a few places to test and demonstrate it. I'll migrate the tests in follow up commits. Reviewers: JDevlieghere, shafik, labath Reviewed By: labath Subscribers: christof, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70314
* [lldb/Expression] Improve interpreter error message with a non-running targetMed Ismail Bennani2020-01-141-4/+4
| | | | | | | | | | | | | | | | | | When trying to interpret an expression with a function call, if the process hasn't been launched, the expression fails to be interpreted and the user gets the following error message: ```error: Can't run the expression locally``` This message doesn't explain why the expression failed to be interpreted, that's why this patch improves the error message that is displayed when trying to run an expression while no process is running. rdar://11991708 Differential Revision: https://reviews.llvm.org/D72510 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
* [lldb][NFC] Remove debug print statement from TestExprDiagnostics.pyRaphael Isemann2020-01-131-1/+0
|
* [lldb] Mark several tests as not dependent on debug infoRaphael Isemann2020-01-1320-1/+20
| | | | | | | | | | | | | | | | Summary: This just adds `NO_DEBUG_INFO_TESTCASE` to tests that don't really exercise anything debug information specific and therefore don't need to be rerun for all debug information variants. Reviewers: labath, jingham, aprantl, mib, jfb Reviewed By: aprantl Subscribers: dexonsmith, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72447
* [lldb][tests] Cleanup '.categories'Tatyana Krasnukha2020-01-105-4/+0
|
* [lldb] Fix that TestNoSuchArch.py was passing for the wrong reasonRaphael Isemann2020-01-091-2/+2
| | | | | | The command here failed due to the type in 'create' but the expect did not actually check for the error message. This fixes the typo and adds a check for the actuall error message we should see.
* Change the patterns to include the prefix '= ' so we don't pass errantly.Jason Molenda2020-01-061-5/+5
| | | | | | | | Looking at a sometimes-passing test case on a platform where random values were being returned - sometimes the expected digit ('1' or '2') would be included in the random returned value. Add a prefix to reduce the likelihood of this a bit.
* [lldb/Command] Add --force option for `watchpoint delete` commandMed Ismail Bennani2020-01-041-20/+25
| | | | | | | | | | | | | | Currently, there is no option to delete all the watchpoint without LLDB asking for a confirmation. Besides making the watchpoint delete command homogeneous with the breakpoint delete command, this option could also become handy to trigger automated watchpoint deletion i.e. using breakpoint actions. rdar://42560586 Differential Revision: https://reviews.llvm.org/D72096 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
* Revert "[lldb/Command] Add --force option for `watchpoint delete` command"Med Ismail Bennani2020-01-031-50/+0
| | | | This reverts commit 3620e5f28a4d2800fb6c325ec24b3d660e48b9ba.
* [lldb/Command] Add --force option for `watchpoint delete` commandMed Ismail Bennani2020-01-031-0/+50
| | | | | | | | | | | | Currently, there is no option to delete all the watchpoint without LLDB asking for a confirmation. Besides making the watchpoint delete command homogeneous with the breakpoint delete command, this option could also become handy to trigger automated watchpoint deletion i.e. using breakpoint actions. rdar://42560586 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
* [lldb] Fix crash in AccessDeclContextSanity when copying ↵Raphael Isemann2020-01-023-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | FunctionTemplateDecl inside a record. Summary: We currently don't set access specifiers for function template declarations. This seems to be fine as long as the function template is not declared inside any record in which case Clang asserts with the following once we try to query it's access: ``` Assertion failed: (Access != AS_none && "Access specifier is AS_none inside a record decl"), function AccessDeclContextSanity, ``` This patch just marks these function template declarations as public to make Clang happy. Reviewers: shafik, teemperor Reviewed By: teemperor Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71909
* tests: XFAIL/UNSUPPORTED tests on WindowsSaleem Abdulrasool2020-01-011-0/+3
| | | | | | | | | Now that we are building the python bindings on Windows once more, the extended testsuite is running. Mark a few failing tests and skip a few tests which hang. This should at least bring the bot back to green without reverting the Python changes which are an improvement for the build system and enable another ~35% of the test suite which was previously disabled.
* [lldb] Silent random xpass on aarch64-linux buildbotMuhammad Omair Javaid2019-12-271-1/+1
| | | | | | This patch adds skipif decorator to TestWatchLocationWithWatchSet.py. Decorator will trigger for aarch64-linux as this test passes randomly causing buildbot failure.
* [lldb][test] Don't include "test_common.h" in the debug macros testTatyana Krasnukha2019-12-261-0/+3
| | | | | GCC produces incorrect .debug_macro section when "-include" option is used: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93075.
* [lldb/test] Skip editline tests when LLDB_ENABLE_LIBEDIT is off.Jonas Devlieghere2019-12-202-0/+3
| | | | | Add a new decorator that checks if LLDB was build with editline support and mark the relevant tests as skipped when that's not the case.
* [ASTImporter][LLDB] Modifying ImportDeclContext(...) to ensure that we ↵shafik2019-12-193-1/+44
| | | | | | | | | | complete each FieldDecl of a RecordDecl when we are importing the definiton This fix was motivated by a crashes in expression parsing during code generation in which we had a RecordDecl that had incomplete FieldDecl. During code generation when computing the layout for the RecordDecl we crash because we have several incomplete FieldDecl. This fixes the issue by assuring that during ImportDefinition(...) for a RecordDecl we also import the definitions for each FieldDecl. Differential Revision: https://reviews.llvm.org/D71378
* Explicitly specify -std=c++11 and include <mutex> and <condition_variable>.Jim Ingham2019-12-162-0/+3
| | | | These files built on macos but not on Debian Linux. Let's see if this fixes it.
* Run all threads when extending a next range over a call.Jim Ingham2019-12-164-87/+80
| | | | | | | | | If you don't do this you end up running arbitrary code with only one thread allowed to run, which can cause deadlocks. <rdar://problem/56422478> Differential Revision: https://reviews.llvm.org/D71440
* [lldb][NFC] Remove all `setUp` overrides that only call the parent ↵Raphael Isemann2019-12-1317-61/+0
| | | | | | | | | | | | | | | | | | | | | | | | | implementation Summary: A lot of our tests copied the setUp code from our TestSampleTest.py: ``` def setUp(self): # Call super's setUp(). TestBase.setUp(self) ``` This code does nothing unless we actually do any setUp work in there, so let's remove all these method definitions. Reviewers: labath, JDevlieghere Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71454
* [lldb][NFC] Remove 'from __future__ import print_function' from all tests ↵Raphael Isemann2019-12-1393-95/+0
| | | | | | | | | | | | | | | | | | | | | that don't actually call 'print()' Summary: A lot of tests do this trick but the vast majority of them don't even call `print()`. Most of this patch was generated by a script that just looks at all the files and deletes the line if there is no `print (` or `print(` anywhere else in the file. I checked the remaining tests manually and deleted the import if we never call print (but instead do stuff like `expr print(...)` and similar false-positives). I also corrected the additional empty lines after the import in the files that I manually edited. Reviewers: JDevlieghere, labath, jfb Reviewed By: labath Subscribers: dexonsmith, wuzish, nemanjai, kbarton, christof, arphaman, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71452
* Don't run expect based tests remotely.Jason Molenda2019-12-112-2/+2
|
* Skip TestGuiBasic.py on ios etc device testing.Jason Molenda2019-12-101-0/+1
|
* Skip TestMultilineCompletion.py on ios testsuite runs.Jason Molenda2019-12-101-0/+1
|
* [lldb] Remove Xfail decorators from steadily passing testsMuhammad Omair Javaid2019-12-094-30/+0
| | | | | This patch removes xfail decorator from some lldb testcases which are passing steadily now for past few week/months on aarch64/linux buildbot.
* [lldb] Xfail TestCallOverriddenMethod.py for aarch64/linuxMuhammad Omair Javaid2019-12-091-0/+1
| | | | | | | This test still fails on Linux aarch64. Tested by buildbot running Ubuntu Bionic Differential Revision: https://reviews.llvm.org/D70722
* [lldb/IRExecutionUnit] Stop searching based on demangled namesPavel Labath2019-12-061-1/+0
| | | | | | | | | | | | | | | | | | | | | Summary: This was causing problems on linux, where we'd end up calling the deleting destructor instead of a regular one (because they have the same demangled name), making a lot of mischief in the process. The only place where this was necessary (according to the test suite, at least) was to call a base structor instead of a complete one, but this is now handled in a more targeted fashion. TestCallOverriddenMethod is now re-enabled as it now passes reliably. Reviewers: teemperor, JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70722
* [lldb][NFC] Test going up/down one line in the multiline expression editorRaphael Isemann2019-12-031-0/+67
|
* Mark some tests as xfail on AArch64 LinuxDiana Picus2019-12-031-0/+2
| | | | | | | | | I have either opened new bug reports for these tests, or added links to existing bugs. This should help make the lldb-aarch64-ubuntu buildbot green (there will still be some unexpected passes that someone should look into, but those can be handled later).
* [lldb][NFC] Add 'breakpoint command list' testRaphael Isemann2019-12-022-0/+62
| | | | | | The command has zero test coverage and I'll have to touch the code formatting the output commands, so let's start by adding a test for it.
* [lldb] [Process/NetBSD] Copy watchpoints to newly-created threadsMichał Górny2019-11-251-2/+0
| | | | | | | | | | | | | NetBSD ptrace interface does not populate watchpoints to newly-created threads. Solve this via copying the watchpoints from the current thread when new thread is reported via TRAP_LWP. Add a test that verifies that when the user does not have permissions to set watchpoints on NetBSD, the 'watchpoint set' errors out gracefully and thread monitoring does not crash on being unable to copy watchpoints to new threads. Differential Revision: https://reviews.llvm.org/D70023
* [lldb] [Process/NetBSD] Improve threading supportMichał Górny2019-11-252-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Implement major improvements to multithreaded program support. Notably, support tracking new and exited threads, associate signals and events with correct threads and support controlling individual threads when resuming. Firstly, use PT_SET_EVENT_MASK to enable reporting of created and exited threads via SIGTRAP. Handle TRAP_LWP events to keep track of the currently running threads. Secondly, update the signal (both generic and SIGTRAP) handling code to account for per-thread signals correctly. Signals delivered to the whole process are reported on all threads, while per-thread signals and events are reported only to the specific thread. The remaining threads are marked as 'stopped with no reason'. Note that NetBSD always stops all threads on debugger events. Thirdly, implement the ability to set every thread as running, stopped or single-stepping separately while continuing the process. This also provides the ability to send a signal to the whole process or to one of its thread while resuming. Differential Revision: https://reviews.llvm.org/D70022
* [lldb] Don't enable expression log in TestEmptyStdModule.pyRaphael Isemann2019-11-221-1/+0
| | | | Thanks for pointing this out Jason!
* [lldb][NFC] Remove test directory completelyTatyana Krasnukha2019-11-213-2/+0
| | | | | | The test was moved to "completion-in-lambda-and-unnamed-class" by D66175. + Fix typo in the directory name.
* [lldb] [test] Mark segv-related tests XFAIL on NetBSDMichał Górny2019-11-181-0/+1
| | | | | There seems to be a regression in the kernel causing those tests to fail. Mark them XFAIL, to be addressed later.
* dotest: Add a way for the run_to_* helpers to register dylibsFred Riss2019-11-151-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To run the testsuite remotely the executable needs to be uploaded to the target system. The Target takes care of this by default. When the test uses additional shared libraries, those won't be handled by default and need to be registered with the target using test.registerSharedLibrariesWithTarget(target, dylib). Calling this API requires a target, so it doesn't mesh well with the run_to_* helpers that we've been advertising as the right way to write tests. This patch adds an extra_images argument to all the helpers and does the registration automatically when running a remote testsuite. TestWeakSymbols.py was converted to use this new scheme. Reviewers: jingham Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70134
* Fix TestFormatters.py stepping too farDiana Picus2019-11-152-6/+5
| | | | | | | | | | | | | TestFormatters.py has a sequence of three 'next' commands to get past all the initializations in the test function. On AArch64 (and potentially other platforms), this was one 'next' too many and we ended up outside our frame. This patch replaces the sequence with a 'thread until ' the line of the return from the function, so we should stop after all the initializations but before actually returning. Differential Revision: https://reviews.llvm.org/D70303
* [lldb][test] Macros in expressions require DWARF 5Tatyana Krasnukha2019-11-122-1/+4
|
* [lldb] [test] Un-XFAIL tests that work on NetBSD 9Michał Górny2019-11-093-4/+0
|
* [lldb] Skip parts of TestCallOverriddenMethod.py on LinuxRaphael Isemann2019-11-081-4/+18
| | | | | | The function call and the constructor call fail now several Linux bots (Swift CI, my own bot and Stella's Debian system), so let's disable the relevant test parts until we can figure out why it is failing.
* Modernize TestWeakSymbols MakefileFred Riss2019-11-071-20/+15
|
* [lldb] Add -m option to 'target modules dump symtab' to disable demanglingRaphael Isemann2019-11-072-0/+48
| | | | | | | | | | | | | | Summary: This option was added downstream in swift-lldb. This upstreams this option as it seems useful and also adds the missing tests. Reviewers: #lldb, kwk, labath Reviewed By: kwk, labath Subscribers: labath, kwk, abidh, JDevlieghere, lldb-commits Tags: #lldb, #upstreaming_lldb_s_downstream_patches Differential Revision: https://reviews.llvm.org/D69944
* [lldb] [Process/NetBSD] Add register info for missing register setsMichał Górny2019-11-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | Add info for all register sets supported in NetBSD, particularly for all registers 'expected' by LLDB. This is necessary in order to fix python_api/lldbutil/iter/TestRegistersIterator.py test that currently fails due to missing names of register sets (None). This copies fpreg descriptions from Linux, and combines Linux' AVX and MPX registers into a single XState group, to fit NetBSD register group design. Technically, we do not support MPX registers at the moment but gdb-remote insists on passing their errors anyway, and if we do not include it in any group, they end up in a separate anonymous group that breaks the test. While at it, swap the enums for XState and DBRegs to match register set ordering. This also adds a few consts to the lldb-x86-register-enums.h to provide more consistency between user registers and debug registers. Differential Revision: https://reviews.llvm.org/D69667
* [lldb] Fix offset intersection bug between MPX and AVX registersGuilherme Andrade2019-10-313-0/+82
| | | | | | | | | | | | | | | | | Summary: This change increases the offset of MPX registers (by 128) so they do not overlap with the offset associated with AVX registers. That was causing MPX data in GDBRemoteRegisterContext::m_reg_data to get overwritten. Reviewers: labath Reviewed By: labath Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68874
* [lldb] Add nodebug attribute to import-std-module/sysroot testRaphael Isemann2019-10-231-0/+1
| | | | | | | | | | | | | | | | | | Summary: So far we rely on the default argument and the fact that we don't call this inline function in our actual `main.cpp` to make sure that this function can only be called if LLDB loads this header as a C++ module. This patch just adds the nodebug attribute as yet another measure to make sure LLDB can't call this function without the standard module loaded. Note that the test is already requiring clang for the sysroot setup, so its fine that this is a Clang specific attribute. Reviewers: friss, labath Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68861
* [lldb] Add test for executing static initializers in expression commandRaphael Isemann2019-10-213-0/+45
| | | | llvm-svn: 375422
* convert LLDBSwigPythonCallTypeScript to ArgInfo::max_positional_argsLawrence D'Anna2019-10-192-0/+22
| | | | | | | | | | | | | | | | | | | | Summary: This patch converts another user of ArgInfo::count over to use ArgInfo::max_positional_args instead. I also add a test to make sure both documented signatures for python type formatters work. Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69153 llvm-svn: 375334
* [LLDB] bugfix: command script add -f doesn't work for some callablesLawrence D'Anna2019-10-193-1/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When users define a debugger command from python, they provide a callable object. Because the signature of the function has been extended, LLDB needs to inspect the number of parameters the callable can take. The rule it was using to decide was weird, apparently not tested, and giving wrong results for some kinds of python callables. This patch replaces the weird rule with a simple one: if the callable can take 5 arguments, it gets the 5 argument version of the signature. Otherwise it gets the old 4 argument version. It also adds tests with a bunch of different kinds of python callables with both 4 and 5 arguments. Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69014 llvm-svn: 375333
* [lldb][NFC] Remove wrong tests in TestCallOverriddenMethodRaphael Isemann2019-10-181-4/+0
| | | | | | | | | We call these tests in the second test function where they are x-failed on Windows. I forgot to remove the tests from the first test function (which is not x-failed on Windows) when extracting these calls into their own test function, so the test is still failing on Windows. llvm-svn: 375271
* [lldb] X-fail tests that use constructors in expressions on WindowsRaphael Isemann2019-10-172-1/+19
| | | | | | | | | These tests were testing a bug related to constructors. It seems that on Windows the expression command can't construct objects (or at least, call their constructor explicitly which is required for the tests), so this is just x-failing them until Windows actually supports constructor calls. llvm-svn: 375173
* [lldb] Don't emit artificial constructor declarations as global functionsRaphael Isemann2019-10-174-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | Summary: When we have a artificial constructor DIE, we currently create from that a global function with the name of that class. That ends up causing a bunch of funny errors such as "must use 'struct' tag to refer to type 'Foo' in this scope" when doing `Foo f`. Also causes that constructing a class via `Foo()` actually just calls that global function. The fix is that when we have an artificial method decl, we always treat it as handled even if we don't create a CXXMethodDecl for it (which we never do for artificial methods at the moment). Fixes rdar://55757491 and probably some other radars. Reviewers: aprantl, vsk, shafik Reviewed By: aprantl Subscribers: jingham, shafik, labath, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68130 llvm-svn: 375151
OpenPOWER on IntegriCloud