summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/attach_resume/TestAttachResume.py
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-281-70/+0
| | | | | | | | | | | 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
* Rename `lldb_shared` to `use_lldb_suite`.Zachary Turner2015-10-271-1/+1
| | | | llvm-svn: 251444
* Fix race condition in process resumePavel Labath2015-10-271-1/+0
| | | | | | | | | | | | | | | | | | Summary: Gdb-remote's async thread sent out the eBroadcastBitRunPacketSent message *before* actually sending out the continue packet. Since it's this message the actually triggers the public state transition, it could happen (and it did happen in TestAttachResume, which does an "process interrupt" right after a continue) that we attempt to stop the inferior before it was actually started (which obviously did not end well). This fixes the problem by moving the broadcast after the packet was actually sent. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14083 llvm-svn: 251399
* Add from __future__ import print_function everywhere.Zachary Turner2015-10-231-0/+2
| | | | | | | | | | | | | Apparently there were tons of instances I missed last time, I guess I accidentally ran 2to3 non-recursively. This should be every occurrence of a print statement fixed to use a print function as well as from __future__ import print_function being added to every file. After this patch print statements will stop working everywhere in the test suite, and the print function should be used instead. llvm-svn: 251121
* Update every test to import `lldb_shared`.Zachary Turner2015-10-221-7/+2
| | | | | | | | | | | | | | | | | | | | | This is necessary in order to allow third party modules to be located under lldb/third_party rather than under the test folder directly. Since we're already touching every test file anyway, we also go ahead and delete the unittest2 import and main block wherever possible. The ability to run a test as a standalone file has already been broken for some time, and if we decide we want this back, we should use unittest instead of unittest2. A few places could not have the import of unittest2 removed,because they depend on the unittest2.expectedFailure or skip decorators. Removing all those was orthogonal in spirit to the purpose of this CL, so the import of unittest2 remains in those files that were using it for its test decorators. Those can be addressed separately. llvm-svn: 251055
* TestAttachResume is still flaky on linux. mark it as suchPavel Labath2015-10-121-0/+1
| | | | llvm-svn: 250069
* Resumbit "Fix race condition during process detach"Pavel Labath2015-10-071-1/+0
| | | | | | | This is a resubmission of r248371. It also incorporates the process event hijack patch by Kyrill Lapshin in D12968. llvm-svn: 249554
* Merge dwarf and dsym testsTamas Berghammer2015-09-301-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently most of the test files have a separate dwarf and a separate dsym test with almost identical content (only the build step is different). With adding dwo symbol file handling to the test suit it would increase this to a 3-way duplication. The purpose of this change is to eliminate this redundancy with generating 2 test case (one dwarf and one dsym) for each test function specified (dwo handling will be added at a later commit). Main design goals: * There should be no boilerplate code in each test file to support the multiple debug info in most of the tests (custom scenarios are acceptable in special cases) so adding a new test case is easier and we can't miss one of the debug info type. * In case of a test failure, the debug symbols used during the test run have to be cleanly visible from the output of dotest.py to make debugging easier both from build bot logs and from local test runs * Each test case should have a unique, fully qualified name so we can run exactly 1 test with "-f <test-case>.<test-function>" syntax * Test output should be grouped based on test files the same way as it happens now (displaying dwarf/dsym results separately isn't preferable) Proposed solution (main logic in lldbtest.py, rest of them are test cases fixed up for the new style): * Have only 1 test fuction in the test files what will run for all debug info separately and this test function should call just "self.build(...)" to build an inferior with the right debug info * When a class is created by python (the class object, not the class instance), we will generate a new test method for each debug info format in the test class with the name "<test-function>_<debug-info>" and remove the original test method. This way unittest2 see multiple test methods (1 for each debug info, pretty much as of now) and will handle the test selection and the failure reporting correctly (the debug info will be visible from the end of the test name) * Add new annotation @no_debug_info_test to disable the generation of multiple tests for each debug info format when the test don't have an inferior Differential revision: http://reviews.llvm.org/D13028 llvm-svn: 248883
* Revert "Fix race condition during process detach"Pavel Labath2015-09-281-0/+1
| | | | | | This fix is not correct on its own until D12968 is resolved. Will resumbit once that is done. llvm-svn: 248702
* Fix race condition during process detachPavel Labath2015-09-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The following situation occured in TestAttachResume: The inferior was stoped at a breakpoint and we did a continue, immediately followed by a detach. Since there was a trap instruction under the IP, the continue did a step-over-breakpoint before resuming the inferior for real. In some cases, the detach command was executed between these two events (after the step-over stop, but before continue). Here, public state was running, but private state was stopped. This caused a problem because HaltForDestroyOrDetach was checking the public state to see whether it needs to stop the process (call Halt()), but Halt() was checking the private state and concluded that there is nothing for it to do. Solution: Instead of Halt() call SendAsyncInterrupt(), which will then cause Halt() to be executed in the context of the private state thread. I also rename HaltForDestroyOrDetach to reflect it does not call halt directly. Reviewers: jingham, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13056 llvm-svn: 248371
* XFAIL miscellaneous tests on windows.Zachary Turner2015-09-111-0/+1
| | | | | | llvm.org/pr24778 llvm-svn: 247460
* Demote TestAttachResume back to @expectedFailureFreeBSDEd Maste2015-09-111-1/+1
| | | | | | | | It turns out it fails consistently for me. llvm.org/pr19310 llvm-svn: 247411
* Update expectedFailureFreeBSD to expectedFlakeyFreeBSD for intermittent testsEd Maste2015-09-091-1/+1
| | | | | | | | | | | Due to LLDB or test race conditions these tests do not pass consistently. llvm.org/pr15037 llvm.org/pr19310 llvm.org/pr22611 llvm-svn: 247143
* Mark TestAttachResume as flaky on linuxPavel Labath2015-09-031-0/+1
| | | | | | | There is a more race condition regarding process detach, which this test exposes, marking as flaky until it is fixed. llvm-svn: 246777
* Address flakyness in TestAttachResumePavel Labath2015-09-021-42/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The test (among other things) attempts to verify that detaching works while the inferior is running. However, this was racy since the inferior could end up stopping again before we got a chance to detach from it (the test could be made to fail reliably by inserting a sleep just after the last "continue" command). The reason for the stop was that we had a breakpoint set in a place that can be hit by multiple threads, and we stop because another thread hit a breakpoint. I fix this by moving the breakpoint to a place that is reachable from only one thread. I also make sure that the same thread cannot hit the breakpoint if we are exceptionaly slow by flipping a flag which makes the breakpoint unreachable (I cannot just disable or delete the breakpoint as the test makes it a point to try detaching while breakpoints are still set). Another source or racyness was that the test verified that the process resumes and stops after a "continue". However, if these two events happened too fast, the initial start event would be lost, and the test would end up confused. I have implemented this in a safer manner and made a utility function out of it, as I know of a couple of other tests which need the same functionality. Reviewers: zturner, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12527 llvm-svn: 246623
* Mark AttachResumeTestCase as flakyTamas Berghammer2015-06-291-0/+1
| | | | llvm-svn: 240962
* Added expectedFlakey test decoratorVince Harron2015-06-261-1/+1
| | | | | | | | | | | | | | | | | SUMMARY Flakey tests get two chances to pass Also, switched a bunch of tests to use new decorator. TEST PLAN Add one of these decorators to a test Edit a test to pass on the first invocation, confirm test appears as pass Edit a test to pass on the first invocation, pass on the second, confirm test appears as xfail Edit a test to fail on two consecutive runs, confirm test appears in results as fail/error Differential Revision: http://reviews.llvm.org/D10721 llvm-svn: 240789
* Enabled a bunch of tests on LinuxVince Harron2015-03-311-1/+1
| | | | | | | | | Removed expectedFailureLinux from failures that I was unable to reproduce, updated and improved some other comments near XFAIL tests Differential Revision: http://reviews.llvm.org/D8676 llvm-svn: 233716
* Fix this test to set a breakpoint at the correct location that will always ↵Greg Clayton2014-11-031-1/+1
| | | | | | get hit so it doesn't intermittently fail on MacOSX. llvm-svn: 221201
* The breakpoint location hit counts were getting incremented inJim Ingham2014-10-221-1/+5
| | | | | | | | | | | | | | | BreakpointLocation::ShouldStop. That worked but wasn't really right, since there's nothing to guarantee that won't get called more than once. So this change moves that responsibility to the StopInfoBreakpoint directly, and then it uses the BreakpointSite to actually do the bumping. Also fix a test case that was assuming if you had many threads running some code with a breakpoint in it, the hit count when you stopped would always be 1. Many of the threads could have hit it at the same time... <rdar://problem/18577603> llvm-svn: 220358
* Add some tests to be skipped when run remotely and also fixed a test to be ↵Greg Clayton2014-09-181-0/+2
| | | | | | more reliable when it comes to stopping on a specific line. llvm-svn: 218079
* Get test executables compiling on Windows.Zachary Turner2014-08-131-1/+1
| | | | | | | | | | | | | | Many of the test executables use pthreads directly. This isn't portable on Windows, so this patch converts these test to use C++11 threads and mutexes. Since Windows' implementation of std::thread classes throw and catch from header files, this patch also disables exceptions when compiling with clang on Windows. Reviewed by: Todd Fiala, Ed Maste Differential Revision: http://reviews.llvm.org/D4816 llvm-svn: 215562
* Marked TestAttachResume.process_attach_continue_interrupt_detach() as XFAIL ↵Todd Fiala2014-04-181-0/+1
| | | | | | on Linux per pr19478. llvm-svn: 206620
* Add annotation for failure from new Attach/Resume test case on FreeBSDEd Maste2014-04-021-0/+1
| | | | llvm-svn: 205427
* Use getpgid() with waitpid() in case the process pgid is not equal to its ↵Andrew MacPherson2014-04-021-0/+95
pid, as is the case with a forked subprocess. Also a couple of fixes for unit test failures from Todd Fiala. llvm-svn: 205405
OpenPOWER on IntegriCloud