summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools/lldb-server
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-2824-5807/+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-2719-19/+19
| | | | llvm-svn: 251444
* Remove use of octal literals.Zachary Turner2015-10-265-13/+13
| | | | | | | | | | | Python 3 has a different syntax for octal literals than Python 2 and they are incompatible with each other. Six doesn't provide a transparent wrapper around this, so the most sane thing to do is to not use octal literals. If you need an octal literal, use a decimal literal and if it's not obvious what the value is, provide the value in octal as a comment. llvm-svn: 251328
* Convert `long` to `int`, and portably detect all integral types.Zachary Turner2015-10-261-2/+3
| | | | llvm-svn: 251305
* Convert deprecated unittest method names.Zachary Turner2015-10-2612-42/+42
| | | | | | | Plural methods were long deprecated, and in Python 3 they are gone. Convert to the actual supported method names. llvm-svn: 251303
* Fix usages of range() and xrange() for Python 3.Zachary Turner2015-10-261-1/+1
| | | | llvm-svn: 251302
* Python3 - Wrap more statements in calls to list()Zachary Turner2015-10-234-10/+10
| | | | llvm-svn: 251129
* Add from __future__ import print_function everywhere.Zachary Turner2015-10-2320-28/+68
| | | | | | | | | | | | | 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-2218-71/+27
| | | | | | | | | | | | | | | | | | | | | 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
* Use six to portably handle module renames in Python 2 and 3Zachary Turner2015-10-212-6/+13
| | | | llvm-svn: 250915
* lldb-server: add support for binary memory readsPavel Labath2015-10-141-0/+45
| | | | | | | | | | | | | | | | | Summary: This commit adds support for binary memory reads ($x) to lldb-server. It also removes the "0x" prefix from the $x client packet, to make it more compatible with the old $m packet. This allows us to use almost the same code for handling both packet types. I have verified that debugserver correctly handles $x packets even without the leading "0x". I have added a test which verifies that the stub returns the same memory contents for both kinds of memory reads ($x and $m). Reviewers: tberghammer, jasonmolenda Subscribers: iancottrell, lldb-commits Differential Revision: http://reviews.llvm.org/D13695 llvm-svn: 250295
* Merge dwarf and dsym testsTamas Berghammer2015-09-3013-380/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Clean up register naming conventions inside lldb. Jason Molenda2015-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "gcc" register numbers are now correctly referred to as "ehframe" register numbers. In almost all cases, ehframe and dwarf register numbers are identical (the one exception is i386 darwin where ehframe regnums were incorrect). The old "gdb" register numbers, which I incorrectly thought were stabs register numbers, are now referred to as "Process Plugin" register numbers. This is the register numbering scheme that the remote process controller stub (lldb-server, gdbserver, core file support, kdp server, remote jtag devices, etc) uses to refer to the registers. The process plugin register numbers may not be contiguous - there are remote jtag devices that have gaps in their register numbering schemes. I removed all of the enums for "gdb" register numbers that we had in lldb - these were meaningless - and I put LLDB_INVALID_REGNUM in all of the register tables for the Process Plugin regnum slot. This change is almost entirely mechnical; the one actual change in here is to ProcessGDBRemote.cpp's ParseRegisters() which parses the qXfer:features:read:target.xml response. As it parses register definitions from the xml, it will assign sequential numbers as the eRegisterKindLLDB numbers (the lldb register numberings must be sequential, without any gaps) and if the xml file specifies register numbers, those will be used as the eRegisterKindProcessPlugin register numbers (and those may have gaps). A J-Link jtag device's target.xml does contain a gap in register numbers, and it only specifies the register numbers for the registers after that gap. The device supports many different ARM boards and probably selects different part of its register file as appropriate. http://reviews.llvm.org/D12791 <rdar://problem/22623262> llvm-svn: 247741
* Fixes lldb-server commandline test xpass for OS X and Linux; resolves ↵Todd Fiala2015-09-141-2/+1
| | | | | | llvm.org/pr20273 llvm-svn: 247605
* XFAIL single_step_only_steps_one_instruction related tests on arm/aarch64Tamas Berghammer2015-09-072-0/+3
| | | | llvm-svn: 246972
* Xfail TestGdbRemoteAbort for Android API <= 16.Chaoren Lin2015-07-211-1/+2
| | | | | | | | | | Reviewers: sivachandra Subscribers: tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D11378 llvm-svn: 242815
* Use /proc/$$/stat instead of $PPID.Chaoren Lin2015-07-061-1/+4
| | | | | | | | | | | | Summary: $PPID is not available on old shells. Reviewers: tberghammer, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10968 llvm-svn: 241486
* Fix TestAttachDenied and TestChangeProcessGroup for remote Windows to Android.Chaoren Lin2015-06-062-2/+2
| | | | | | | | | | | | | | Summary: Updated `append_to_remote_wd` to work for both remote and local. Reviewers: clayborg, ovyalov Reviewed By: ovyalov Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10288 llvm-svn: 239203
* Update TestGdbRemoteAbort and TestGdbRemoteSegFault to use `get_signal_number`.Chaoren Lin2015-06-062-2/+3
| | | | | | | | | | | | Reviewers: clayborg, ovyalov Reviewed By: ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10286 llvm-svn: 239201
* [TestGdbRemoteAbort] Skip on API 16 Android devicesSiva Chandra2015-06-051-0/+1
| | | | | | | | | | | | | | | | Summary: This change also adds the infrastructure required to specify the API levels for which tests should be skipped. Reviewers: chying, labath Reviewed By: labath Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10282 llvm-svn: 239183
* [TestGdbRemoteRegisterState] Do not flip ARM *psr register in the testSiva Chandra2015-06-041-0/+3
| | | | | | | | | | | | | | | | | | Summary: Not all of that register is readable/writable in user mode. This means that even if the inferior is stopped, parts of the register could be changing. So, do not flip this register to check if its value can be restored. Reviewers: tberghammer, chaoren Reviewed By: tberghammer Subscribers: rengolin, aemerson, lldb-commits Differential Revision: http://reviews.llvm.org/D10204 llvm-svn: 239104
* Use new get_signal_number utility function for tests.Chaoren Lin2015-06-022-7/+8
| | | | | | | | | | | | | | | | Summary: This fixes TestLldbGdbServer and TestSendSignal from Windows to Android. This change depends on D10171. Reviewers: clayborg, ovyalov Reviewed By: clayborg, ovyalov Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10172 llvm-svn: 238852
* [TestLldbGdbServer and TestGdbRemoteXXX] Use "ls -l" instead of "readlink"Siva Chandra2015-05-291-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Old Android devices, for example API 16, do not have the "readlink" command. To take care of such devices, this commit changes to use "ls -l" instead of "readlink" to get the lldb-server exe path. The tests fixed with this change for an Android API 16 arm device are: TestGdbRemoteAttach TestGdbRemoteAuxvSupport TestGdbRemoteExpeditedRegisters TestGdbRemoteKill TestGdbRemoteProcessInfo TestGdbRemoteSegFault TestGdbRemoteThreadsInStopReply TestGdbRemote_qThreadStopInfo Further, all tests in TestLldbGdbServer pass (previously erroring out), except one which times out. Test Plan: Run dosep.py with 8 test threads targetting Android API 16 device. Reviewers: vharron, ovyalov Reviewed By: ovyalov Subscribers: tberghammer, aemerson, lldb-commits Differential Revision: http://reviews.llvm.org/D10107 llvm-svn: 238532
* Add a new "qEcho" packet with the following format:Greg Clayton2015-05-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qEcho:%s where '%s' is any valid string. The response to this packet is the exact packet itself with no changes, just reply with what you received! This will help us to recover from packets timing out much more gracefully. Currently if a packet times out, LLDB quickly will hose up the debug session. For example, if we send a "abc" packet and we expect "ABC" back in response, but the "abc" command takes longer than the current timeout value this will happen: --> "abc" <-- <<<error: timeout>>> Now we want to send "def" and get "DEF" back: --> "def" <-- "ABC" We got the wrong response for the "def" packet because we didn't sync up with the server to clear any current responses from previously issues commands. The fix is to modify GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock() so that when it gets a timeout, it syncs itself up with the client by sending a "qEcho:%u" where %u is an increasing integer, one for each time we timeout. We then wait for 3 timeout periods to sync back up. So the above "abc" session would look like: --> "abc" <-- <<<error: timeout>>> 1 second --> "qEcho:1" <-- <<<error: timeout>>> 1 second <-- <<<error: timeout>>> 1 second <-- "abc" <-- "qEcho:1" The first timeout is from trying to get the response, then we know we timed out and we send the "qEcho:1" packet and wait for 3 timeout periods to get back in sync knowing that we might actually get the response for the "abc" packet in the mean time... In this case we would actually succeed in getting the response for "abc". But lets say the remote GDB server is deadlocked and will never response, it would look like: --> "abc" <-- <<<error: timeout>>> 1 second --> "qEcho:1" <-- <<<error: timeout>>> 1 second <-- <<<error: timeout>>> 1 second <-- <<<error: timeout>>> 1 second We then disconnect and say we lost connection. We might also have a bad GDB server that just dropped the "abc" packet on the floor. We can still recover in this case and it would look like: --> "abc" <-- <<<error: timeout>>> 1 second --> "qEcho:1" <-- "qEcho:1" Then we know our remote GDB server is still alive and well, and it just dropped the "abc" response on the floor and we can continue to debug. <rdar://problem/21082939> llvm-svn: 238530
* Fix breakpoint setting in gdb remote test cases on armTamas Berghammer2015-05-282-4/+10
| | | | llvm-svn: 238411
* Add 'qXfer:features:read' to known stub listYing Chen2015-05-261-0/+1
| | | | | | | | | | | | | | | | | | Summary: -Fix darwin bot failure "unknown qSupported stub feature reported: qXfer:features:read" -TestGdbRemoteAuxvSupport.py and TestLldbGdbServer.py were affected by this problem Test Plan: dotest.py -m --executable /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/lldb --framework /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/LLDB.framework -A x86_64 -C clang -p TestLldbGdbServer.py dotest.py -m --executable /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/lldb --framework /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/LLDB.framework -A x86_64 -C clang -p TestGdbRemoteAuxvSupport.py Reviewers: clayborg, sivachandra, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10043 llvm-svn: 238262
* [TestLldbGdbServer] Up sleep duration to 1min in the inferior thread_func.Siva Chandra2015-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: The current sleep duration is not sufficient for Android. [[ Its a completely different investigation as to why Android needs longer sleep durations for this test. ]] Test Plan: dotest.py -p TestLldbGdbServer on Android and local linux. Reviewers: chaoren Reviewed By: chaoren Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D9926 llvm-svn: 237981
* XPASS a bunch of GdbRemote/LldbGdbServer testsVince Harron2015-05-216-8/+0
| | | | | | | | | | | | Depends on r237932 "Fixed intermittent failures in TestGdbRemote*/TestLldbGdbServer" Test Plan: Ran dosep 100x, no failures in these tests Differential Revision: http://reviews.llvm.org/D9892 llvm-svn: 237933
* Fixed intermittent failures in TestGdbRemote*/TestLldbGdbServerVince Harron2015-05-2114-2/+28
| | | | | | | | | | | | | | test/tools/lldb-server/commandline/Test* were actually executing in their parent directory. This looks fine at first because they aren't compiling an inferior executable. Unfortunately, they still call "make clean" during their cleanup, which is likely causing all kinds of havok in tests running in the parent directory Differential Revision: http://reviews.llvm.org/D9869 llvm-svn: 237932
* Re-enable packet logging for GdbRemote/LldbServer testsVince Harron2015-05-211-1/+6
| | | | | | | | Creates logs in session dir Differential Revision: http://reviews.llvm.org/D9847 llvm-svn: 237931
* Fixes errors in remote testsVince Harron2015-05-181-1/+1
| | | | llvm-svn: 237603
* Refactored lldb executable name discoveryVince Harron2015-05-181-19/+13
| | | | | | | | | | | | | | | | | | | | The lldb executable was referenced through the code by 7 different (effectively) global variables. global lldbExecutablePath global lldbExecutable os.environ['LLDB_EXEC'] os.environ['LLDB_TEST'] dotest.lldbExec dotest.lldbHere lldbtest.lldbExec This change uses one global variable lldbtest_config.lldbExec to replace them all. Differential Revision: http://reviews.llvm.org/D9817 llvm-svn: 237600
* XFAIL'd some flakey tests on DarwinVince Harron2015-05-172-0/+2
| | | | llvm-svn: 237543
* XFAIL'd some tests that fail very, very rarelyVince Harron2015-05-161-0/+1
| | | | llvm-svn: 237515
* os.path.join does not always work for paths on remote platforms.Chaoren Lin2015-05-112-4/+2
| | | | | | | | | | | | | | | | Summary: Since we don't yet have remote windows debugging, it should be safe to assume that the remote target uses unix path separators. Reviewers: ovyalov, zturner, clayborg, vharron Reviewed By: vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9633 llvm-svn: 237006
* Remove unsupported lldb-server parameters from testVince Harron2015-05-101-3/+1
| | | | llvm-svn: 236958
* change comment symbol from // to #Ying Chen2015-05-081-2/+2
| | | | llvm-svn: 236803
* Remove tailing " (deleted)" from executable name returned by readlinkYing Chen2015-05-081-1/+3
| | | | | | | | | | | | Summary: When calling readlink, " (deleted)" is appended to executable path if it's deleted. Remove if it's there. Reviewers: chaoren, sivachandra, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9583 llvm-svn: 236802
* Pass Android device ID to TestStubReverseConnect.Chaoren Lin2015-05-071-1/+1
| | | | llvm-svn: 236789
* Fix adb forward in gdbremote_testcase to support multiple devices.Chaoren Lin2015-05-071-6/+12
| | | | | | | | | | | | | | Summary: Update to D9510. Reviewers: chying, tberghammer, ovyalov Reviewed By: ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9542 llvm-svn: 236688
* Update gdbremote_testcase to accomodate new adb:// scheme.Chaoren Lin2015-05-061-1/+2
| | | | | | | | | | | | Reviewers: chying, ovyalov Reviewed By: chying, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9510 llvm-svn: 236560
* Fix typo. platfrom -> platformChaoren Lin2015-05-051-2/+2
| | | | llvm-svn: 236543
* XFAIL a test in TestGdbRemoteRegisterState.py on linux to stabilize build botPavel Labath2015-04-161-0/+1
| | | | llvm-svn: 235100
* XFAILing TestGdbRemoteAttach to stabilise linux build botPavel Labath2015-04-161-61/+1
| | | | | | | also, deleting what appears to be a concatenation of a file with itself (How that compiled in the first place?). llvm-svn: 235093
* Bug 23051 - Fix zombie processes after lldb-server testsIlia K2015-04-156-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes the following bug: https://llvm.org/bugs/show_bug.cgi?id=23181 For some reason some lldb-server tests should be kicked using SIGHUP and SIGINT before termination, otherwise it will leave a zombie process. I think the reason is that the lldb-server will terminate a slave process if it gets the SIGHUP/SIGINT and if so it should be fixed in lldb-server. The solution is to terminate process like it does the pexpect (including the delayafterterminate interval). Also this patch reverts the following commits: * r234549 - Skip lldb-server tests according to bug 23181 * r234765 - Skip a few tests on OS X according to the bug 23181 * r234803 - Skip the TestGdbRemoteRegisterState.test_grp_register_save_restore_works_no_suffix_debugserver_dsym test on OS X according to the bug 23181 Test Plan: ``` $ ps | grep Z | grep a.out | wc -l 447 $ ./dosep.py --options "-v --executable $INSTALLDIR/bin/lldb" [...] $ ps | grep Z | grep a.out | wc -l 447 ``` Reviewers: jasonmolenda, clayborg, tberghammer Reviewed By: clayborg Subscribers: lldb-commits, dawn, tberghammer, clayborg, jasonmolenda Differential Revision: http://reviews.llvm.org/D9019 llvm-svn: 235008
* Add teardown hook to shutdown an inferior processIlia K2015-04-151-2/+9
| | | | | | | | | | | | | | Summary: Add teardown hook to shutdown an inferior process Reviewers: jasonmolenda, clayborg, tberghammer Reviewed By: clayborg, tberghammer Subscribers: lldb-commits, tberghammer, clayborg, jasonmolenda Differential Revision: http://reviews.llvm.org/D9018 llvm-svn: 235005
* Skip reverse connect test when running remotelyVince Harron2015-04-151-0/+1
| | | | | | | This use case is not supported and may be removed in the future if not needed llvm-svn: 234994
* Skip the ↵Ilia K2015-04-131-0/+1
| | | | | | TestGdbRemoteRegisterState.test_grp_register_save_restore_works_no_suffix_debugserver_dsym test on OS X according to the bug 23181 llvm-svn: 234803
* Skip a few tests on OS X according to the bug 23181Ilia K2015-04-131-0/+1
| | | | llvm-svn: 234765
* Skip lldb-server tests according to bug 23181Ilia K2015-04-105-0/+6
| | | | llvm-svn: 234549
OpenPOWER on IntegriCloud