summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools/lldb-gdbserver
Commit message (Collapse)AuthorAgeFilesLines
* Rename test/tools/lldb-gdbserver to test/tools/lldb-serverRobert Flack2015-03-0623-5829/+0
| | | | | | | | As requested in http://reviews.llvm.org/D7545 this change moves test/tools/lldb-gdbserver to test/tools/lldb-server ot match the name of the target being tested. Differential Revision: http://reviews.llvm.org/D8061 llvm-svn: 231479
* Fix TestStubSetSID after unification in to a single lldb-server binary.Siva Chandra2015-02-201-2/+7
| | | | | | | | | | | | | | | | | | | Summary: lldb-server needs an explicit 'g' or 'p' argument now. Since lldb-server is started as a gdbserver in this test, 'g' should be passed to it explicitly. Test Plan: ./dotest.py -p TestStubSetSID Reviewers: flackr, ovyalov Reviewed By: ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7801 llvm-svn: 230082
* Merge lldb-platform and lldb-gdbserver into a single binaryTamas Berghammer2015-02-182-2/+2
| | | | | | | | | | | | | This commit merges lldb-platform and lldb-gdbserver into a single binary of the same size as each of the previous individual binaries. Execution mode is controlled by the first argument being either platform or gdbserver. Patch from: flackr <flackr@google.com> Differential revision: http://reviews.llvm.org/D7545 llvm-svn: 229683
* Have llgs tests output their traces into session dirPavel Labath2015-02-041-1/+3
| | | | | | | | | | | | Summary: This reduces the bloat in the source tree and makes the tests more consistent. Reviewers: vharron, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7373 llvm-svn: 228134
* Modify dotest.py to be able to run without an lldb build.Stephane Sezer2015-01-091-8/+18
| | | | | | | | | | | | Summary: This will ease llgs development a bit by not requiring an lldb/lldb.py build to launch the tests. Also, we can now use LLDB_DEBUGSERVER_PATH to point to a debug server to use to run the tests. I used that to point to a ds2 build and run llgs tests against ds2. Reviewers: clayborg, tfiala, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D6554 llvm-svn: 225549
* Properly specify a few checksum values for llgs tests.Stephane Sezer2014-11-204-7/+7
| | | | | | | | | | | | | | Summary: In noack mode, these checksums are ignored by llgs, but some implementations need them still. Specify these checksums to ease integration. Test Plan: Run the tests before and after the change and make sure nothing breaks. Reviewers: clayborg, tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D6343 llvm-svn: 222441
* Properly specify the regex used to match register indexes.Stephane Sezer2014-11-141-1/+1
| | | | | | | | | | | | | | Summary: Something like "core:1" would match and try to be interpreted by the following code otherwise. Test Plan: Run tests and make sure the ones failing previously now pass. Reviewers: tfiala, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D6257 llvm-svn: 221980
* Specify checksums properly for llgs test suite packets.Stephane Sezer2014-11-137-23/+23
| | | | | | | | | | | | | | Summary: These checksums are ignored by llgs but some implementations require them to be specified properly. Test Plan: Re-run llgs tests with the checksums and make sure we don't break anything. Reviewers: tfiala, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D6254 llvm-svn: 221927
* Fix 4 failing llgs-related tests on a stock Ubuntu 14.04 x86_64 system./Todd Fiala2014-10-201-0/+15
| | | | | | | | | | | | | | | | | | | | | | | This fix addresses a requirement on some Linux kernels that limits a PTRACER to be an ancestor of the ptraced process. The fix in this case is to have the inferior test exe explicitly allow any ptracer to attach. This fixes several ptrace-related issues that I did not see on a modified kernel we used internally on my team. See http://reviews.llvm.org/D5846 for details. This fixes these previously failing tests on stock Ubuntu systems: FAIL: LLDB (suite) :: TestGdbRemoteProcessInfo.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64) FAIL: LLDB (suite) :: TestGdbRemoteAttach.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64) FAIL: LLDB (suite) :: TestLldbGdbServer.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64) FAIL: LLDB (suite) :: TestGdbRemoteKill.py (Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64) llvm-svn: 220181
* llgs: fix thread names broken by recent native thread changes.Todd Fiala2014-09-121-3/+35
| | | | | | | | * Fixes the local stack variable return pointer usage in NativeThreadLinux::GetName(). * Changes NativeThreadProtocol::GetName() to return a std::string. * Adds a unit test to verify thread names don't regress in the future. Currently only run on Linux since I know default thread names there. llvm-svn: 217717
* llgs: fix Ctrl-C inferior interrupt handling to do the right thing.Todd Fiala2014-09-112-6/+5
| | | | | | | | | | | | | | | | * Sends a SIGSTOP to the process. * Fixes busted SIGSTOP handling. Now builds a list of non-stopped that we wait for the PTRACE group-stop for. When the final must-stop tid gets its group stop, we propagate the process state change. Only the signal receiving the notification of the pending SIGSTOP is marked with the SIGSTOP signal. All the rest, if they weren't already stopped, are marked as stopped with signal 0. * Fixes a few broken tests. * Marks the Linux test I added earlier as expect-pass (no longer XFAIL). Implements fix for http://llvm.org/bugs/show_bug.cgi?id=20908. llvm-svn: 217647
* gdb-remote tests: added test to verify thread stop info when multi-threaded ↵Todd Fiala2014-09-111-9/+46
| | | | | | | | | | app is interrupted. The Linux version is marked XFAIL for the moment, fixing next. Related to http://llvm.org/bugs/show_bug.cgi?id=20908. llvm-svn: 217613
* llgs: implement qThreadStopInfo.Todd Fiala2014-09-101-0/+87
| | | | | | | | | | | This change implements this ticket: http://llvm.org/bugs/show_bug.cgi?id=20899 Adds the qThreadStopInfo RSP command for llgs and includes a test that verifies both debugserver and llgs respond with something reasonable on a multithreaded app. llvm-svn: 217549
* Fix a test broken by r216564.Todd Fiala2014-08-291-4/+6
| | | | | | | | | | | | | | llgs Linux is no longer doing the translation to some gdb fixed signal numbers. This change modifies the test method to take in the signo expected for a segfault. The debugserver test uses the fixed gdb number, and everything else uses signal.SIGSEGV for the platform. Sidenote: I somehow did not see this reported in multicore tests. I will need to verify that we aren't missing test failures in that script. I need to verify why this wasn't more obvious with test/dosep.py. llvm-svn: 216770
* Added a couple more gdb-remote tests to ensure qProcessInfo on darwin is not ↵Todd Fiala2014-08-261-0/+39
| | | | | | | | | | | | defining triple. And likewise for qProcessInfo on Linux, but ensures cputype/cpusubtype is not defined. The Apple case is the more important one, since we take a slightly different path to initialize ProcessGDBRemote-related remote host/process info if triple is present. Related to http://llvm.org/bugs/show_bug.cgi?id=20755. llvm-svn: 216473
* Fix llgs to send triple for non-Apple platforms and lldb to interpret correctly.Todd Fiala2014-08-262-2/+39
| | | | | | | | | | | | | This change addresses this bug: http://llvm.org/bugs/show_bug.cgi?id=20755 This change: * Modifies llgs to send triple instead of cputype and cpusubtype when not on Apple platforms in qProcessInfo. * Modifies lldb's GDBRemoteCommunicationClient to handle the triple returned from qProcessInfo if given. When given, it will prefer to use triple over cputype and cpusubtype. * Adds gdb-remote protocol tests to verify that cputype and cpusubtype are specified on darwin, and that triple is specified on Linux. llvm-svn: 216470
* Refactored existing gdb-remote qProcessInfo tests into separate python file.Todd Fiala2014-08-262-101/+113
| | | | | | | | | I'm about to add some more qProcessInfo tests so I wanted to first pull them out of the monolithic TestLldbGdbServer test case class. Related to http://llvm.org/bugs/show_bug.cgi?id=20755 llvm-svn: 216465
* Get test executables compiling on Windows.Zachary Turner2014-08-131-2/+2
| | | | | | | | | | | | | | 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
* llgs: corrected Linux signal reception notification for SIGABRT, SIGSEGV and ↵Todd Fiala2014-08-125-5/+146
| | | | | | | | | their ilk. Added llgs/debugserver gdb-remote tests around SIGABRT and SIGSEGV signal reception notification. Found a few bugs in exception signal handling in Linux llgs. Fixed those. llvm-svn: 215458
* Add $vAttach support to llgs.Todd Fiala2014-07-292-2/+133
| | | | | | Also adds a new test case for vAttach;{pid} for llgs and debugserver. llvm-svn: 214236
* llgs: add --reverse-connect support.Todd Fiala2014-07-263-6/+136
| | | | | | Also includes --reverse-connect tests for llgs and debugserver. llvm-svn: 214031
* Fixes a number of issue related to test portability on Windows.Zachary Turner2014-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 99% of this CL is simply moving calls to "import pexpect" to a more narrow scope - i.e. the function that actually runs a particular test. This way the test suite can run on Windows, which doesn't have pexpect, and the individual tests that use pexpect can be disabled on a platform-specific basis. Additionally, this CL fixes a few other cases of non-portability. Notably, using "ps" to get the command line, and os.uname() to determine the architecture don't work on Windows. Finally, this also adds a stubbed out builder_win32 module. The full test suite runs correctly on Windows after this CL, although there is still some work remaining on the C++ side to fix one-shot script commands from LLDB (e.g. script print "foo"), which currently deadlock. Reviewed by: Todd Fiala Differential Revision: http://reviews.llvm.org/D4573 llvm-svn: 213343
* gdb-remote test noise suppression on MacOSX.Todd Fiala2014-07-163-34/+53
| | | | | | | | | | | | | | | | | | | | This change adds a member to the base test case for gdb-remote that indicates whether a stub makes two X stop notification reports on kill commands. This is set to true for debugserver tests. The test for killing an attached process after it's first stop notification has been modified to look at that flag and add an extra X packet matcher so the "unmatched packet warning" doesn't get emitted for the second X on MacOSX with debugserver. I also broke those tests out of the monolithic TestLldbGdbServer mega test case and put it in its own, new TestGdbRemoteKill.py file and test case. Tested: Ubuntu 14.04 x86_64, clang-3.5 built lldb, no test failures. MacOSX 10.9.4, Xcode 6.0 Beta 3 built lldb, no test failures. llvm-svn: 213166
* Modified gdb-remote tests to run with automatically-chosen ports.Todd Fiala2014-07-143-96/+114
| | | | | | | | | | | | Now that llgs supports communicating the 0-port choose-a-port mechanism and can communicate that back to a caller via the --named-pipe option (at parity with debugserver), we use this mechanism to always start llgs and debugserver gdb-remote protocol tests without needing to use some port arbitration mechanism. This eliminates some potential intermittent failures vs. the previous random port and collision-avoidance strategy used. llvm-svn: 212923
* llgs: implement --setsid.Todd Fiala2014-07-122-4/+87
| | | | | | | | | | | | | The --setsid (-S) option changes the session id for the lldb-gdbserver process. This is used by tools such as lldb-platform and allows the user to prevent llgs from being in the same session as a calling terminal session. This will prevents terminal group control signals from affecting lldb-gdbserver. See also: https://github.com/tfiala/lldb/issues/38 llvm-svn: 212873
* Added llgs --named-pipe support and program_name-version_number printout ↵Todd Fiala2014-07-112-0/+90
| | | | | | | | | | | support. Added a unit test to test debugserver and llgs compliance on --named-pipe support. Modified llgs to implement --named-pipe support. (Note: need to revisit with new generic pipe support). llvm-svn: 212854
* Skip tests that are intermittent on Linux, fix gdb-remote port-grabbing code.Todd Fiala2014-07-091-33/+43
| | | | | | | | | | | | | Marked skipped for Linux: TestCallStopAndContinue TestConvenienceVariables TestStopHookMultipleThreads Fixed up gdb-remote port-grabbing code to use a random port in a wide range, and to allow that to fail more gracefully. This appears to have solved some gdb-remote intermittent failing behavior. llvm-svn: 212662
* Fix typos.Bruce Mitchener2014-07-081-1/+1
| | | | llvm-svn: 212553
* Add lldb-gdbserver support for Linux x86_64.Todd Fiala2014-06-309-66/+8
| | | | | | | | | | | | | | | | | | | | | This change brings in lldb-gdbserver (llgs) specifically for Linux x86_64. (More architectures coming soon). Not every debugserver option is covered yet. Currently the lldb-gdbserver command line can start unattached, start attached to a pid (process-name attach not supported yet), or accept lldb attaching and launching a process or connecting by process id. The history of this large change can be found here: https://github.com/tfiala/lldb/tree/dev-tfiala-native-protocol-linux-x86_64 Until mid/late April, I was not sharing the work and continued to rebase it off of head (developed via id tfiala@google.com). I switched over to user todd.fiala@gmail.com in the middle, and once I went to github, I did merges rather than rebasing so I could share with others. llvm-svn: 212069
* Implemented gdb-remote protocol tests for vCont;s and vCont;s:{thread}Todd Fiala2014-06-275-163/+335
| | | | | | | | | | | | | Also added tests for presence of vCont;c, vCont;C, vCont;s, vCont;S as returned by vCont? query. Broke out single step functionality from TestLldbGdbServer into base class. Used by new TestGdbRemoteSingleStep (using $s) and TestGdbRemote_vCont. Also part of llgs wrap-up, see: https://github.com/tfiala/lldb/issues/12 llvm-svn: 211965
* Added gdb-remote tests for Q{Save,Restore}RegisterState.Todd Fiala2014-06-203-95/+309
| | | | | | | | | Tests for both thread suffix and no thread suffix execution. Moved some bit-flipping helper methods from TestLldbGdbServer into the base GdbRemoteTestCaseBase class. llvm-svn: 211381
* Fixed up gdb-remote auxv regex issues with binary data.Todd Fiala2014-06-193-11/+39
| | | | | | | | | | | | | | | | | | | | Fixes two causes for https://github.com/tfiala/lldb/issues/7. 1. Ensures the inferior program has started executing, by printing a message on output first thing (per the "message:" command line arg) and waiting for that text to arrive before doing any checks related to auxv support. 2. Fixes up auxv-related regex patterns to be compiled with the Python re.MULTILINE and re.DOTALL options. The multiline is needed because the binary data can include what look like newlines when interpreted as text, and the DOTALL is needed to have the (.*) content portion match newlines. Added interrupt packet helper methods to add interrupt test sequence packets and parse the results from them. llvm-svn: 211283
* Added gdb-remote auxv test for chunked reads.Todd Fiala2014-06-172-0/+82
| | | | | | | | Verifies that a sum of offset,length auxv reads matches a single large read, and that the auxv data extracted from them match. llvm-svn: 211127
* Added gdb-remote auxv tests.Todd Fiala2014-06-173-8/+233
| | | | | | | | | | | | | | | | | First batch of auxv-related tests from llgs branch. Includes helpers for unescaping gdb-remote binary-escaped data, converting binary data from inferior endian-ness to integral values, etc. Tests on debugserver are expected to be skipped since it doesn't support auxv and the tests are geared to be skipped on platforms that don't broadcast support for the feature in qSupported. (llgs is listed as XFAIL since qSupported support in llgs upstream is not there, so the support check cannot work in upstream llgs.) llvm-svn: 211105
* Minor gdb-remote test QListThreadsInStopReply changes from llgs branch.Todd Fiala2014-06-152-5/+7
| | | | llvm-svn: 211006
* Added several gdb-remote tests around QListThreadsInStopReply.Todd Fiala2014-06-142-1/+176
| | | | llvm-svn: 210982
* Added gdb-remote expedited register dupe check.Todd Fiala2014-06-142-2/+41
| | | | | | | | | | | | | The llgs branch had a bug where register sets were not terminated with LLDB_INVALID_REGNUM so the expedite register loop was issuing duplicate registers. This test was added to catch the problem. Enhanced the key-val collection method to optionally (and by default) support capturing duplicate values for a given key. When that happens and if permitted, it promotes a single key to a list and appends values to it. llvm-svn: 210963
* Sync accumulated minor diffs in llgs branch gdb-remote tests.Todd Fiala2014-06-132-58/+202
| | | | | | | | I've been making some subtle changes to the gdb-remote tests as I implement them in the llgs branch. This check-in rectifies the set of diffs that have accumulated in the llgs branch that were not present upstream. llvm-svn: 210957
* Added gdb-remote stop packet expedited register tests.Todd Fiala2014-06-133-532/+716
| | | | | | | | | | | | | | | | | | | | | | | | | Expedited registers currently checked for are pc, fp and sp. Also broke out the gdb-remote base test case logic into class gdbremote_testcase.GdbRemoteTestCaseBase in the new gdbremote_testcase.py file. TestGdbRemoteExpeditedRegisters.py is the first gdb-remote area to be contained in its own test case class file. The monolithic TestLldbGdbServer.py has been modified to derive from gdbremote_testcase.GdbRemoteTestCaseBase. Soon I will pull out all the gdb-remote functional area tests from that class into separate classes. I'm intending to start all GdbRemote test cases with GdbRemote so it is easy to run them all with a -p pattern match on the test run infrastructure. Also scanned and removed all cases of whitespace-only lines in the files I touched. llvm-svn: 210931
* Fix up extra whitespace from previous commit.Todd Fiala2014-06-122-5/+5
| | | | llvm-svn: 210821
* Added gdb-remote P/p thread suffix test.Todd Fiala2014-06-122-21/+191
| | | | | | | | | | | | Improved the P writes all GPR register values test. It now limits itself to GPR registers that are not containers for other registers. Pulled in improvements from the llgs branch. Note on Linux llgs I'm able to write a much wider range of registers successfully with $P using the bitflip test than I am able to write with debugserver. Might be worth drilling into. llvm-svn: 210818
* Add gdb-remote P register write test.Todd Fiala2014-06-111-1/+129
| | | | | | | | | | | | | | | | Added test that attempts to write a value to each general purpose register that is bit-flipped from the initial read value. It then reads it back to see if it takes. Right now I just assert that at least one register bit flip write succeeds. I added a note that on the MacOSX x86_64 debugserver case, the only writes that succeed from the GPR set are rax thru rdx, rdi, rsi and rbp. The failures are E32 failure-at-write-attempt issues on the debugserver end. I'll revisit this after implementing in the llgs linux-x86_64 branch. The packet log looks good but I may have a subtle mistake in the code. llvm-svn: 210681
* Fixed gdb-remote M test length parameter, added overwrite to test.Todd Fiala2014-06-101-6/+5
| | | | | | | | | | Initial check-in provided a nibble count instead of byte count for the memory to write. Fixed that. Enhanced test to check for overwrite past the expected range of writing to verify the correct amount is written. llvm-svn: 210602
* Added gdb-remote test to verify M memory write.Todd Fiala2014-06-102-1/+70
| | | | llvm-svn: 210594
* Added gdb-remote tests around $qSupported.Todd Fiala2014-06-101-1/+77
| | | | | | | Right now it just checks that qSupported returns at least one recognized gdb stub feature. llvm-svn: 210573
* Added gdb-remote test for s packet, single stepping.Todd Fiala2014-06-092-22/+220
| | | | llvm-svn: 210481
* Remove invalid comment from last commit.Todd Fiala2014-06-061-1/+0
| | | | llvm-svn: 210376
* Added gdb-remote program counter check at breakpoint.Todd Fiala2014-06-062-80/+184
| | | | | | | | | | | | | | | | | | | | | | | | | Modified the breakpoint stop and start check to verify the program counter printed immediately after stopping does match the breakpoint address. This is based on a conversation with Greg Clayton clarifying that the breakpoint stop handling code on a remote should do any and all adjusting of the program counter at stop time, not at resume time. Added a qProcessInfo parser and helper methods to add the collection send/response elements to the packet flow. Removed the older pid-only query mechanism. The parser verifies all the keys provided are within the documented known set of key-value pairs. Added helper routine to unpack the hex value of a $p-style register read response according to the endian-ness of the inferior as reported by qProcessInfo. Added a test to verify qProcessInfo includes an endian key/value pair. Refactored several older tests to move to the less verbose test startup code. Most of these were the tests using the older qProcessInfo pid-only retrieval code. llvm-svn: 210374
* Added gdb-remote test for software breakpoints.Todd Fiala2014-06-052-17/+140
| | | | | | | | | | Tests $Z0 and $z0. Extends test exe get-code-address-hex: to take a function name. Enabled for debugserver, disabled for llgs. Implementing in llgs branch next. llvm-svn: 210272
* Added gdb-remote $qMemoryRegionInfo tests for heap and stack.Todd Fiala2014-06-043-46/+182
| | | | | | | | | | | | | | | | | | Added two new tests: one to verify that a test exe heap address returned is readable and writeable, and a similar one to verify a test exe stack address is readable and writeable. Ran the main.cpp test exe code through the Xcode re-indenter. I was using TextMate to edit the test's C++ code alongside the Python code but last check-in found that it was not handling tabs/indentation the way I am intending it. Modified test exe to require C++11. Refactored gdb remote python code's handling of memory region info into more re-usable methods. llvm-svn: 210196
OpenPOWER on IntegriCloud