summaryrefslogtreecommitdiffstats
path: root/lldb/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Except only EIO errors of OSError exception in Base.deletePexpectChild() in ↵Ilia K2015-02-111-1/+8
| | | | | | lldbtest.py after r227086 llvm-svn: 228877
* 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
* Close terminal after LaunchInTerminalTestCase testIlia K2015-02-111-1/+1
| | | | | | | | | | | | | | | | Summary: The test_launch_in_terminal test leaves a running terminal. This patch adds "exit" after debugging with eLaunchFlagLaunchInTTY flag. Reviewers: jingham, zturner, clayborg Reviewed By: clayborg Subscribers: emaste, vharron, lldb-commits, clayborg, jingham, zturner Differential Revision: http://reviews.llvm.org/D7468 llvm-svn: 228801
* Fix 'process launch -i' for remote processesVince Harron2015-02-101-6/+19
| | | | | | | | | | | | | | | | | | We want to forward stdin when stdio is not disabled and when we're not redirecting stdin from a file. renamed m_stdio_disable to m_stdin_forward and inverted value because that's what we want to remember. There was previously a bug that if you redirected stdin from a file, stdout and stderr would also be redirected to /dev/null Adds support for remote target to TestProcessIO.py Fixes ProcessIOTestCase.test_stdin_redirection_with_dwarf for remote Linux targets llvm-svn: 228744
* 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
* Add a test case for the launch via argdumper globbing mechanismEnrico Granata2015-02-108-0/+80
| | | | llvm-svn: 228659
* Add a JSON producer to LLDB - this is a set of classes that encapsulate JSON ↵Enrico Granata2015-02-103-11/+0
| | | | | | | | objects and allow you to write them to a Stream for subsequent processing Using this JSON producer, write a little tool that expands its own command-line arguments and dumps them to stdout as a JSON array llvm-svn: 228636
* 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 TestFdLeak.py on Mac.Pavel Labath2015-02-092-6/+4
| | | | | | bug introduced in D7466. For some reason target.Launch behaves differently on linux and mac. llvm-svn: 228582
* 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 descriptor leak in multi-target debuggingPavel Labath2015-02-091-0/+23
| | | | | | | | | | | | | | | Summary: When debugging two targets concurrently, the pseude terminal master fd from the first one would leak into the second. This fixes the problem by setting O_CLOEXEC on the master fd. Test included. Reviewers: clayborg, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7466 llvm-svn: 228570
* Fix a handling of full path in break-insert.Hafiz Abid Qadeer2015-02-084-2/+25
| | | | | | | | | | | | | | | | | | | | 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
* Dont' use close_fds = True on Windows.Zachary Turner2015-02-071-5/+12
| | | | | | | | | If you do, the test runner will fail immediately with the error: close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr. llvm-svn: 228472
* 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 ConvenienceVariablesCase.test_with_dsym_and_run_command test after r227285Ilia K2015-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes test_with_dsym_and_run_command and test_with_dwarf_and_run_commands tests after r227285: "SBThread::GetDescription should use the Thread format instead of making up" log: ``` ====================================================================== FAIL: test_with_dsym_and_run_command (TestConvenienceVariables.ConvenienceVariablesCase) Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame. ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 456, in wrapper return func(self, *args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 612, in wrapper func(*args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 18, in test_with_dsym_and_run_command self.convenience_variables() File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 83, in convenience_variables patterns = ['SBThread: tid = 0x[0-9a-f]+']) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2091, in expect msg if msg else EXP_MSG(str, exe)) AssertionError: False is not True : 'print lldb.thread thread #1: tid = 0x80d885, 0x0000000100000f4d a.out`main(argc=1, argv=0x00007fff5fbff078) + 29 at main.c:4, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 ' matches expected result Config=x86_64-clang ====================================================================== FAIL: test_with_dwarf_and_run_commands (TestConvenienceVariables.ConvenienceVariablesCase) Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame. ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 473, in wrapper return func(self, *args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 641, in wrapper func(*args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 612, in wrapper func(*args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 537, in wrapper func(*args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 537, in wrapper func(*args, **kwargs) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 28, in test_with_dwarf_and_run_commands self.convenience_variables() File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 83, in convenience_variables patterns = ['SBThread: tid = 0x[0-9a-f]+']) File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2091, in expect msg if msg else EXP_MSG(str, exe)) AssertionError: False is not True : 'print lldb.thread thread #1: tid = 0x80d8d3, 0x0000000100000f4d a.out`main(argc=1, argv=0x00007fff5fbff078) + 29 at main.c:4, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 ' matches expected result Config=x86_64-clang ``` Reviewers: zturner, jingham, abidh, clayborg Subscribers: abidh, lldb-commits, jingham, clayborg, zturner Differential Revision: http://reviews.llvm.org/D7464 llvm-svn: 228415
* 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
* Check-in generated test makefilesPavel Labath2015-02-055-0/+19
| | | | | | for rationale, see D7407. llvm-svn: 228314
* Avoid leaking log file descriptors into the inferior process.Pavel Labath2015-02-051-4/+16
| | | | | | | | | | | | | | Summary: This commit adds a new open flag File::eOpenOptionCloseOnExec (i.e., O_CLOEXEC), and adds it to the list of flags when opening log files (#ifndef windows). A regression test is included. Reviewers: vharron, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7412 llvm-svn: 228310
* In fd leak test report all open fds, not only first failureEd Maste2015-02-051-3/+3
| | | | llvm-svn: 228306
* 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
* Clean up dependency .d.$$$$ files for testsPavel Labath2015-02-051-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Mac-only tests were leaving .d.$$$$ dependency files left in the test tree. This happened because: 1) "make clean" was invoked although no tests in the folder were run 2) The Makefile had main.d as a dependency, which meant it tried to compile the source file (to extract dependencies). 3) The compile failed (does not compile on linux) and left behind a main.d.$$$$ temporary file. 4) "make clean" tried to clean up these temporary files, but the expansion $(wildcard *.d.[0-9]*) was performed before the temporary file was created, so this file was not caught. I fix this by giving all the temporary files deterministic names, which makes it easier to clean them up afterwards. I also make the rules for generating the dependency files more robust and less likely to leak files in the first place. Reviewers: vharron, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7406 llvm-svn: 228285
* Extend SBPlatform with capability to launch/terminate a process remotely. ↵Oleksiy Vyalov2015-02-041-7/+77
| | | | | | | | Integrate this change into test framework in order to spawn processes on a remote target. http://reviews.llvm.org/D7263 llvm-svn: 228230
* Get test/types tests passing on remote targetsVince Harron2015-02-041-3/+20
| | | | | | | | redirecting output to a path that will work well on host or target. copying file from output location to location on local host that test will read from llvm-svn: 228217
* Get rid of Debugger::FormatPrompt() and replace it with the new FormatEntity ↵Greg Clayton2015-02-046-3/+85
| | | | | | | | | | | | | | | | | | | class. Why? Debugger::FormatPrompt() would run through the format prompt every time and parse it and emit it piece by piece. It also did formatting differently depending on which key/value pair it was parsing. The new code improves on this with the following features: 1 - Allow format strings to be parsed into a FormatEntity::Entry which can contain multiple child FormatEntity::Entry objects. This FormatEntity::Entry is a parsed version of what was previously always done in Debugger::FormatPrompt() so it is more efficient to emit formatted strings using the new parsed FormatEntity::Entry. 2 - Allows errors in format strings to be shown immediately when setting the settings (frame-format, thread-format, disassembly-format 3 - Allows auto completion by implementing a new OptionValueFormatEntity and switching frame-format, thread-format, and disassembly-format settings over to using it. 4 - The FormatEntity::Entry for each of the frame-format, thread-format, disassembly-format settings only replaces the old one if the format parses correctly 5 - Combines all consecutive string values together for efficient output. This means all "${ansi.*}" keys and all desensitized characters like "\n" "\t" "\0721" "\x23" will get combined with their previous strings 6 - ${*.script:} (like "${var.script:mymodule.my_var_function}") have all been switched over to use ${script.*:} "${script.var:mymodule.my_var_function}") to make the format easier to parse as I don't believe anyone was using these format string power user features. 7 - All key values pairs are defined in simple C arrays of entries so it is much easier to add new entries. These changes pave the way for subsequent modifications where we can modify formats to do more (like control the width of value strings can do more and add more functionality more easily like string formatting to control the width, printf formats and more). llvm-svn: 228207
* Fix TestTargetAPI.py when run against remote host.Vince Harron2015-02-041-1/+9
| | | | | | | In tests where stdio is redirected to a file, the file must be copied back from the remote host for analysis by the test. llvm-svn: 228175
* 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
* Avoid leakage of file descriptors in LLDB and LLGSPavel Labath2015-02-044-2/+67
| | | | | | | | | | | | | | | Summary: Both LLDB and LLGS are leaking file descriptors into the debugged process. This plugs the leak by closing the unneeded descriptors. In one case I use O_CLOEXEC, which I hope is supported on relevant platforms. I also added a regression test and plugged a fd leak in dosep.py. Reviewers: vharron, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7372 llvm-svn: 228130
* Add an expectall() API that allows you to pass a list of patterns and have ↵Enrico Granata2015-02-031-0/+7
| | | | | | pexpect match *ALL* of them instead of just picking one llvm-svn: 227938
* Make it easier to see what's going on by tracing the test caseEnrico Granata2015-02-031-1/+2
| | | | llvm-svn: 227936
* Mark TestProcessLaunch.test_set_working_dir_with_dwarf as expected to fail ↵Chaoren Lin2015-02-031-1/+2
| | | | | | in LLGS mode due llvm.org/pr20265 llvm-svn: 227927
* Share crash information between LLGS and local POSIX debugging withChaoren Lin2015-02-032-5/+3
| | | | | | | CrashReason class. Deliver crash information from LLGS to lldb via description field of thread stop packet. llvm-svn: 227926
* Mark several tests as XFAIL with new expectedFailureLLGS decorator since ↵Chaoren Lin2015-02-037-1/+16
| | | | | | they are failing in Darwin for the same reason. llvm-svn: 227925
* Modify ThreadStateCoodrinator in order to resume threads if stop wasn't ↵Chaoren Lin2015-02-031-1/+1
| | | | | | requested. llvm-svn: 227924
* Fixed TestInferiorChangedChaoren Lin2015-02-031-1/+1
| | | | | | replaced expected stop reason 'address invalid' with 'signal SIGSEGV' llvm-svn: 227921
* Fixed TestInferiorCrashing failuresChaoren Lin2015-02-031-2/+7
| | | | | | | | LLGS debugging is outputting different thread stop reasons than local linux debugging. The stop reasons are reasonable so I've left left them alone. Might update them to match darwin in the future. llvm-svn: 227920
* Allow customizing the timeout of the inferiorEnrico Granata2015-02-031-2/+4
| | | | llvm-svn: 227906
* And, do not define arguments twiceEnrico Granata2015-02-031-1/+1
| | | | llvm-svn: 227905
* Allow pexpect exact matchesEnrico Granata2015-02-031-8/+12
| | | | llvm-svn: 227904
* Some cleanup in lldbpexpectEnrico Granata2015-02-021-12/+6
| | | | llvm-svn: 227889
* Nice syntax typo in lldbpexpectEnrico Granata2015-02-021-1/+1
| | | | llvm-svn: 227887
* Add an helper class to write pexpect-based test casesEnrico Granata2015-02-021-0/+48
| | | | | | Over time, we should improve this class and port all pexpect based testing over to using this llvm-svn: 227875
* Adapt test for tid format on non-Darwin platformsEd Maste2015-01-301-1/+5
| | | | llvm-svn: 227580
OpenPOWER on IntegriCloud