summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools/lldb-gdbserver/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename test/tools/lldb-gdbserver to test/tools/lldb-serverRobert Flack2015-03-061-404/+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 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
* Add lldb-gdbserver support for Linux x86_64.Todd Fiala2014-06-301-3/+6
| | | | | | | | | | | | | | | | | | | | | 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
* Added gdb-remote test to verify M memory write.Todd Fiala2014-06-101-0/+7
| | | | llvm-svn: 210594
* Added gdb-remote test for s packet, single stepping.Todd Fiala2014-06-091-4/+29
| | | | llvm-svn: 210481
* Added gdb-remote test for software breakpoints.Todd Fiala2014-06-051-15/+43
| | | | | | | | | | 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-041-26/+27
| | | | | | | | | | | | | | | | | | 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-041-0/+26
| | | | | | | | | | 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
* Added gdb-remote memory read ($m) test.Todd Fiala2014-06-031-0/+22
| | | | | | | | | | | | 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-301-21/+114
| | | | | | | | | | | | | | | | 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-291-8/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added gdb remote tests to verify $Hg{thread-id}.Todd Fiala2014-05-231-0/+55
| | | | | | | | | | | | | | | | | | | | | 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 gdb remote protocol tests across all qRegisterInfo responses.Todd Fiala2014-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added gdbremote tests to verify kill and continue after attach.Todd Fiala2014-05-141-3/+9
| | | | 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-141-1/+10
| | | | | | | | | 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
* Added gdb remote protocol tests for no output and inferior non-zero exit code.Todd Fiala2014-04-291-3/+27
| | | | | | | | | | 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 TestLldbGdbServer test for A start exe packet.Todd Fiala2014-04-251-0/+7
Fixed up bug in XFAIL tests where I appended an array when I intended to merge an array. llvm-svn: 207285
OpenPOWER on IntegriCloud