summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Add gdb-remote test for $qMemoryRegionInfo code querying.Todd Fiala2014-06-042-1/+113
| | | | | | | | | | Added test stub for collecting a code, heap and stack address. Added test to verify that the code address returns a readable, executable memory region and that the memory region range was indeed the one that the code belonged to. llvm-svn: 210187
* Add gdb-remote test to ensure $qMemoryRegionInfo is supported.Todd Fiala2014-06-041-0/+29
| | | | llvm-svn: 210185
* Added gdb-remote memory read ($m) test.Todd Fiala2014-06-032-3/+86
| | | | | | | | | | | | Added set-memory:{content} and get-memory-address-hex: commands to the test exe for gdb-remote. Added a test that sets the content via the inferior command line, then reads it back via gdb-remote with $m. Passing on debugserver. Marked as fail on llgs. Implementing in the llgs branch next. llvm-svn: 210116
* gdb-remote signal delivery test cleanup.Todd Fiala2014-05-303-49/+199
| | | | | | | | | | | | | | | | Learned that MacOSX only accepts signal delivery on a thread that is already signal handling. Reworked the test exe to cause a SIGSEGV and recover if either nothing intercepts the SIGSEGV handler, or if a SIGUSR1 is inserted. The test uses the latter part to test signal delivery on continue using the SIGUSR1. I still don't have this working on MacOSX. I'm seeing the signal get delivered to a different thread than the one I'm specifying with $Hc{thread-id} + $C{signo}, or with $vCont;C{signo}:{thread-id};c. I'll come back to this after getting it working on the llgs branch on Linux x86_64. llvm-svn: 209912
* gdb-remote testing: new test, cleaned up socket reading.Todd Fiala2014-05-295-129/+521
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new SocketPacketPump class to decouple gdb remote packet reading from packet expectations code. This allowed for cleaner implementation of the separate $O output streams (non-deterministic packaging of inferior stdout/stderr) from all the rest of the packets. Added a packet expectation matcher that can match expected accumulated output with a timeout. Use a dictionary with "type":"output_match". See lldbgdbserverutils.MatchRemoteOutputEntry for details. Added a gdb remote test to verify that $Hc (continue thread selection) plus signal delivery ($C{signo}) works. Having trouble getting this to pass with debugserver on MacOSX 10.9. Tried different variants, including $vCont;C{signo}:{thread-id};c. In some cases, I get the test exe's signal handler to run ($vCont variant first time), in others I don't ($vCont second and further times). $C{signo} doesn't hit the signal handler code at all in the test exe but delivers a stop. Further $Hc and $C{signo} deliver the stop marking the wrong thread. For now I'm marking the test as XFAIL on dsym/debugserver. Will revisit this on lldb-dev. Updated the text exe for these tests to support thread:print-ids (each thread announces its thread id) and provide a SIGUSR1 thread handler that prints out the thread id on which it was signaled. llvm-svn: 209845
* Remove some unnecessary comments from previous check-in.Todd Fiala2014-05-231-51/+47
| | | | | | | | | | | Removed a "done" TODO comment. Moved some helper methods to the top of the unit test. Removed some commented out code I was considering implementing before I came up with a better overall approach. llvm-svn: 209561
* Added gdb remote tests to verify $Hg{thread-id}.Todd Fiala2014-05-234-7/+215
| | | | | | | | | | | | | | | | | | | | | Added test to check that each thread reported by $q{f,s}ThreadInfo can be switched to by $Hg, verified by a follow-up $qC. Modified test exe to accept "thread:new" to create a new thread that runs and sleeps for 5 seconds. @llgs_test/@debugserver_test now buffer output. llgs and debugserver gdbremote protocol tests now collect $O notification output into the context returned from expect_lldb_gdbserver_replay. context["O_count"] is an integer indicating the number of $O packets collected during the replay, and context["O_content"] contains the accumulated hex-decoded text output by the inferior (stdout and stderr). Modified the $O check test to check the accumulated output rather than a direct $O packet. llvm-svn: 209560
* Added gdbremote protocol test for $p and returned data size.Todd Fiala2014-05-221-0/+78
| | | | | | | | | | | | Each register returned by $qRegisterInfo is tested that it's $p register read returns a representation that is the correct byte size as indicated by $qRegisterInfo. Currently enabled for debugserver, disabled for llgs. The llgs branch will use this to verify $p implementation. llvm-svn: 209452
* Added tests for q{f,s}ThreadInfo for attached processes.Todd Fiala2014-05-211-28/+115
| | | | | | | | | | | | | | | | | | Added helper methods: prep_debug_monitor_and_inferior(): properly handles the two cases of running the stub against an inferior process launched by the stub, and one attached to by the stub. See docs for function: simplifies test creation for tests that want to test the same operations against a launched and attached inferior. Added the q{f,s}ThreadInfo and $qC response comparison test (verifies they both return the same thing) when the process is attached rather than launched by the stub. Modified the previous two tests added to make use of the new prep_debug_monitor_and_inferior() facility. llvm-svn: 209318
* Added gdb-remote tests for q{f,s}ThreadInfo.Todd Fiala2014-05-212-3/+134
| | | | | | | | | The First test verifies that qThreadInfo queries work for stub-launched processes. The second test verifies that $qC after stub-launched inferior returns the same thread as the qThreadInfo queries. llvm-svn: 209314
* Change gdb remote test support multi-request format.Todd Fiala2014-05-201-1/+1
| | | | | | | | The multi request-response test infrastructure support was adding the optional request suffix iteration index as decimal but it needed to be hex per spec. This change fixes that. llvm-svn: 209234
* Added gdb remote protocol tests across all qRegisterInfo responses.Todd Fiala2014-05-193-44/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for gdb remote protocol capture/playback where there is a query/multiple-response pattern. The new playback entry supports: - a general query command (key: next_query or query) - an optional first-query command if that differs from the subsequent queries (key: first_query) - an end regex for matching anything that would signify that the query/multi-response iteration has come to an end. An assumption is that the end regex is not a content package we care about aside from ending the iteration. (key: end_regex) - an optional 0-based index appended to the end of the query command (key: append_iteration_suffix), default: False. - a key used to collect responses from the query. Any response from the gdb remote that doesn't match the end-of-iteration regex is captured in the playback context dictionary using the key specified. That key will be an array, where each array entry is one of the responses from the query/multi-response iteration. (key: save_key). - a runaway response value, defaulting to 10k, where if this many responses is captured, assume the ending condition regex is invalid, or the debug monitor is doing something goofy that is going to blow out memory or time. (key: runaway_response_count, default: 10000) See the lldbgdbserverutils.MultiResponseGdbRemoteEntry class for details. A MultiResponseGdbRemoteEntry is added by adding an element to the GdbRemoteTestSequence (via GdbRemoteTestSequence.add_log_lines), using a dictionary, where the "type" key is set to "multi_response", and the rest of the keys in the dictionary entry are set to the keys documented for MultiResponseGdbRemoteEntry. Added helper functions to add the required entry to grab all qRegisterInfo responses. Added another helper to parse the qRegisterInfo response packets into an array of dictionaries, where each key:value in the dictionary comes from the register info response packet. Added a test to verify that a generic register exists for the program counter, frame pointer, stack pointer and cpu flags across all register info responses. Added a test to verify that at least one register set exists across all register info responses. llvm-svn: 209170
* Revert r209142.Todd Fiala2014-05-191-3/+17
| | | | | | | Need to spend a little more time with suppressing the debugserver 64-to-32 bit warnings. Will re-submit after I get the warnings properly suppressed. llvm-svn: 209151
* Added gdb remote test for one valid qRegisterInfo result.Todd Fiala2014-05-191-0/+70
| | | | | | | | | | | | Checks that at at least qRegisterInfo0 responds with a valid register info reply packet. The packet is parsed and validates that all keys come from the documented set of valid keys. It then validates that a minimum set of expected keys are present in the returned packet. This test is set to pass on debugserver and fail on llgs TOT. llvm-svn: 209109
* Add support for gdb remote $X stop notification.Todd Fiala2014-05-191-1/+1
| | | | | | | | | | | | | | debugserver now returns $X09 as the immediate response to a $k kill process request rather than $W09. ProcessGDBRemote now properly handles X as indication of a process exit state. The @debugserver_test and @lldb_test for $k now properly expects an X notification (signal-caused exit) after killing a just-attached inferior that was still in the stopped state. llvm-svn: 209108
* Added gdbremote tests to verify kill and continue after attach.Todd Fiala2014-05-142-12/+104
| | | | llvm-svn: 208804
* Fix up TestLldbGdbServer C++ test slug exe.Todd Fiala2014-05-141-1/+1
| | | | | | Missing header for Linux, replaces with iostreams. llvm-svn: 208794
* Added debugserver/llgs test for command-line --attach {pid} variant.Todd Fiala2014-05-142-3/+68
| | | | | | | | | Checks that the pid reported by $qProcessInfo matches the pid that was launched as the attach test subject. test exe now supports "sleep:{sleep_seconds}" command line argument. llvm-svn: 208782
* Modify debugserver to follow gdb remote $qC protocol definition.Todd Fiala2014-05-072-6/+88
| | | | | | | | | | $qC from debugserver now returns the current thread's thread-id (and, like $?, will set a current thread if one is not already selected). Previously it was returning the current process id. lldb will now query $qProcessInfo to retrieve the process id. The process id is now cached lazily and reset like other cached values. Retrieval of the process id will fall back to the old $qC method for vendor==Apple and os==iOS if the qProcessInfo retrieval fails. Added a gdb remote protocol-level test to verify that $qProcessInfo reports a valid process id after launching a process, while the process is in the initial stopped state. Verifies the given process id is a currently valid process on host OSes for which we know how to check (MacOSX, Linux, {Free/Net}BSD). Ignores the live process check for OSes where we don't know how to do this. (I saw no portable way to do this in stock Python without pulling in other libs). llvm-svn: 208241
* gdbremote testing: added regex support to match packets and propagate/test ↵Todd Fiala2014-05-063-49/+238
| | | | | | | | | | | against previously stored matches. Added a test validating that $qC after an inferior launch via $A returns a thread id that an immediately followig $? reports for the active thread. This is currently skipped on debugserver (the thread ids don't match) and isn't yet implemented in TOT for llgs. llvm-svn: 208061
* Refactored gdb remote protocol testing sequence handling.Todd Fiala2014-05-052-134/+171
| | | | | | | | | | | | | | | | | Pushed gdbremote protocol sequence expectations into a separate class and defer matching of llgs/debugserver output to the sequence entry. Pre-step to adding regex matching and grouped content collecting. No longer require anything before the read/send packet portion of slurped-up log lines used for setting up gdb remote test sequences. Several packet logging options produce a wide range of content before the read/send packet. Added helpers to TestLldbGdbServer to clean up test setup and test expectations matching. llvm-svn: 207998
* Added gdb remote protocol tests for no output and inferior non-zero exit code.Todd Fiala2014-04-293-17/+129
| | | | | | | | | | Tests added for debugserver and lldb-gdbserver. lldb-gdbserver marked as XFAIL on top of tree. Added build_gdbremote_A_packet test helper to construct a gdbremote A launch packet from a list of args. llvm-svn: 207568
* Added debugserver/llgs protocol test for output and clean exit.Todd Fiala2014-04-291-0/+39
| | | | | | | Tests for $vCont;c program start, $O output and $W status code. @llgs_test variant currently marked as expected fail. llvm-svn: 207492
* Fixed up lldb-gdbserver to match slightly different debugserver listener ↵Todd Fiala2014-04-281-1/+1
| | | | | | | | host:port message. Fixed up typo in lldb-gdbserver name missed when working on the OS X side earlier today for debugserver support. llvm-svn: 207398
* Added two new test types: @debugserver_test and @llgs_test.Todd Fiala2014-04-282-38/+114
| | | | | | | | | | | | | | | TestLldbGdbServer now supports both lldb-gdbserver (llgs) and debugserver tests. Similar to the dsym/dwarf tests, they allow running the same underlying gdb remote protocol tests against lldb-gdbserver and debugserver. This will help make sure the protocol-level tests for lldb-gdbserver faithfully represent what debugserver does on OS X. Switched back gdb remote protocol test logging to warning and above (accidentally submitted it at debug level in a recent commit). llvm-svn: 207395
* Added TestLldbGdbServer test for A start exe packet.Todd Fiala2014-04-254-4/+58
| | | | | | Fixed up bug in XFAIL tests where I appended an array when I intended to merge an array. llvm-svn: 207285
OpenPOWER on IntegriCloud