summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
Commit message (Collapse)AuthorAgeFilesLines
* Skip more lldb-mi tests which time out on DarwinVedant Kumar2018-03-161-0/+3
| | | | | | Bot failure: https://ci.swift.org/job/oss-lldb-incremental-osx/1097/testReport/junit/TestMiTarget/MiTargetTestCase/test_lldbmi_target_attach_wait_for/ llvm-svn: 327692
* Split skipIf decorator, the condition is supposed to be ORAdrian Prantl2018-03-151-1/+2
| | | | llvm-svn: 327644
* [dotest] remove confirm_directory_exclusivity remnantsPavel Labath2018-03-151-13/+0
| | | | llvm-svn: 327643
* Fix TestProcessLaunch breakage on MacOSPavel Labath2018-03-151-1/+1
| | | | | | | | | | | | | This test started failing after r327625. The cause seems difference in the treatment of relative --stdin paths between MacOS (debugserver?) and linux (lldb-server?). Linux treats this as relative to the debuggers PWD, while MacOS as relative to (I think) the future PWD of the launched process. This fixes the issue by using absolute paths, which should work everywhere, but we should probably unify this path handling as well. I'll ask around about what is the expected behavior here. llvm-svn: 327633
* Next batch of test-tree-cleaning changesPavel Labath2018-03-159-171/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The changes here fall into several categories. - some tests were redirecting inferior stdout/err to a file. For these I make sure we use an absolute path for the file. I also create a lldbutil.read_file_on_target helper function to encapsulate the differences between reading a file locally and remotely. - some tests were redirecting the pexpect I/O into a file. For these I use a python StringIO object to avoid creating a file altogether. - the TestSettings inferior was creating a file. Here, I make sure the inferior is launched with pwd=build-dir so that the files end up created there. - lldb-mi --log (used by some tests) creates a log file in PWD without the ability say differently. To make this work I make sure to run lldb-mi with PWD=build_dir. This in turn necessitated a couple of changes in other lldb-mi tests, which were using relative paths to access the source tree. Reviewers: aprantl Subscribers: ki.stfu, mehdi_amini, lldb-commits Differential Revision: https://reviews.llvm.org/D44159 llvm-svn: 327625
* @skipUnlessDarwin TestTargetSourceMapPavel Labath2018-03-151-0/+1
| | | | | | Our MachO parser works only on darwin. llvm-svn: 327611
* Fix a bug in "target.source-map" where we would resolve unmapped paths ↵Greg Clayton2018-03-152-0/+437
| | | | | | | | | | | | | | | | | | incorrectly When using: (lldb) settings set target.source-map ./ /path/to/source LLDB would fail to set a source file and line breakpoint with: (lldb) breakpoint set --file /path/to/source/main.c --line 2 Because code in the target was undoing the remapping of "/path/to/source/main.c" to "./main.c" and then it would resolve this path, which would append the current working directory to the path. We don't want to resolve paths that we unmap. Test case added. Differential Revision: https://reviews.llvm.org/D44502 llvm-svn: 327600
* [Dictionary] Rewrite the test added in r327587 as an inline test.Davide Italiano2018-03-152-0/+13
| | | | | | | | | | | | | | | Until we have a better story for putting commands and check lines in the same file (they're currently ignored), it seems that inline tests are actually more concise and easier to understand. Too bad we have still some python boilerplate, but that's not really substantial so we can live with it. Thanks to Fred for pointing out and Jim for explaining me how to use the inline test format. <rdar://problem/34806516> llvm-svn: 327592
* [test] Skip more lldb-mi tests which occasionally time out on DarwinVedant Kumar2018-03-141-1/+6
| | | | llvm-svn: 327586
* [test] Skip some lldb-mi tests which time out on DarwinVedant Kumar2018-03-142-0/+11
| | | | | | These don't always timeout, but it's inconvenient when they do. llvm-svn: 327568
* [test] Delete some xfailed lldb-mi testsVedant Kumar2018-03-147-638/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a first pass at removing some lldb-mi tests which have been xfailed and unmaintained for a while. We have open PRs for most of these tests already. I've opened up the following additional PRs: llvm.org/PR36739 - lldb-mi driver exits properly llvm.org/PR36740 - lldb-mi -gdb-set and -gdb-show llvm.org/PR36741 - lldb-mi -symbol-xxx The motivation here is to address timeout and pexpect-related issues in the test suite. This was discussed on lldb-dev in the thread: "increase timeout for tests?". After this change, the lldb-mi tests seem to be in better health (on Darwin at least). I consistently get: $ ./bin/llvm-dotest -p TestMi =================== Test Result Summary =================== Test Methods: 101 Reruns: 0 Success: 88 Expected Failure: 0 Failure: 0 Error: 0 Exceptional Exit: 0 Unexpected Success: 0 Skip: 13 Timeout: 0 Expected Timeout: 0 llvm-svn: 327552
* [test] Disable TestMachCore everywhere except on DarwinJonas Devlieghere2018-03-141-0/+1
| | | | | | | | | | Apparently the parser is wrapped inside ifdef's so the logic isn't available on non-Darwin platforms. Should fix build bot failure: http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/20463 llvm-svn: 327512
* Update selected thread after loading mach coreJonas Devlieghere2018-03-143-0/+966
| | | | | | | | | | | The OS plugins might have updated the thread list after a core file has been loaded. The physical thread in the core file may no longer be the one that should be selected. Hence we should run the thread selection logic after loading the core. Differential revision: https://reviews.llvm.org/D44139 llvm-svn: 327501
* Skip TestWatchedVarHitWhenInScope.py everywherePavel Labath2018-03-141-3/+1
| | | | | | | | | | | The expression-hits tracking logic is not available on any platform. The reason this tests happens to pass on some platforms is that the test is written poorly -- it relies on the fact that post-main cleanup code will write to the stack memory once occupied by the watched variable, but this is not the case everywhere (e.g. linux glibc does not seem to do this, but android's bionic library does). llvm-svn: 327483
* [test] Replace some references to Apple-internal bugsVedant Kumar2018-03-1310-32/+14
| | | | | | | This removes around 10 references to Apple-internal radars. I've filed fresh bugs on bugs.llvm.org as appropriate for open issues. llvm-svn: 327463
* Add a missing return in SBPlatform::IsConnected and testJim Ingham2018-03-131-0/+8
| | | | | | | for the behavior - using the fact that the Host platform is always present & connected. llvm-svn: 327448
* Introduce a setting to disable Spotlight while running the test suiteAdrian Prantl2018-03-121-1/+6
| | | | | | | | | | | This is a more principled approach to disabling Spotlight .dSYM lookups while running the testsuite, most importantly it also works for the LIT-based tests, which I overlooked in my initial fix (renaming the test build dir to lldb-tests.noindex). Differential Revision: https://reviews.llvm.org/D44342 llvm-svn: 327330
* Rename clang.modules-cache-path to symbols.clang-modules-cache-pathAdrian Prantl2018-03-102-2/+2
| | | | | | | | I want to extend the properties on ModuleList to also contain other more general settings and renaming the settings category to symbols seems to be the least bad of choices. llvm-svn: 327193
* Make TestCompletion work on windowsPavel Labath2018-03-091-58/+0
| | | | | | | | | | | The test I added in r327110 is failing on windows because of "import pexpect". However, this import is no longer necessary as these tests don't use pexpect anymore. In fact, it seems that all TestCompletion tests are passing on windows after this, so I enable all of them. llvm-svn: 327133
* Move option parsing out of the Args classPavel Labath2018-03-091-26/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The args class is used in plenty of places (a lot of them in the lower lldb layers) for representing a list of arguments, and most of these places don't care about option parsing. Moving the option parsing out of the class removes the largest external dependency (there are a couple more, but these are in static functions), and brings us closer to being able to move it to the Utility module). The new home for these functions is the Options class, which was already used as an argument to the parse calls, so this just inverts the dependency between the two. The functions are themselves are mainly just copied -- the biggest functional change I've made to them is to avoid modifying the input Args argument (getopt likes to permute the argument vector), as it was weird to have another class reorder the entries in Args class. So now the functions don't modify the input arguments, and (for those where it makes sense) return a new Args vector instead. I've also made the addition of a "fake arg0" (required for getopt compatibility) an implementation detail rather than a part of interface. While doing that I noticed that ParseForCompletion function was recording the option indexes in the shuffled vector, but then the consumer was looking up the entries in the unshuffled one. This manifested itself as us not being able to complete "watchpoint set variable foo --" (because getopt would move "foo" to the end). Surprisingly all other completions (e.g. "watchpoint set variable foo --w") were not affected by this. However, I couldn't find a comprehensive test for command argument completion, so I consolidated the existing tests and added a bunch of new ones. Reviewers: davide, jingham, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D43837 llvm-svn: 327110
* [test] Skip a test which sporadically fails in its dsym variantVedant Kumar2018-03-091-0/+2
| | | | | | | | There is a mailing list discussion re: r325927 about why this test fails in the dsym variant. I've marked it skipped for now, until the issue is resolved. llvm-svn: 327089
* [test] Skip a test when using an out-of-tree debugserverVedant Kumar2018-03-085-0/+18
| | | | | | | | | | | | | | | | | | | | The test "test_fp_special_purpose_register_read" in TestRegisters.py fails on Darwin machines configured to use an out-of-tree debugserver. The error message is: 'register read ftag' returns expected result, got 'ftag = 0x80'. This indicates that the debugserver in use is too old. This commit introduces a decorator which can be used to skip tests which rely on having a just-built debugserver. This resolves the issue: $ ./bin/llvm-dotest -p TestRegisters.py -v 1 out of 617 test suites processed - TestRegisters.py Test Methods: 7 Success: 6 Skip: 1 ... llvm-svn: 327052
* [LLDB][PPC64] Fix single step and LldbGdbServer testsPavel Labath2018-03-083-6/+11
| | | | | | | | | | | | | | | | | | Summary: On PPC64, the tested functions were being entered through their local entry point, while the tests expected the program to stop at the function start address, that, for PPC64, corresponds to the global entry point. To fix the issue, the test program was modified to call the functions to be tested through function pointers, which, on PPC64, force the calls through the global entry point, while not affecting the test on other platforms. Reviewers: clayborg, labath Reviewed By: labath Subscribers: alexandreyy, lbianc Differential Revision: https://reviews.llvm.org/D43768 Patch by Leandro Lupori <leandro.lupori@gmail.com>. llvm-svn: 327013
* Add test for lldb-mi interpreterAdrian Prantl2018-03-062-0/+39
| | | | | | | | | | Test that "lldb-mi --interpreter" can interpret "target list" CLI command. Patch by Alex Polyakov! Differential Revision: https://reviews.llvm.org/D44040 llvm-svn: 326847
* Rewrite TestTargetSymbolsBuildidCase to be more focusedPavel Labath2018-03-063-45/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The test was failing in remote debugging scenario with windows as a host as cmd.exe is not able to parse the complicated shell commands in the Makefile. The test seemed like a perfect candidate for a more focused testing approach, so I have rewritten in on top of lldb-test's module-sections functionality. The slight gotcha there was that the Module::GetSectionList does not include the sections from the symbol file until someone manually calls Module::GetSymbolVendor. Normally, this is not an issue, because someone will have initialized the symbol vendor by the time anyone starts looking at the sections. However, when all one this is dump the section list, we run into this problem. I've tried making this behavior more automatic, but it turns out it's not that easy, so for now, I just manually initialize the Symbol Vendor before dumping out the sections in lldb-test. Reviewers: jankratochvil Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D42914 llvm-svn: 326805
* [LLDB][PPC64] Fixed issues with expedited registersPavel Labath2018-03-061-0/+2
| | | | | | | | | | | | | | | | | Summary: - reg_nums were missing the end marker entry - marked FP test to be skipped for ppc64 Reviewers: labath, clayborg Reviewed By: labath, clayborg Subscribers: alexandreyy, lbianc, nemanjai, kbarton Differential Revision: https://reviews.llvm.org/D43767 Patch by Leandro Lupori <leandro.lupori@gmail.com> llvm-svn: 326775
* Upstreaming avx512 register support in debugserver. These changesJason Molenda2018-03-064-19/+241
| | | | | | | | | | | | | | | | | | | were originally written by Chris Bieneman, they've undergone a number of changes since then. Also including the debugserver bridgeos support, another arm environment that runs Darwin akin to ios. These codepaths are activated when running in a bridgeos environment which we're not set up to test today. There's additional (small) lldb changes to handle bridgeos binaries that still need to be merged up. Tested on a darwin system with avx512 hardware and without. <rdar://problem/36424951> llvm-svn: 326756
* [test] Skip pexpect-based lldb-mi tests on DarwinVedant Kumar2018-03-054-1/+20
| | | | | | | | | | | | | | | These tests fail with a relatively frequently on Darwin machines with errors such as: File ".../lldb/third_party/Python/module/pexpect-2.4/pexpect.py", line 1444, in expect_loop raise EOF(str(e) + '\n' + str(self)) EOF: End Of File (EOF) in read_nonblocking(). Empty string style platform. The unpredictable failures make these tests noisy. rdar://37046976 llvm-svn: 326739
* Including <functional> for std::bindRaphael Isemann2018-03-051-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D44099 llvm-svn: 326727
* Mark ObjC testcase as skipUnlessDarwin and fix a typo in test function.Adrian Prantl2018-03-021-1/+2
| | | | llvm-svn: 326640
* Don't compile testcase with clang modules enabled.Adrian Prantl2018-03-022-2/+1
| | | | | | | It isn't actually necessary for what we are testing here and should fix the test on the Linux bots. llvm-svn: 326634
* Make the clang module cache setting available without a targetAdrian Prantl2018-03-026-2/+55
| | | | | | | | | | | | | | | It turns out that setting the clang module cache after LLDB has a Target can be too late. In particular, the Swift language plugin needs to know the setting without having access to a Target. This patch moves the setting into the *LLDB* module cache, where it is a global setting that is available before any Target is created and more importantly, is shared between all Targets. rdar://problem/37944432 Differential Revision: https://reviews.llvm.org/D43984 llvm-svn: 326628
* [testsuite] Remove workaround for categories and inline tests.Jonas Devlieghere2018-03-021-9/+6
| | | | | | | | | | | | | | | | Adding categories to inline tests does not work because the attribute is set at the function level. For methods, this means it applies to all instances of that particular class. While this is what we want in most cases, it's not for inline tests, where different instances correspond to different tests. With the workaround in place, assigning a category to one test resulted in the category applied to *all* inline tests. This patch removes the workaround and throws an exception with an informative error message, to prevent this from happening in the future. llvm-svn: 326552
* Speed up TestWatchpointMultipleThreadsPavel Labath2018-03-022-120/+41
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The inferior was sleeping before doing any interesting work. I remove that to make the test faster. While looking at the purpose of the test (to check that watchpoints are propagated to all existing threads - r140757) I noticed that the test has diverged from the original intention and now it creates the threads *after* the watchpoint is set (this probably happened during the std::thread refactor). After some discussion, we decided both scenarios make sense, so I modify the test to test both. The watchpoint propagation functionality is not really debug info depenent, so I also stop replication of this test. This brings the test's time from ~108s down to 4s. Reviewers: davide, jingham Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D43857 llvm-svn: 326514
* Make TestDynamicValueSameBase gcc-compatiblePavel Labath2018-03-011-3/+7
| | | | | | | | | | gcc will say that the type of "this" is "T * const", clang "T *". Compare the unqualified type names to erase the difference between the two, as the constness is not a part of this test. FWIW, I think that the gcc behavior makes more sense here. llvm-svn: 326449
* [test] Restore cleanup behavior in TestQuoting.pyVedant Kumar2018-03-011-1/+1
| | | | | | | | | | Before the change to compile tests out-of-tree, the cleanup classmethod in TestQuoting.py would remove a temp file. After the change it threw an exception due to a malformed call to getBuildArtifact(). Bring back the old behavior. llvm-svn: 326414
* We were getting the wrong dynamic type if there were two classes with the ↵Jim Ingham2018-03-013-0/+99
| | | | | | | | | | | | | | same basename. There's a bug in FindTypes, it ignores the exact flag if you pass a name that doesn't begin with :: and pass eTypeClassAny for the type. In this case we always know that the name we get from the vtable name is absolute so we can work around the bug by prepending the "::". This doesn't fix the FindTypes bug. <rdar://problem/38010986> llvm-svn: 326412
* Adapt some tests to work with PPC64le architecturePavel Labath2018-02-284-4/+7
| | | | | | | | | | | | | | | Summary: Merge branch 'master' into adaptPPC64tests Reviewers: clayborg, alexandreyy, labath Reviewed By: clayborg, alexandreyy Subscribers: luporl, lbianc, alexandreyy, lldb-commits Differential Revision: https://reviews.llvm.org/D42917 Patch by Ana Julia Caetano <ana.caetano@eldorado.org.br>. llvm-svn: 326369
* Revert "[lldb] Use vFlash commands when writing to target's flash memory ↵Pavel Labath2018-02-281-61/+0
| | | | | | | | | | | | regions" This reverts commit r326261 as it introduces inconsistencies in the handling of load addresses for ObjectFileELF -- some parts of the class use physical addresses, and some use virtual. This has manifested itself as us not being able to set the load address of the vdso "module" on android. llvm-svn: 326367
* Fix lldbinline tests for remote targetsPavel Labath2018-02-271-1/+1
| | | | | | | | | | r326140 exposed the fact that we are not actually running inline tests on remote targets. The tests fail to launch the inferior in the first place because they passed an invalid working directory to the launch function. This should fix that. llvm-svn: 326264
* [lldb] Use vFlash commands when writing to target's flash memory regionsPavel Labath2018-02-271-0/+61
| | | | | | | | | | | | | | | | | | | | | | Summary: When writing an object file over gdb-remote, use the vFlashErase, vFlashWrite, and vFlashDone commands if the write address is in a flash memory region. A bare metal target may have this kind of setup. - Update ObjectFileELF to set load addresses using physical addresses. A typical case may be a data section with a physical address in ROM and a virtual address in RAM, which should be loaded to the ROM address. - Add support for querying the target's qXfer:memory-map, which contains information about flash memory regions, leveraging MemoryRegionInfo data structures with minor modifications - Update ProcessGDBRemote to use vFlash commands in DoWriteMemory when the target address is in a flash region Original discussion at http://lists.llvm.org/pipermail/lldb-dev/2018-January/013093.html Reviewers: clayborg, labath Reviewed By: labath Subscribers: arichardson, emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D42145 Patch by Owen Shaw <llvm@owenpshaw.net> llvm-svn: 326261
* Move TestGdbRemoteExitCode next to the other llgs testsPavel Labath2018-02-273-363/+0
| | | | | | | This test contained a copy of the inferior used by most of llgs test. This was done to enable better paralelization, but now it's irrelevant. llvm-svn: 326218
* Mark test_*int*_t_dwarf as failing on FreeBSDEd Maste2018-02-271-0/+9
| | | | | | | | | | | | Further investigation required; tests will be enabled on the buildbot worker soon. Marking failing tests for now in order to start with a green buildbot while investigation takes place. This is a recommit of r326134, with the required import added. llvm.org/pr36527 llvm-svn: 326166
* Move "concurrent events" tests back into one folderPavel Labath2018-02-2771-348/+4
| | | | | | | | | These tests all test very similar things, and use the same inferior. They were only placed in separate folders to achieve better paralelization. Now that we paralelize at a file level, this is no longer relevant, and we can put them together again. llvm-svn: 326159
* Add a sanity check for inline testcases.Adrian Prantl2018-02-262-0/+10
| | | | | | | | | | | When writing an inline test, there is no way to make sure that any of the inline commands are actually executed, so this patch adds a sanity check that at least one breakpoint was hit. This avoids a test with no breakpoints being hit passing. Differential Revision: https://reviews.llvm.org/D43694 llvm-svn: 326140
* Revert r326134 due to broken buildbotEd Maste2018-02-261-8/+0
| | | | llvm-svn: 326139
* Mark test_*int*_t_dwarf as failing on FreeBSDEd Maste2018-02-261-0/+8
| | | | | | | | | | Further investigation required; tests will be enabled on the buildbot worker soon. Marking failing tests for now in order to start with a green buildbot while investigation takes place. llvm.org/pr36527 llvm-svn: 326134
* Partial fix for TestConflictingSymbol.py on WindowsAdrian McCarthy2018-02-263-4/+4
| | | | | | | | | | | | | | | | | Without this fix, the test ERRORs because the link of the inferior fails. This patch adds the LLDB_TEST_API macro where needed and uses the new -2 magic value for num_expected_locations to account for lazy-loading of module symbols on Windows. With this fix, the test itself still fails: conflicting_symbol isn't in the debug info nor the export table, and Windows binaries don't have an equivalent of the ELF .symtab. We need to understand why the test works to keep the symbol out of the debug info. In the mean time, having the test fail at this point is a better indication of the remaining problem than a build error. Differential Revision: https://reviews.llvm.org/D43688 llvm-svn: 326130
* Add "lldb-test breakpoint" command and convert the case-sensitivity test to ↵Pavel Labath2018-02-263-143/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use it Summary: The command takes two input arguments: a module to use as a debug target and a file containing a list of commands. The command will execute each of the breakpoint commands in the file and dump the breakpoint state after each one. The commands are expected to be breakpoint set/remove/etc. commands, but I explicitly allow any lldb command here, so you can do things like change setting which impact breakpoint resolution, etc. There is also a "-persistent" flag, which causes lldb-test to *not* automatically clear the breakpoint list after each command. Right now I don't use it, but the idea behind it was that it could be used to test more complex combinations of breakpoint commands (set+modify, set+disable, etc.). Right now the command prints out only the basic breakpoint state, but more information can be easily added there. To enable easy matching of the "at least one breakpoint location found" state, the command explicitly prints out the string "At least one breakpoint location.". To enable testing of breakpoints set with an absolute paths, I add the ability to perform rudimentary substitutions on the commands: right now the string %p is replaced by the directory which contains the command file (so, under normal circumstances, this will perform the same substitution as lit would do for %p). I use this command to rewrite the TestBreakpointCaseSensitivity test -- the test was checking about a dozen breakpoint commands, but it was launching a new process for each one, so it took about 90 seconds to run. The new test takes about 0.3 seconds for me, which is approximately a 300x speedup. Reviewers: davide, zturner, jingham Subscribers: luporl, lldb-commits Differential Revision: https://reviews.llvm.org/D43686 llvm-svn: 326112
* Fix tabs/spaces indentation problem in TestUnicodeSymbols.pyAdrian McCarthy2018-02-261-7/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D43705 llvm-svn: 326095
OpenPOWER on IntegriCloud