summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events
Commit message (Collapse)AuthorAgeFilesLines
* [lldb][NFC] Remove 'from __future__ import print_function' from all tests ↵Raphael Isemann2019-12-1335-35/+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
* [lldb] Remove Xfail decorators from steadily passing testsMuhammad Omair Javaid2019-12-091-1/+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] [Process/NetBSD] Fix handling concurrent watchpoint eventsMichał Górny2019-11-255-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix handling concurrent watchpoint events so that they are reported correctly in LLDB. If multiple watchpoints are hit concurrently, the NetBSD kernel reports them as series of SIGTRAPs with a thread specified, and the debugger investigates DR6 in order to establish which watchpoint was hit. This is normally fine. However, LLDB disables and reenables the watchpoint on all threads after each hit, which results in the hit status from DR6 being wiped. As a result, it can't establish which watchpoint was hit in successive SIGTRAP processing. In order to workaround this problem, clear DR6 only if the breakpoint is overwritten with a new one. More specifically, move cleaning DR6 from ClearHardwareWatchpoint() to SetHardwareWatchpointWithIndex(), and do that only if the newly requested watchpoint is different from the one being set previously. This ensures that the disable-enable logic of LLDB does not clear watchpoint hit status for the remaining threads. This also involves refactoring of watchpoint logic. With the old logic, clearing watchpoint involved wiping dr6 & dr7, and setting it setting dr{0..3} & dr7. With the new logic, only enable bit is cleared from dr7, and the remaining bits are cleared/overwritten while setting new watchpoint. Differential Revision: https://reviews.llvm.org/D70025
* [lldb] [Process/NetBSD] Copy watchpoints to newly-created threadsMichał Górny2019-11-259-9/+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-2512-12/+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
* [CMake] Copy over the system debugserver when using LLDB_USE_SYSTEM_DEBUGSERVERJonas Devlieghere2019-09-244-0/+4
| | | | | | | | | | | | | | | | r366433 broke support for the system debugserver. Although the change was well-intended, it (presumably) unintentionally removed the logic to copy over the debugserver. As a result, even with LLDB_USE_SYSTEM_DEBUGSERVER enabled, we ended up building, signing and using the just-built debugserver. This patch partially recovers the old behavior: when LLDB_USE_SYSTEM_DEBUGSERVER is set we don't build debugserver and just copy over the system one. Differential revision: https://reviews.llvm.org/D67991 llvm-svn: 372786
* [dotest] Avoid the need for LEVEL= makefile boilerplatePavel Labath2019-09-041-3/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: Instead of each test case knowing its depth relative to the test root, we can just have dotest add the folder containing Makefile.rules to the include path. This was motivated by r370616, though I have been wanting to do this ever since we moved to building tests out-of-tree. The only manually modified files in this patch are lldbinline.py and plugins/builder_base.py. The rest of the patch has been produced by this shell command: find . \( -name Makefile -o -name '*.mk' \) -exec sed --in-place -e '/LEVEL *:\?=/d' -e '1,2{/^$/d}' -e 's,\$(LEVEL)/,,' {} + Reviewers: teemperor, aprantl, espindola, jfb Subscribers: emaste, javed.absar, arichardson, christof, arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D67083 llvm-svn: 370845
* [lldb] [test] Mark 'reenabled' tests XFAIL on NetBSDMichal Gorny2019-09-044-0/+4
| | | | llvm-svn: 370842
* [test] Disable TestConcurrentManySignals on Darwin.Jonas Devlieghere2019-08-281-0/+2
| | | | | | This test is flaky on GreenDragon. Disable it until we figure out why. llvm-svn: 370136
* [dotest] Remove long running test "decorator" and re-enable tests.Jonas Devlieghere2019-08-274-12/+0
| | | | | | | | | | | | Today I discovered the skipLongRunningTest decorator and to my surprise all the tests were passing without the decorator. They don't seem to be that expensive either, they take a few seconds but we have tests that take much longer than that. As such I propose to remove the decorator and enable them by default. Differential revision: https://reviews.llvm.org/D66774 llvm-svn: 369995
* [lldb] [test] Mark failing tests XFAIL on NetBSDMichal Gorny2019-03-0431-0/+31
| | | | | | | | | | | | | | | | Add a convenience 'expectedFailureNetBSD' decorator and mark all tests currently failing on NetBSD with it. Also skip a few tests that hang the test suite. This should establish a baseline for the test suite and get us closer to enabling tests on buildbot. This will help us catch regressions while we still have a lot of work to do to get tests working. It seems that there are also some flaky tests. I am going to address them later on. Differential Revision: https://reviews.llvm.org/D58527 llvm-svn: 355320
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Move "concurrent events" tests back into one folderPavel Labath2018-02-2770-344/+1
| | | | | | | | | 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
* Compile the LLDB tests out-of-tree.Adrian Prantl2018-01-3035-70/+105
| | | | | | | | | | | | | | | | | | | | | | | | This patch is the result of a discussion on lldb-dev, see http://lists.llvm.org/pipermail/lldb-dev/2018-January/013111.html for background. For each test (should be eventually: each test configuration) a separate build directory is created and we execute make VPATH=$srcdir/path/to/test -C $builddir/path/to/test -f $srcdir/path/to/test/Makefile -I $srcdir/path/to/test In order to make this work all LLDB tests need to be updated to find the executable in the test build directory, since CWD still points at the test's source directory, which is a requirement for unittest2. Although we have done extensive testing, I'm expecting that this first attempt will break a few bots. Please DO NOT HESITATE TO REVERT this patch in order to get the bots green again. We will likely have to iterate on this some more. Differential Revision: https://reviews.llvm.org/D42281 llvm-svn: 323803
* Xfail TestConcurrentTwoWatchpointsOneSignal on armPavel Labath2017-11-081-0/+1
| | | | | | | r317561 exposed an interesting bug (pr35228) in handling of simultaneous watchpoint hits. Disabling the test until we can get that fixed. llvm-svn: 317683
* "Fix" concurrent events test for armPavel Labath2017-11-0721-22/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The test incremented an atomic varible to trigger the watchpoint event. On arm64 this compiled to a ldaxr/stlxr loop, with the watchpoint being triggered in the middle of the loop. Hitting the watchpoint resets the exclusive monitor, and forces the process to loop one more time, hitting the watchpoint again, etc. While it would be nice if the debugger was able to resume from this situation, this is not trivial, and is not what this test is about. Therefore, I propose to change this to a simple store to a normal variable (which should still trip the watchpoint everywhere, but without atomic loops) and file a bug to investigate the possibilities of handling the watchpoints in atomic loops in a more reasonable way. Reviewers: clayborg Subscribers: aemerson, kristof.beyls, lldb-commits Differential Revision: https://reviews.llvm.org/D39680 llvm-svn: 317561
* Fix classifications on two concurrent event testsPavel Labath2017-11-032-1/+1
| | | | | | | I have classified one as a watchpoint test even though it wasn't and vice versa. Fix that. llvm-svn: 317319
* Remove android watchpoint xfailsPavel Labath2017-11-022-2/+0
| | | | | | | | Now that the wathpoint tests have their own category, we can easily skip them on devices which don't have watchpoint support. Therefore, we don't need an android xfail on each of these tests. llvm-svn: 317276
* Add a "watchpoint" test category and annotate tests appropriatelyPavel Labath2017-10-3121-0/+21
| | | | | | | | | | | Most of the watchpoint tests are organized into subtrees, so we can use the file-based .categories approach to annotate them. The exception are the concurrent_events tests, which needed to be annotated on a per-test basis. The motivation behind this is to provide an easy way to disable watchpoint tests on systems where the watchpoint functionality is not present/unreliable. llvm-svn: 317004
* XFAIL/XFlakey some tests what become very flakey on the Linux buildbotTamas Berghammer2017-07-272-0/+2
| | | | llvm-svn: 309265
* Centralize libc++ test skipping logicPavel Labath2017-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This aims to replace the different decorators we've had on each libc++ test with a single solution. Each libc++ will be assigned to the "libc++" category and a single central piece of code will decide whether we are actually able to run libc++ test in the given configuration by enabling or disabling the category (while giving the user the opportunity to override this). I started this effort because I wanted to get libc++ tests running on android, and none of the existing decorators worked for this use case: - skipIfGcc - incorrect, we can build libc++ executables on android with gcc (in fact, after this, we can now do it on linux as well) - lldbutil.skip_if_library_missing - this checks whether libc++.so is loaded in the proces, which fails in case of a statically linked libc++ (this makes copying executables to the remote target easier to manage). To make this work I needed to split out the pseudo_barrier code from the force-included file, as libc++'s atomic does not play well with gcc on linux, and this made every test fail, even though we need the code only in the threading tests. So far, I am only annotating one of the tests with this category. If this does not break anything, I'll proceed to update the rest. Reviewers: jingham, zturner, EricWF Subscribers: srhines, lldb-commits Differential Revision: https://reviews.llvm.org/D30984 llvm-svn: 299028
* Use shorter names in TestConcurrentEvents testsPavel Labath2016-10-2435-35/+35
| | | | | | | | | Otherwise, they tend to generate filename too long errors. They already contain the same test name in the directory, file, and class names, so no information is really lost here. llvm-svn: 284987
* [LLDB][MIPS] Skip some test case which were causing LLDB to go into infinite ↵Nitesh Jain2016-10-1035-35/+35
| | | | | | | | | | | | loop Reviewers: clayborg, labath Subscribers: jaydeep, bhushan, slthakur, llvm-commits Differential Revision: https://reviews.llvm.org/D24549 llvm-svn: 283732
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0635-156/+148
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Breakup TestConcurrentEvents.py into separate test subdirs per test methodTodd Fiala2016-07-2271-526/+1123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change breaks up the monolithic TestConcurrentEvents.py into a separate subdir per test method. This allows them to run concurrently, reduces the chance of a timeout occurring during normal operation, and allows us to home in on any test methods that may be locking up. This is step one in the process of squashing timeouts in these test methods. The reason for breaking each test method into its own file is to make it very clear to us if there are a subset of the tests that do in fact lock up frequently. This will limit how much hunting we need to do to recreate it. The reason for putting each file in a separate subdirectory is so that our concurrent test runner can run multiple test files at the same time. The unit of serialization in the LLDB test suite is the test directory, so moving them into separate directories enables the test runner to do more at the same time. This change introduces usage of VPATH from gnu make. I use that to facilitate keeping a single copy of the main.cpp in the parent concurrent_events directory. Initially I had tried specifying the source file as ../main.cpp, but our current makefile rules get confused by that and then also build the output into the parent directory, which defeats the ability to run each of the test methods concurrently. In the event that not all systems support VPATH, I can do a bit of surgery on the Makefile rules and attempt to make it smarter with regards to relative paths to source files used in the build. llvm-svn: 276478
* Fix race in TestExitDuringStep and unify pseudo_barrier handlingPavel Labath2016-05-101-13/+1
| | | | | | | | | | | | | | | | | | Summary: TestExitDuringStep was very rarely hanging on the buildbots. I can't be sure, but I believe this was because of the fact that it declared its pseudo_barrier variable as "volatile int", which is not sufficient to guarantee corectness (also, all other tests used atomic variables for this, and they were passing reliably AFAIK). Besides switching to an atomic variable in this test as well, I have also took this opportunity to unify all the copies of the pseudo_barrier code to a single place to reduce the chance of this happening again. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D20065 llvm-svn: 269025
* [LLDB][MIPS] Fix TestConcurrentEventsMohit K. Bhakkad2016-04-181-35/+35
| | | | | | | | | | Patch by Nitesh Jain Reviewers: clayborg Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar Differential Revision: http://reviews.llvm.org/D18389 llvm-svn: 266589
* Move some of the common decorators to decorators.py.Zachary Turner2016-02-041-1/+2
| | | | | | | | | | | | This doesn't attempt to move every decorator. The reason for this is that it requires touching every single test file to import decorators.py. I would like to do this in a followup patch, but in the interest of keeping the patches as bite-sized as possible, I've only attempted to move the underlying common decorators first. A few tests call these directly, so those tests are updated as part of this patch. llvm-svn: 259807
* Enable TestConcurrentEvents on i386 linuxPavel Labath2016-01-201-1/+0
| | | | | | The test has been passing reliably the last 100 runs of the build bot. llvm-svn: 258304
* Fix decoration of TestConcurrentEventsPavel Labath2016-01-151-1/+35
| | | | | | | | | | TestConcurrentEvents was marked with a XFAIL decorator at class level, which actually does not work, and causes the class to be silently skipped everywhere. It seems that making it work at class level is quite a difficult task, so I will just move it to the individual test methods. I will follow this up with a commit which makes the decorator blow up in case someone tries to apply it to a class in the future. llvm-svn: 257901
* [LLDB][MIPS] Mark TestConcurrentEvents.py expected failure, as MIPS atomic ↵Mohit K. Bhakkad2015-12-141-0/+1
| | | | | | | | | | sequences are yet to be supported in LLDB Reviewers: jaydeep. Subscribers: lldb-commits. Differential Revision: http://reviews.llvm.org/D15488 llvm-svn: 255488
* Remove `use_lldb_suite` from the package, and don't import it anymore.Zachary Turner2015-11-031-1/+1
| | | | | | | | | | | | | | | | This module was originally intended to be imported by top-level scripts to be able to find the LLDB packages and third party libraries. Packages themselves shouldn't need to import it, because by the time it gets into the package, the top-level script should have already done this. Indeed, it was just adding the same values to sys.path multiple times, so this patch is essentially no functional change. To make sure it doesn't get re-introduced, we also delete the `use_lldb_suite` module from `lldbsuite/test`, although the original copy still remains in `lldb/test` llvm-svn: 251963
* Tighten up sys.path, and use absolute imports everywhere.Zachary Turner2015-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | For convenience, we had added the folder that dotest.py was in to sys.path, so that we could easily write things like `import lldbutil` from anywhere and any test. This introduces a subtle problem when using Python's package system, because when unittest2 imports a particular test suite, the test suite is detached from the package. Thus, writing "import lldbutil" from dotest imports it as part of the package, and writing the same line from a test does a fresh import since the importing module was not part of the same package. The real way to fix this is to use absolute imports everywhere. Instead of writing "import lldbutil", we need to write "import lldbsuite.test.util". This patch fixes up that and all other similar cases, and additionally removes the script directory from sys.path to ensure that this can't happen again. llvm-svn: 251886
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-283-0/+697
This is the conclusion of an effort to get LLDB's Python code structured into a bona-fide Python package. This has a number of benefits, but most notably the ability to more easily share Python code between different but related pieces of LLDB's Python infrastructure (for example, `scripts` can now share code with `test`). llvm-svn: 251532
OpenPOWER on IntegriCloud