summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools/lldb-mi
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-2849-4547/+0
| | | | | | | | | | | This is the conclusion of an effort to get LLDB's Python code structured into a bona-fide Python package. This has a number of benefits, but most notably the ability to more easily share Python code between different but related pieces of LLDB's Python infrastructure (for example, `scripts` can now share code with `test`). llvm-svn: 251532
* Rename `lldb_shared` to `use_lldb_suite`.Zachary Turner2015-10-2719-19/+19
| | | | llvm-svn: 251444
* Deprecate -m/+m dotest options in favor of test categoriesPavel Labath2015-10-2719-93/+3
| | | | | | | | | | | | | | | | | | | Summary: This change deprecates -m/+m dotest options (the options are still recognized but they print an error message pointing to the new options) and adds a new lldb-mi test category instead. To just run lldb-mi tests, use '-G lldb-mi'. To skip lldb-mi tests, use '--skip-category lldb-mi'. All lldb-mi tests are marked as such using the getCategories method on the base MiTestCaseBase class and the @lldbmi_test decorator is not needed. In case one still needs to annotate a specific test function as an lldb-mi test, one can use the @add_test_categories(['lldb-mi']) decorator to achieve that. Reviewers: tfiala, dawn, ki.stfu, abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14060 llvm-svn: 251400
* [lldb-mi] Fix expansion of anonymous structures and unionsDawn Perchik2015-10-242-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A variable of type: struct S { union { int i1; unsigned u1; }; union { int i2; unsigned u2; }; }; had been impossible to evaluate in lldb-mi, because MI assigns '??' as the variable name to each of the unnamed unions after "-var-list-children" command. Also '??' incorrectly goes to 'exp' field which is treated by IDE as a structure field name and is displayed in watch window. The patch fixes this returning empty string as type name for unnamed union and assigning $N to variable name, where N is the field number in the parent entity. Patch from evgeny.leviant@gmail.com Reviewed by: clayborg, abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13947 llvm-svn: 251176
* Add from __future__ import print_function everywhere.Zachary Turner2015-10-2319-2/+40
| | | | | | | | | | | | | Apparently there were tons of instances I missed last time, I guess I accidentally ran 2to3 non-recursively. This should be every occurrence of a print statement fixed to use a print function as well as from __future__ import print_function being added to every file. After this patch print statements will stop working everywhere in the test suite, and the print function should be used instead. llvm-svn: 251121
* [lldb-mi] display summary for simple types + refactor (use lldb formatting ↵Dawn Perchik2015-10-232-8/+8
| | | | | | | | | | | | | | | for all cases) Previously, lldb did not use type summaries for simple types with no children (like function pointers). This patch enables MI to use lldb type summaries for evaluation of all types of objects, so MI own formatters are no longer needed. Patch from evgeny.leviant@gmail.com Reviewed by: abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13799 llvm-svn: 251082
* Update every test to import `lldb_shared`.Zachary Turner2015-10-2219-70/+41
| | | | | | | | | | | | | | | | | | | | | This is necessary in order to allow third party modules to be located under lldb/third_party rather than under the test folder directly. Since we're already touching every test file anyway, we also go ahead and delete the unittest2 import and main block wherever possible. The ability to run a test as a standalone file has already been broken for some time, and if we decide we want this back, we should use unittest instead of unittest2. A few places could not have the import of unittest2 removed,because they depend on the unittest2.expectedFailure or skip decorators. Removing all those was orthogonal in spirit to the purpose of this CL, so the import of unittest2 remains in those files that were using it for its test decorators. Those can be addressed separately. llvm-svn: 251055
* [lldb-mi] Fix evaluation of strings containing characters from non-ascii rangeDawn Perchik2015-10-073-38/+82
| | | | | | | | | | | | | | | | If a string contained characters outside the ASCII range, lldb-mi would print them as hexadecimal codes. This patch fixes this behaviour by converting to UTF-8 instead, by having lldb-mi use registered type summary providers, when they are available. This patch also fixes incorrect evaluation of some composite types, like std::string, by having them use a type registered type summary provider. Based on patch from evgeny.leviant@gmail.com Reviewed by: ki.stfu, granata.enrico, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13058 llvm-svn: 249597
* [lldb-mi] Add support for StopAtEntry in MI via "-exec-run --start".Dawn Perchik2015-10-011-0/+20
| | | | | | | | | | | | | | | | | | This patch adds a --start option to the lldb-mi -exec-run command for getting process stopped at entry point after launch. It is equivelent to the -s option in the lldb command line interpreter: process launch -s and is therefore not supported on all hosts and/or targets. To check if the --start option is supported, see if the corresponding feature "exec-run-start-option" is in the list of options reported by the lldb-mi "-list-features" command. Patch from engineer.developer@gmail.com (Kirill Lapshin) Reviewed by: ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12977 llvm-svn: 249072
* Fix TestMiSymbol for gcc-4.9 test.Chaoren Lin2015-09-171-1/+1
| | | | llvm-svn: 247914
* [lldb-mi] Fix the handling of files in -data-info-line and -symbol-list-lines.Dawn Perchik2015-09-176-3/+121
| | | | | | | | | | | | | This fixes -data-info-line and -symbol-list-lines to parse the filename and line correctly when line entries don't have the optional column number and the filename contains a Windows drive letter. It also fixes -symbol-list-lines when code from header files is generated. Reviewed by: abidh, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12115 llvm-svn: 247899
* Fix -data-evaluate-expression for array.Hafiz Abid Qadeer2015-09-072-0/+37
| | | | | | | | | | | | | | | | | | | | | | Summary: For an array declared like "blk[2][3]", this command was showing: -data-evaluate-expression blk ^done,value="{[0] = [3], [1] = [3]}" After this fix, it shows: -data-evaluate-expression blk ^done,value="{[0] = {[0] = 1, [1] = 2, [2] = 3}, [1] = {[0] = 4, [1] = 5, [2] = 6}}" The code to do the right thing was already available and used by other commands. So I have just used that and removed the half-baked previous implementation. Reviewers: ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12634 llvm-svn: 246965
* Extend the XFAIL for TestMiBreakPavel Labath2015-09-071-1/+1
| | | | | | the test is occasionally failing on linux for all tested scenarios. llvm-svn: 246956
* [TestMiBreak] Replace expectedFlakeyLinux with an appropriate expectedFailureAllSiva Chandra2015-09-041-1/+1
| | | | | | | | | | Reviewers: chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12653 llvm-svn: 246894
* Remove Unicode byte-order mark from python files.Zachary Turner2015-08-1316-16/+16
| | | | | | | | | This was caused by a bug in the PTVS source file editor, which has since been fixed and awaiting a new release. For now people using this editor need to remember to manually remove this before committing a file. llvm-svn: 244963
* Disable lldb-mi tests on Windows.Zachary Turner2015-08-1316-94/+93
| | | | | | | | | | | | | | | Most were already XFAIL'ed, but the reason for the XFAIL is that we don't have a suitable pexpect implementation on Windows. This isn't going to change unintentionally, so there is no reason to XFAIL them as opposed to just skip them. llvm.org/pr22274 tracks finding a suitable pexpect module for Windows, which should fix many of these issues. llvm.org/pr24452 tracks the larger issue of making the entire lldb-mi test suite work on Windows, of which finding a pexpect module is just one component. llvm-svn: 244951
* Add size field to library load event (MI)Ilia K2015-08-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: (This revision supersedes the abandon: http://reviews.llvm.org/D9716) Size field is used to let the debugger attribute an address to a specific library when symbols are not available. For example: OpenGLESApp4.app!Cube_draw() Line 74 C OpenGLESApp4.app!-[GameViewController glkView:drawInRect:](GameViewController * self, SEL _cmd, GLKView * view, CGRect rect) Line 89 C++ GLKit!<redacted> QuartzCore!<redacted> QuartzCore!<redacted> QuartzCore!<redacted> QuartzCore!<redacted> QuartzCore!<redacted> UIKit!<redacted> UIKit!<redacted> UIKit!<redacted> UIKit!<redacted> FrontBoardServices!<redacted> CoreFoundation!<redacted> Patch from paulmay@microsoft.com Reviewers: ChuckR, abidh, ki.stfu Subscribers: greggm, lldb-commits Differential Revision: http://reviews.llvm.org/D11574 llvm-svn: 244573
* [lldb-mi] Fix evaluation for children of created variable object.Dawn Perchik2015-07-311-0/+11
| | | | | | | | | | | | | | Move code in CMICmdCmdVarListChildren::Execute() up so that the child object will always be added when the MI command -var-list-children is entered (instead of only when the print-value was all or simple). This patch fixes evaluation of expressions like varobj.member for a created varobj with children. Reviewed by: abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11659 llvm-svn: 243782
* Escape new line and tabs in the result of variable evaluation.Hafiz Abid Qadeer2015-07-311-1/+1
| | | | | | | | | Expression evaluation error messages may have embedded new lines and tabs. These should be escaped in the result string. Patch by paulmaybee. Reviewed in http://reviews.llvm.org/D11570. llvm-svn: 243741
* Mark TestMiBreak as falkey on LinuxTamas Berghammer2015-07-301-0/+1
| | | | llvm-svn: 243628
* Clean up test/tools/lldb-mi/variable/main.cpp after r243619Ilia K2015-07-301-1/+1
| | | | llvm-svn: 243621
* Fix bug in expression display when determining if a pointer should be ↵Ilia K2015-07-302-0/+13
| | | | | | | | | | | | | | | | treated as a string Summary: Currently if the "first child" of the pointer is a char type then the pointer is displayed as a string. This test succeeds incorrectly when the pointer is to a structured type with a char type as its first field. Fix this by switching the test to retrieve the pointee type and checking that it is a char type. Reviewers: abidh, ChuckR, ki.stfu Subscribers: greggm, lldb-commits Differential Revision: http://reviews.llvm.org/D11488 llvm-svn: 243619
* [lldb-mi] Fix tests added in r243484 for breakpoints using file:func syntax.Dawn Perchik2015-07-291-22/+19
| | | | llvm-svn: 243510
* [lldb-mi] XFAIL new test added in r243484.Dawn Perchik2015-07-291-0/+1
| | | | llvm-svn: 243504
* [lldb-mi] Fix setting of breakpoints using file:func syntax.Dawn Perchik2015-07-281-1/+19
| | | | | | | | Reviewed by: ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11499 llvm-svn: 243484
* Support escapes and quotes in string and character values.Ilia K2015-07-282-29/+29
| | | | | | | | | | | | | | | Summary: Escape characters in strings and strings containing quotes were not appearing correctly in expression values. Patch from paulmay@microsoft.com Reviewers: abidh, ChuckR, paulmaybee Subscribers: greggm, lldb-commits Differential Revision: http://reviews.llvm.org/D11371 llvm-svn: 243383
* [lldb-mi] Fix breakpoints on functions when C++ namespaces are used.Dawn Perchik2015-07-271-9/+13
| | | | | | | | | | | | | The command "-break-insert ns::foo" for function 'foo' in namespace 'ns' was being parsed as file:function. This patch fixes these cases by adding checks for '::'. (Note: '::func' is not parsed correctly by lldb due to llvm.org/pr24271). Reviewed by: ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11396 llvm-svn: 243281
* [lldb-mi tests] Fix typo of sensitive.Bruce Mitchener2015-07-221-4/+4
| | | | llvm-svn: 242900
* Add support for specifying a language to use when parsing breakpoints.Dawn Perchik2015-07-212-0/+24
| | | | | | | | | | | | | | | | | | | | Target and breakpoints options were added: breakpoint set --language lang --name func settings set target.language pascal These specify the Language to use when interpreting the breakpoint's expression (note: currently only implemented for breakpoints on identifiers). If the breakpoint language is not set, the target.language setting is used. This support is required by Pascal, for example, to set breakpoint at 'ns.foo' for function 'foo' in namespace 'ns'. Tests on the language were also added to Module::PrepareForFunctionNameLookup for efficiency. Reviewed by: clayborg Subscribers: jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D11119 llvm-svn: 242844
* Expand result with type char* to string in -data-evaluate-expressionIlia K2015-06-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Expand result with type char* to string in -data-evaluate-expression. was: ``` -data-evaluate-expression str ^done,value="0x00007fffffffece0" ``` now: ``` -data-evaluate-expression str ^done,value="0x00007fffffffece0 \"hello\"" ``` All tests pass on Linux. Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi Reviewers: abidh Reviewed By: abidh Subscribers: lldb-commits, dawn, abidh Differential Revision: http://reviews.llvm.org/D10728 llvm-svn: 240631
* Fix FIXME comments in MiBreakTestCase.test_lldbmi_break_insert_settings as ↵Dawn Perchik2015-06-231-9/+6
| | | | | | suggested by abidh (MI) llvm-svn: 240444
* Adding some more flakey tests to the XFAIL listVince Harron2015-06-223-0/+4
| | | | llvm-svn: 240327
* Enhance lldb-mi arguments test (MI)Dawn Perchik2015-06-222-10/+39
| | | | | | | | | | | | | | SUMMARY: Add additional arguments to lldb-mi args tests to make sure arguments with quotes are handled correctly. Reviewers: ki.stfu Subscribers: lldb-commits Test Plan: ./dotest.py --executable lldb -f MiInterpreterExecTestCase.test_lldbmi_settings_set_target_run_args_before ./dotest.py --executable lldb -f MiInterpreterExecTestCase.test_lldbmi_settings_set_target_run_args_after Differential Revision: http://reviews.llvm.org/D10523 llvm-svn: 240325
* Add negative test for target.move-to-nearest-code=off using source locationDawn Perchik2015-06-171-4/+12
| | | | | | | | Test Plan: ./dotest.py --executable lldb -f MiBreakTestCase.test_lldbmi_break_insert_settings Reviewed By: clayborg, abidh Differential Revision: http://reviews.llvm.org/D10486 llvm-svn: 239968
* [LLDB-MI] Properly detect missing mandatory arguments to MI commandsBruce Mitchener2015-06-082-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously if an MI command had **X** mandatory and **Y** optional arguments you could provide **X** or more optional arguments without providing any of the mandatory arguments, and the argument validation code wouldn't complain. For example this would pass argument validation even though the mandatory **address** and **count** arguments are missing: -data-read-memory-bytes --thread 1 --frame 0 Part of the problem was that an empty string was considered a valid value for a mandatory argument, which didn't make much sense. Patch by Vadim Macagon. Thanks! Test Plan: ./dotest.py -A x86_64 -C clang --executable $BUILDDIR/bin/lldb tools/lldb-mi/ No unexpected failures on my Ubuntu 14.10 64bit Virtualbox VM. Reviewers: domipheus, ki.stfu, abidh Reviewed By: ki.stfu, abidh Subscribers: brucem, lldb-commits Differential Revision: http://reviews.llvm.org/D10299 llvm-svn: 239297
* Improve handling of print value argument in -stack-list-* commands.Hafiz Abid Qadeer2015-05-291-19/+19
| | | | | | | It was reviewed in http://reviews.llvm.org/D10106. Patch by paulmaybee. llvm-svn: 238572
* Have lldb-mi tests import pexpect at a narrower scope.Zachary Turner2015-05-261-1/+1
| | | | | | | | The tests are xfail'ed on Windows, but would still error out since they were importing pexpect at global scope. This way the tests will correctly report as unsupported. llvm-svn: 238249
* Fix handling of hijacked events in synchronous modeIlia K2015-05-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch includes the following changes: * Fix Target::Launch to handle hijacked event in synchronous mode * Improve MiStartupOptionsTestCase tests to expect *stopped (MI) * Add SBProcess::GetStopEventForStopID * Add ProcessModID::SetStopEventForLastNaturalStopID/GetStopEventForStopID * Add const qualifier to ProcessModID::GetLastNaturalStopID * Add SBProcess::GetStopEventForStopID * Don't broadcast hijacked event in Target::Launch * Add CMICmnLLDBDebugger::CheckIfNeedToRebroadcastStopEvent/RebroadcastStopEvent Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/startup_options/ Reviewers: zturner, jingham, clayborg, abidh Reviewed By: clayborg Subscribers: abidh, zturner, lldb-commits, clayborg, jingham Differential Revision: http://reviews.llvm.org/D9371 llvm-svn: 237781
* Don't print =breakpoint-created if BP info was emitted in the result record (MI)Ilia K2015-05-193-7/+11
| | | | llvm-svn: 237676
* Fix typo in previous commitPavel Labath2015-05-181-1/+1
| | | | llvm-svn: 237575
* Update TestMiVar with a bug idPavel Labath2015-05-181-1/+1
| | | | llvm-svn: 237571
* Add --move-to-nearest-code / target.move-to-nearest-code options (attempt 2)Ilia K2015-05-182-0/+49
| | | | | | | | | | | | This patch initially was committed in r237460 but later it was reverted (r237479) due to 4 new failures: * TestExitDuringStep.py * TestNumThreads.py * TestThreadExit.py * TestThreadStates.py This patch also fixes these tests. llvm-svn: 237566
* XFAIL'd MiVarTestCase.test_lldbmi_eval on gcc-4.9/i386Vince Harron2015-05-151-0/+1
| | | | | | | | It times out on TestMyVar:113 self.expect("\^done,value=\"0x[0-9a-f]+\"") llvm-svn: 237480
* Reverting r237460 to fix test failures introduced on OSX & LinuxVince Harron2015-05-152-49/+0
| | | | | | | | | TestExitDuringStep.py TestNumThreads.py TestThreadExit.py TestThreadStates.py llvm-svn: 237479
* Add --move-to-nearest-code / target.move-to-nearest-code optionsIlia K2015-05-152-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This option forces to only set a source line breakpoint when there is an exact-match This patch includes the following commits: # Add the -m/--exact-match option in "breakpoint set" command ## Add exact_match arg in BreakpointResolverFileLine ctor ## Add m_exact_match field in BreakpointResolverFileLine ## Add exact_match arg in BreakpointResolverFileRegex ctor ## Add m_exact_match field in BreakpointResolverFileRegex ## Add exact_match arg in Target::CreateSourceRegexBreakpoint ## Add exact_match arg in Target::CreateBreakpoint ## Add -m/--exact-match option in "breakpoint set" command # Add target.exact-match option to skip BP if source line doesn't match ## Add target.exact-match global option ## Add Target::GetExactMatch ## Refactor Target::CreateSourceRegexBreakpoint to accept LazyBool exact_match (was bool) ## Refactor Target::CreateBreakpoint to accept LazyBool exact_match (was bool) # Add target.exact-match test in SettingsCommandTestCase # Add BreakpointOptionsTestCase tests to test --skip-prologue/--exact-match options # Fix a few typos in lldbutil.check_breakpoint_result func # Rename --exact-match/m_exact_match/exact_match/GetExactMatch to --move-to-nearest-code/m_move_to_nearest_code/move_to_nearest_code/GetMoveToNearestCode # Add exact_match field in BreakpointResolverFileLine::GetDescription and BreakpointResolverFileRegex::GetDescription, for example: was: ``` 1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, locations = 1, resolved = 1, hit count = 2 1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2 ``` now: ``` 1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, exact_match = 0, locations = 1, resolved = 1, hit count = 2 1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2 ``` Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb functionalities/breakpoint/ ./dotest.py -v --executable $BUILDDIR/bin/lldb settings/ ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/breakpoint/ Reviewers: jingham, clayborg Reviewed By: clayborg Subscribers: lldb-commits, clayborg, jingham Differential Revision: http://reviews.llvm.org/D9273 llvm-svn: 237460
* Improve the MiVarTestCase.test_lldbmi_var_list_children test (MI)Ilia K2015-05-152-6/+32
| | | | llvm-svn: 237454
* Fix CMICmdArgValPrintValues::Validate & enable 4 tests that were XFAIL'ed in ↵Ilia K2015-05-152-4/+0
| | | | | | r237437 (MI) llvm-svn: 237443
* XFAIL 4 lldb-mi tests to get Linux build green back (MI)Ilia K2015-05-152-0/+4
| | | | llvm-svn: 237437
* Fix parsing of print-values arg (MI)Ilia K2015-05-152-18/+9
| | | | | | | | | # Add CMICmdArgValPrintValues argument # Rework -stack-list-arguments/-stack-list-locals/-stack-list-variables/-var-update/-var-list-children commands to use the CMICmdArgValPrintValues argument instead of usage of pair of non-mandatory arguments like: CMICmdArgValNumber(0) || CMICmdArgValLongOptions("no-values") llvm-svn: 237429
* Fix a reason of *stopped notifications due to SIGINT/SIGSTOP signals (MI)Ilia K2015-05-151-3/+3
| | | | | | | | | | | | | # Add SBProcess::GetInterruptedFromEvent # Add vrEvent arg in CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateStopped and CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal # Refactor CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal ## Clean up and fix typos ## Remove vwrbShouldBrk arg # Fix MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_{local,remote} to expect SIGSTOP instead of SIGINT llvm-svn: 237426
OpenPOWER on IntegriCloud