summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-2873-10354/+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-2738-38/+38
| | | | 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
* Remove use of octal literals.Zachary Turner2015-10-265-13/+13
| | | | | | | | | | | Python 3 has a different syntax for octal literals than Python 2 and they are incompatible with each other. Six doesn't provide a transparent wrapper around this, so the most sane thing to do is to not use octal literals. If you need an octal literal, use a decimal literal and if it's not obvious what the value is, provide the value in octal as a comment. llvm-svn: 251328
* Convert `long` to `int`, and portably detect all integral types.Zachary Turner2015-10-261-2/+3
| | | | llvm-svn: 251305
* Convert deprecated unittest method names.Zachary Turner2015-10-2612-42/+42
| | | | | | | Plural methods were long deprecated, and in Python 3 they are gone. Convert to the actual supported method names. llvm-svn: 251303
* Fix usages of range() and xrange() for Python 3.Zachary Turner2015-10-261-1/+1
| | | | llvm-svn: 251302
* [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
* Python3 - Wrap more statements in calls to list()Zachary Turner2015-10-234-10/+10
| | | | llvm-svn: 251129
* Add from __future__ import print_function everywhere.Zachary Turner2015-10-2339-30/+108
| | | | | | | | | | | | | 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-2237-141/+68
| | | | | | | | | | | | | | | | | | | | | 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
* Use six to portably handle module renames in Python 2 and 3Zachary Turner2015-10-212-6/+13
| | | | llvm-svn: 250915
* lldb-server: add support for binary memory readsPavel Labath2015-10-141-0/+45
| | | | | | | | | | | | | | | | | Summary: This commit adds support for binary memory reads ($x) to lldb-server. It also removes the "0x" prefix from the $x client packet, to make it more compatible with the old $m packet. This allows us to use almost the same code for handling both packet types. I have verified that debugserver correctly handles $x packets even without the leading "0x". I have added a test which verifies that the stub returns the same memory contents for both kinds of memory reads ($x and $m). Reviewers: tberghammer, jasonmolenda Subscribers: iancottrell, lldb-commits Differential Revision: http://reviews.llvm.org/D13695 llvm-svn: 250295
* [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
* Merge dwarf and dsym testsTamas Berghammer2015-09-3013-380/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently most of the test files have a separate dwarf and a separate dsym test with almost identical content (only the build step is different). With adding dwo symbol file handling to the test suit it would increase this to a 3-way duplication. The purpose of this change is to eliminate this redundancy with generating 2 test case (one dwarf and one dsym) for each test function specified (dwo handling will be added at a later commit). Main design goals: * There should be no boilerplate code in each test file to support the multiple debug info in most of the tests (custom scenarios are acceptable in special cases) so adding a new test case is easier and we can't miss one of the debug info type. * In case of a test failure, the debug symbols used during the test run have to be cleanly visible from the output of dotest.py to make debugging easier both from build bot logs and from local test runs * Each test case should have a unique, fully qualified name so we can run exactly 1 test with "-f <test-case>.<test-function>" syntax * Test output should be grouped based on test files the same way as it happens now (displaying dwarf/dsym results separately isn't preferable) Proposed solution (main logic in lldbtest.py, rest of them are test cases fixed up for the new style): * Have only 1 test fuction in the test files what will run for all debug info separately and this test function should call just "self.build(...)" to build an inferior with the right debug info * When a class is created by python (the class object, not the class instance), we will generate a new test method for each debug info format in the test class with the name "<test-function>_<debug-info>" and remove the original test method. This way unittest2 see multiple test methods (1 for each debug info, pretty much as of now) and will handle the test selection and the failure reporting correctly (the debug info will be visible from the end of the test name) * Add new annotation @no_debug_info_test to disable the generation of multiple tests for each debug info format when the test don't have an inferior Differential revision: http://reviews.llvm.org/D13028 llvm-svn: 248883
* 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
* Clean up register naming conventions inside lldb. Jason Molenda2015-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "gcc" register numbers are now correctly referred to as "ehframe" register numbers. In almost all cases, ehframe and dwarf register numbers are identical (the one exception is i386 darwin where ehframe regnums were incorrect). The old "gdb" register numbers, which I incorrectly thought were stabs register numbers, are now referred to as "Process Plugin" register numbers. This is the register numbering scheme that the remote process controller stub (lldb-server, gdbserver, core file support, kdp server, remote jtag devices, etc) uses to refer to the registers. The process plugin register numbers may not be contiguous - there are remote jtag devices that have gaps in their register numbering schemes. I removed all of the enums for "gdb" register numbers that we had in lldb - these were meaningless - and I put LLDB_INVALID_REGNUM in all of the register tables for the Process Plugin regnum slot. This change is almost entirely mechnical; the one actual change in here is to ProcessGDBRemote.cpp's ParseRegisters() which parses the qXfer:features:read:target.xml response. As it parses register definitions from the xml, it will assign sequential numbers as the eRegisterKindLLDB numbers (the lldb register numberings must be sequential, without any gaps) and if the xml file specifies register numbers, those will be used as the eRegisterKindProcessPlugin register numbers (and those may have gaps). A J-Link jtag device's target.xml does contain a gap in register numbers, and it only specifies the register numbers for the registers after that gap. The device supports many different ARM boards and probably selects different part of its register file as appropriate. http://reviews.llvm.org/D12791 <rdar://problem/22623262> llvm-svn: 247741
* Fixes lldb-server commandline test xpass for OS X and Linux; resolves ↵Todd Fiala2015-09-141-2/+1
| | | | | | llvm.org/pr20273 llvm-svn: 247605
* XFAIL single_step_only_steps_one_instruction related tests on arm/aarch64Tamas Berghammer2015-09-072-0/+3
| | | | llvm-svn: 246972
* 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
* Xfail TestGdbRemoteAbort for Android API <= 16.Chaoren Lin2015-07-211-1/+2
| | | | | | | | | | Reviewers: sivachandra Subscribers: tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D11378 llvm-svn: 242815
* Use /proc/$$/stat instead of $PPID.Chaoren Lin2015-07-061-1/+4
| | | | | | | | | | | | Summary: $PPID is not available on old shells. Reviewers: tberghammer, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10968 llvm-svn: 241486
* 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
* Fix TestAttachDenied and TestChangeProcessGroup for remote Windows to Android.Chaoren Lin2015-06-062-2/+2
| | | | | | | | | | | | | | Summary: Updated `append_to_remote_wd` to work for both remote and local. Reviewers: clayborg, ovyalov Reviewed By: ovyalov Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10288 llvm-svn: 239203
* Update TestGdbRemoteAbort and TestGdbRemoteSegFault to use `get_signal_number`.Chaoren Lin2015-06-062-2/+3
| | | | | | | | | | | | Reviewers: clayborg, ovyalov Reviewed By: ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10286 llvm-svn: 239201
OpenPOWER on IntegriCloud