summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix -data-read-memory-bytes command (MI)Ilia K2015-02-133-13/+43
| | | | | | | | | | | | | | | | | | | | | | Summary: * Add IsHexadecimalNumber method to CMIUtilString (MI) * Add number format (dec,hex,auto) to CMICmdArgValNumber (MI) * Fix -data-read-memory-bytes to pass address in hex format (MI) * Fix output begin/end/offset fields format in -data-read-memory-bytes * Fix CMICmdArgValNumber::ExtractNumber to extract 64bit value * + tests All tests passed on OS X Reviewers: abidh, zturner, clayborg Reviewed By: clayborg Subscribers: lldb-commits, zturner, clayborg, abidh Differential Revision: http://reviews.llvm.org/D7610 llvm-svn: 229132
* Add -exec-arguments commandIlia K2015-02-132-7/+30
| | | | | | | | | | | | | | | | | Summary: This patch adds -exec-arguments command for lldb-mi. -exec-arguments command allows to specify arguments for executable file in MI mode. Also it contains tests for that command. Btw, new added files was formatted by clang-format. Reviewers: abidh, zturner, clayborg Reviewed By: clayborg Subscribers: zturner, emaste, clayborg, jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D6965 llvm-svn: 229110
* Fix for http://llvm.org/bugs/show_bug.cgi?id=21744Hafiz Abid Qadeer2015-02-135-14/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | GetVariableInfo () collected the values of the variable in a list. But it also tried to generate the name/value pairs for children. This caused generation of a wrong value string for may items. This function has been fixed to put value in the list only. The handling of --print-value related option has been moved to caller. GetVariableInfo2 and MIResponseFormVariableInfo3 have been removed. They were almost the duplicate of functions of similar names. I dont see any difference in the output of -stack-list-locals and -stack-list-arguments. So these functions just seemed unnecessary. Char variable was being printed as a string which caused garbage output. This has been fixed. Some misc. cleanup. Test cases have been added that check -stack-list-locals for struct, array and pointers. Modified other tests which depended on hard coded line numbers. Reviewed in http://reviews.llvm.org/D7589 llvm-svn: 229102
* Fix the test on Linux.Hafiz Abid Qadeer2015-02-121-1/+1
| | | | | | | The exception name that is thrown in Linux is different. I have |ed it to the already existing one. llvm-svn: 228932
* Clean up test/tools/lldb-mi/TestMiNotification.py (MI)Ilia K2015-02-111-2/+0
| | | | llvm-svn: 228804
* Fix segfault notification in lldb-miIlia K2015-02-112-1/+87
| | | | | | | | | | | | | | | | | Summary: This patch adds system exception handling in lldb-mi + tests. All tests pass on OS X. Reviewers: zturner, abidh, clayborg Reviewed By: clayborg Subscribers: emaste, lldb-commits, zturner, clayborg, abidh Differential Revision: http://reviews.llvm.org/D7500 llvm-svn: 228803
* Fix multiple problems of lldb-mi blocking on input monitoring and needing a ↵Hafiz Abid Qadeer2015-02-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | return. Summary: One of the problem is reported here. http://llvm.org/bugs/show_bug.cgi?id=22411 A fix was committed for this problem that works only for OSX. This revision extends that fix to other system. The select system call has some limitation with multi-threaded application which have been addresses here. LLDB-mi exits if quit command is given but needs an extra retur if -gdb-exit is given. That issue has also been addressed. Reviewers: ki.stfu, emaste Reviewed By: ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7529 llvm-svn: 228709
* Add thread-id field in *stopped notification (MI)Ilia K2015-02-101-2/+5
| | | | | | | | | | | | | | | | | Summary: Add thread-id field in *stopped notification (MI) + tests All tests pass on OS X Reviewers: zturner, clayborg, abidh Reviewed By: clayborg Subscribers: lldb-commits, zturner, clayborg, abidh Differential Revision: http://reviews.llvm.org/D7501 llvm-svn: 228681
* Add tests for -interpreter-exec command (MI)Ilia K2015-02-101-0/+173
| | | | llvm-svn: 228674
* Fix MI notification test case on Linux.Hafiz Abid Qadeer2015-02-091-1/+8
| | | | | | | | | This test case was checking for a specific stop reason which is different on Linux. This caused the test to fail. It now only checks for stoppped. Also added some more steps to run to main so that we dont pass when application has run to completion. llvm-svn: 228584
* Fix test case for data-disassemble instruction in lldb-mi.Hafiz Abid Qadeer2015-02-091-1/+1
| | | | | | | | | Previously the offset field showed the offset from the section base. I have fixed it so that first disassembled instruction has offset of 0. Also made a little modification in the test case to match the output coming form the lldb-mi. llvm-svn: 228577
* Fix test case failure on Linux.Hafiz Abid Qadeer2015-02-091-4/+5
| | | | | | | | The test case were failing becuase my test compiler was gcc. The generated code behaved a bit differently to the how the test expected. Adjusted a few lines so that it works on both gcc and clang. llvm-svn: 228576
* Remove forgotten file test/tools/lldb-mi/TestMiProgramArgs.py after r228286Ilia K2015-02-091-0/+0
| | | | llvm-svn: 228574
* Fix a handling of full path in break-insert.Hafiz Abid Qadeer2015-02-082-1/+12
| | | | | | | | | | | | | | | | | | | | For some time, eclipse (CDT) uses full path of the file in break-insert command when putting breakpoint on a source line. On windows, a typical command looks like the following. 56-break-insert -f F:\\work\\ws\\test\\main.c:49 Current implementation in lldb-mi have problem in 2 ways. 1. It was assuming that there will be only one : in the path which is wrong if full path is supplied. 2. CDT sends out path with double backslashes in windows which gives error on resolution. Fixed the : issue in lldb-mi. Changed FileSpec::Normalize to make sure that it handles the path with \\ correctly. Added test cases to check for full path in both lldb-mi and lldb. Also added a test case to check SBFileSpec with double slashes. llvm-svn: 228538
* Fix a missing "*stopped" notification in LLDB-MI after "process launch -s" ↵Ilia K2015-02-061-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in case of remote-macosx Summary: This patch fixes *stopped notification for remote target when started with eLaunchFlagStopAtEntry (for example, using "process launch -s"). See explanation below: ``` Target::Launch (ProcessLaunchInfo &launch_info, Stream *stream) { ... if (state != eStateConnected && platform_sp && platform_sp->CanDebugProcess ()) { ... } else { ... if (m_process_sp) error = m_process_sp->Launch (launch_info); } if (error.Success()) { if (launch_info.GetFlags().Test(eLaunchFlagStopAtEntry) == false) { .... } -- missing event if eLaunchFlagStopAtEntry is set -- m_process_sp->RestoreProcessEvents (); } ... return error ``` Also this patch contains tests and you can check how it works. Reviewers: zturner, clayborg, abidh Reviewed By: clayborg Subscribers: clayborg, abidh, zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D7273 llvm-svn: 228417
* Fix evaluation commands (MI)Ilia K2015-02-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: These changes include: * Fix -var-create to be able use current frame '*' (MI) * Fix print-values option in -var-update (MI) * Fix 'variable doesn't exist' error in -var-show-attributes (MI) * Mark print-values option as 'handled-by-cmd' in -var-update (MI) * Fix SBValue::GetValueDidChange if value was changed * Fix lldb-mi: -data-evaluate-expression shows undef vars. Before this fix -data-evaluate-expression perceives undefined variables as strings: ``` (gdb) -data-evaluate-expression undef ^done,value="undef" ``` * Minor fix: -data-evaluate-expression uses IsUnknownValue() * Enable MiEvaluateTestCase test All test pass on OS X. Reviewers: abidh, clayborg Subscribers: lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D7463 llvm-svn: 228414
* Fix -stack-list-locals and -stack-list-arguments (MI)Ilia K2015-02-061-6/+28
| | | | | | | | | | | | | | | | | | | | Summary: These changes include: * Add eVariableInfoFormat argument for MIResponseFormVariableInfo{,2,3} and GetVariableInfo{,2} functions * Fix -stack-list-locals and -stack-list-arguments: they ingored print-values * Enable MiStackTestCase tests for -stack-list-xxx commands All test pass on OS X. Reviewers: abidh, clayborg Reviewed By: abidh Subscribers: lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D7462 llvm-svn: 228412
* Fix -data-list-register-names/-data-disassemble, minor fix in ↵Ilia K2015-02-061-3/+0
| | | | | | | | | | | | | | | | | | | | | | | -data-list-register-values (MI) Summary: * Fix -data-list-register-names command: previously it ignored regno arguments and always showed all registers * Add 'size' field to -data-disassemble command: now we are able to get an instruction's size * Minor fix in -data-list-register-value: fix comments/code style * Enable all tests in MiDataTestCase * Fix the GetRegister function that gets an register by its index These changes were tested on OS X; all MiDataTestCase tests were passed. Reviewers: clayborg, abidh Reviewed By: clayborg, abidh Subscribers: clayborg, abidh, lldb-commits Differential Revision: http://reviews.llvm.org/D7442 llvm-svn: 228393
* Add a comment in tools/lldb-mi/TestMiExit.py after r228286Ilia K2015-02-051-1/+1
| | | | llvm-svn: 228324
* Add and update lldb-mi tests.Hafiz Abid Qadeer2015-02-0515-129/+937
| | | | | | | | | | | | | | | | | | | This patch includes following changes: Fix comments and code style Add new tests for many commands Improve existing tests Merge MiProgramArgsTestCase and MiExecTestCase Improve runCmd of MiTestCaseBase: add exactly option Improve test example (make it more complicated) Patch from ki.stfu. I xfailed some tests on Linux and also added an empty command after -gdb-exit as it blocks without it. Patch was reviewed in http://reviews.llvm.org/D7410. llvm-svn: 228286
* 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
* Clean lldb-mi test cases.Hafiz Abid Qadeer2015-01-278-752/+343
| | | | | | | | | | | This patch adds lldbmi_testcase.MiTestCaseBase class and removes a lot of repitition in the lldb-mi test cases. Also cleans import list and code-style. Presented for review in http://reviews.llvm.org/D7162. Patch from Ilia K <ki.stfu@gmail.com>. llvm-svn: 227218
* XFAIL pexpect tests on Windows.Zachary Turner2015-01-207-0/+13
| | | | | | | | | | | | | At some point we will need to either provide a pexpect equivalent on Windows, or provide some other method of doing out-of-process tests. Even with a pexpect replacement, it may be worth re-evaluating some of these tests to see if they would be better served as in-process tests. The larger issue of coming up with a pexpect replacement on Windows is tracked in http://llvm.org/pr22274. llvm-svn: 226614
* 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
* Cleanup lldb-mi test cases.Hafiz Abid Qadeer2014-12-306-79/+0
| | | | | | | | | | | Following changes were done. 1. Remove the extra line after -exec-run. 2. Remove check for prompt. 3. Remove 'quit' command. Initial patch was contributed by ki.stfu@gmail.com. llvm-svn: 224990
* Fix a bug where global variable can be reported as local.Hafiz Abid Qadeer2014-12-082-0/+123
| | | | | | | | | | There was an error in ORing mask which is used for getting a list of variables. Previously, these constants were unnamed, and possible it become the reason of this bug. Also added test case for -stack-list-local and -stack-list_arguments. Patch from Ilia K <ki.stfu@gmail.com>. llvm-svn: 223674
* Add test for MI tokens.Hafiz Abid Qadeer2014-11-271-0/+85
| | | | | | | | | This file tests the sequence of digits that can come before an MI command. Patch from dawn@burble.org. llvm-svn: 222873
* Improve lldb-mi tests. Hafiz Abid Qadeer2014-11-266-178/+98
| | | | | | | | | | | | summary of changes: Cleanup: Use "line_number" API instead of hardcoded source lines Combine child.sendline with previous child.send command. test_lldbmi_tokens: Add test for MI tokens. test_lldbmi_badpathexe: Remove check for prompt so test for bad path can be enabled. Patch from dawn@burble.org. llvm-svn: 222838
* Add initial lldb-mi tests.Hafiz Abid Qadeer2014-11-2510-0/+909
| | | | | | | | Test 'test_lldbmi_interrupt' is only enabled for Darwin as it seems to cause a timeout error on Linux. Patch from dawn@burble.org. llvm-svn: 222750
* 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
OpenPOWER on IntegriCloud