summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi
Commit message (Collapse)AuthorAgeFilesLines
...
* Handle the options and parameters separator in every MI commandHafiz Abid Qadeer2015-11-024-3/+4
| | | | | | | | | | | | | | | | | | | Summary: As per the following link, the "--" separator can appear between the options and parameters of any MI command. Previously this separator was only handled by the `-data-disassemble` MI command. I have moved the relevant code into `CMICmdBase` so that any MI command can handle the aforementioned separator. https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax Reviewers: ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14197 llvm-svn: 251793
* Fix Clang-tidy modernize-use-override warnings in include/lldb/Expression, ↵Eugene Zelenko2015-10-314-71/+39
| | | | | | source/Expression and tools/lldb-mi; other minor fixes. llvm-svn: 251730
* Remove 2 lines missed in earlier commit (r251636).Hafiz Abid Qadeer2015-10-301-2/+0
| | | | llvm-svn: 251704
* Better handle the arguments common to all MI commands.Hafiz Abid Qadeer2015-10-2919-141/+66
| | | | | | | | | | | | | | | | | | | | | | | | Summary: I observed that eclipse was passing --thread-group for many other commands then we are currently handling. Looking at the MI documentation, the following link states that each MI command accept the --thread and --frame option. Looking at the GDB implementation, it seems that apart from these 2, --thread-group is also handled the same way. https://sourceware.org/gdb/onlinedocs/gdb/Context-management.html#Context-management So instead of handling those arguments in every comamnds, I have moved them into the base class and removed them from elsewhere. Now any command can use these arguments. The patch seems big but most of the changes are mechanical. Reviewers: ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14177 llvm-svn: 251636
* [lldb-mi] Fix expansion of anonymous structures and unionsDawn Perchik2015-10-242-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [lldb-mi] Fix unused variable warning.Bruce Mitchener2015-10-241-1/+0
| | | | llvm-svn: 251166
* Fix the build when building with LLDB_DISABLE_PYTHON.Aidan Dodds2015-10-231-0/+4
| | | | llvm-svn: 251104
* [lldb-mi] display summary for simple types + refactor (use lldb formatting ↵Dawn Perchik2015-10-234-186/+126
| | | | | | | | | | | | | | | 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
* Revert r248047 and fix the problem properlyKeno Fischer2015-10-191-0/+1
| | | | | | | | | | | | In r248047, I attempted to fix a build breakage introduced by using llvm's regex support from lldb-mi. However, my approach was flawed when LLVM and lldb are dynamically linked, in which case two copies of LLVMSupport would end up in memory, causing crashes on lldb start up. Instead, use LINK_COMPONENTS to make sure lldb-mi has access to the LLVMSupport symbols without causing duplication in the dynamic library case. llvm-svn: 250751
* Superficial fix for the windows build when building with ↵Aidan Dodds2015-10-151-0/+2
| | | | | | LLDB_DISABLE_PYTHON. The definition of lldb::SBTypeSummary and some methods of lldb::SBValue are hidden via a LLDB_DISABLE_PYTHON check, causing an compilation fail because of their use here. llvm-svn: 250391
* [lldb-mi] Fix evaluation of strings containing characters from non-ascii rangeDawn Perchik2015-10-072-0/+46
| | | | | | | | | | | | | | | | 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-013-26/+50
| | | | | | | | | | | | | | | | | | 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
* [lldb-mi] Fix assignment operator in CMIUtilStringDawn Perchik2015-09-251-8/+1
| | | | | | | | | | | | | | | | | Fix assignment operator in CMIUtilString to not crash the debugger if it is passed a NULL pointer, which can happen in code like the following: SBValue val; CMIUtilString s; //... s = val.GetSummary(); Patch from evgeny.leviant@gmail.com Reviewed by: clayborg, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13094 llvm-svn: 248597
* Allow to construct CMIUtilString using std::string directly + cleanup ↵Ilia K2015-09-2513-51/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CMIUtilString (MI) Summary: Allow to construct CMIUtilString using std::string directly + cleanup CMIUtilString (MI) This patch cleans up lldb-mi code, and serves to simplify the following case: ``` std::string strGoodbye = "!Hello"; CMIUtilString strHello(strGoodbye.substr(1).c_str()); ``` With CMIUtilString(std::string) we can omit .c_str(): ``` std::string strGoodbye = "!Hello"; CMIUtilString strHello(strGoodbye.substr(1)); ``` Also, it removes 2 ctors because they aren't needed: # CMIUtilString::CMIUtilString(const char *const *vpData) # CMIUtilString::CMIUtilString(const char *vpData, size_t nLen) and cleans up CMIUtilString::operator=(const std::string &vrRhs). Reviewers: brucem, abidh Subscribers: lldb-commits, brucem, abidh Differential Revision: http://reviews.llvm.org/D13158 llvm-svn: 248566
* [lldb-mi] Fix unresolved reference to llvm_regcomp and llvm_regfree.Daniel Sanders2015-09-221-1/+3
| | | | | | | | Subscribers: krytarowski, labath, lldb-commits Differential Revision: http://reviews.llvm.org/D13027 llvm-svn: 248251
* [lldb-mi] Fix the handling of files in -data-info-line and -symbol-list-lines.Dawn Perchik2015-09-177-55/+343
| | | | | | | | | | | | | 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
* [lldb-mi] Clean up CMICmdArgSet usage.Bruce Mitchener2015-09-1517-142/+141
| | | | | | | | | | | | | | | | | | | | | | | Summary: CMICmdArgSet stores a vector of non-const pointers to the arguments that it is validating. It owns them and is responsible for deleting them. We don't need to pass a const reference to the argument to CMICmdArgSet::Add and then take the address and const_cast it when we can just pass the argument pointer in directly. This lets us remove some noise at every call site for CMICmdArgSet::Add and then clean up a couple of bits inside CMICmdArgSet to remove const_casts. Reviewers: abidh, ki.stfu, domipheus Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12878 llvm-svn: 247677
* [lldb-mi] Simplify CMICmnLLDBDebugSessionInfo::Shutdown.Bruce Mitchener2015-09-154-18/+5
| | | | | | | | | | | | | | | Summary: * SharedDataDestroy couldn't fail, so no need to return a status. * No need for status, so can remove error message. The error message wasn't displayed or used anywhere anyway. Reviewers: abidh, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12879 llvm-svn: 247673
* [lldb-mi] No need to call Format with no varargs.Bruce Mitchener2015-09-112-6/+6
| | | | | | | | | | | | | | Summary: There's no need to call CMIUtilString::Format with a string and no args. Reviewers: abidh, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12796 llvm-svn: 247403
* [lldb-mi] Fix failure in log file initialization.Bruce Mitchener2015-09-111-0/+1
| | | | | | I broke this in r247388. llvm-svn: 247390
* [lldb-mi] Remove MIUtilSystem*.Bruce Mitchener2015-09-1110-517/+7
| | | | | | | | | | | | | | | | | | Summary: This platform-specific code wasn't fully implemented and wasn't actually needed. There was one call for the log file path and that has been addressed. This lets us also remove an error message from MICmnLogMediumFile as it is no longer used. Reviewers: ki.stfu, domipheus, abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12764 llvm-svn: 247388
* Add missing include for va_list in MIUtilString.hStephane Sezer2015-09-081-0/+1
| | | | | | | | | | | | | | Summary: Problem was caught on NetBSD. Reviewers: joerg, sas Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12654 Change by Kamil Rytarowski <n54@gmx.com> llvm-svn: 247034
* Fix -data-evaluate-expression for array.Hafiz Abid Qadeer2015-09-072-46/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* Fix CMICmdArgValConsume to correctly handle "--".Hafiz Abid Qadeer2015-09-041-4/+2
| | | | | | CMICmdArgValConsume::Validate was not removing it from the input stream. llvm-svn: 246858
* Fix multiple problems in -break-condition command.Hafiz Abid Qadeer2015-09-041-2/+1
| | | | | | | | | | | | | | 1. To handle the expression with spaces, this command uses 2 arguments. For a case like -break-condition 1 i == 5, the first will pick the 'i' and second will pick the '== 5'. But the second argument was made mandatory which failed in cases when there was no space in the expression like i==5. 2. The function GetRestOfExpressionNotSurroundedInQuotes has 2 locals with the same names. It resulted in one hiding the other and this function always returned empty string. No regression on Linux. Committed as obvious. llvm-svn: 246847
* Move GetOptInc to the common namespacePavel Labath2015-09-041-1/+1
| | | | | | | | | | | | | | | | | | | Summary: GetOptInc provides getopt(), getopt_long() and getopt_long_only(). Windows (for defined(_MSC_VER)) doesn't ship with all of the getopt(3) family members and needs all of them. NetBSD requires only getopt_long_only(3). While there fix the code for clang diagnostics. Author: Kamil Rytarowski Reviewers: joerg Subscribers: labath, zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D12582 llvm-svn: 246843
* Only export public symbols with the cmake build.Bruce Mitchener2015-09-041-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This also moves the xcode support files to be near or the same as the ones used for cmake. The source/API/liblldb.xcodes.exports differs from the source/API/liblldb.exports in that one contains the actual symbol names (_ prefixed) while the other contains the symbol names as they are in the code. The liblldb.exports file is preprocessed by the cmake scripts into the correct per-platform file needed (like a linker script on Linux). This is not enabled on Windows as Windows doesn't use the same name mangling and so it won't be valid there. Also, this is handled already in a different way on Windows (via dll exports). Reviewers: emaste, clayborg, labath, chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12599 llvm-svn: 246822
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-031-2/+0
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* Simplify find_first_of & find_last_of on single char.Bruce Mitchener2015-09-015-11/+11
| | | | | | | | | | | | | | | Summary: When calling find_first_of and find_last_of on a single character, we can instead just call find / rfind and make our intent more clear. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12518 llvm-svn: 246609
* [lldb-mi] Use find, not find_first_of, for "--".Bruce Mitchener2015-09-012-2/+2
| | | | | | | | | | | | | | | Summary: find_first_of will look for any of the characters, not the full string passed in. When looking for "--" then, we must use find and not find_first_of. Reviewers: ki.stfu, abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12517 llvm-svn: 246529
* [lldb-mi] Add (gdb) prompt after =breakpoint-modified and =breakpoint-created.Dawn Perchik2015-08-191-1/+4
| | | | | | | | Reviewed by: abidh, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12113 llvm-svn: 245488
* Add size field to library load event (MI)Ilia K2015-08-112-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 non-OS X builds.Bruce Mitchener2015-08-041-0/+3
| | | | llvm-svn: 243978
* [lldb-mi] Simplify MICmnMIOutOfBandRecord implementation.Bruce Mitchener2015-08-042-85/+103
| | | | | | | | | | | | | | | | | | | | | | Summary: * Remove extraneous members that were just storing temporary values. * OutOfBand_e parameters don't need to be const as they are scalars. * Switch from a map with CMIUtilString values to using a mapping function. This uses a switch statement which will generate a warning if a new result class is added. * Make BuildAsyncRecord a static function rather than a private member function so that we can construct the result text correctly and avoid having extra stuff in the header. Reviewers: abidh, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11751 llvm-svn: 243975
* [lldb-mi] Use empty arg lists instead of (void).Bruce Mitchener2015-08-04147-1500/+1500
| | | | | | | | | | | | Summary: This brings the code more in line with the usual LLDB style. NFC. Reviewers: abidh, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11746 llvm-svn: 243967
* [lldb-mi] Fix evaluation for children of created variable object.Dawn Perchik2015-07-311-2/+3
| | | | | | | | | | | | | | 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
* Fix bug in expression display when determining if a pointer should be ↵Ilia K2015-07-302-7/+47
| | | | | | | | | | | | | | | | 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 setting of breakpoints using file:func syntax.Dawn Perchik2015-07-281-1/+6
| | | | | | | | 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-284-28/+68
| | | | | | | | | | | | | | | 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-5/+23
| | | | | | | | | | | | | 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] Remove unwanted comment blocks.Bruce Mitchener2015-07-2376-359/+0
| | | | | | | | | | | | | | | Summary: This removes Authors:, Gotchas:, Changes: and Copyright:. It leaves a couple of Gotcha: blocks that were not empty. Reviewers: abidh, ki.stfu, domipheus Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11452 llvm-svn: 242996
* [lldb-mi] Remove unused bool results.Bruce Mitchener2015-07-2237-524/+382
| | | | | | | | | | | | | | | Summary: Many methods, in particular various 'Add' methods didn't have any actual failure scenarios that were being emitted. This meant that a lot of surrounding code could be simplified. Reviewers: abidh, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11412 llvm-svn: 242911
* Fix warnings found by -Wextra-semiPavel Labath2015-07-227-8/+8
| | | | | | patch by Eugene Zelenko. llvm-svn: 242875
* [lldb-mi] Correct file names in first line comments.Bruce Mitchener2015-07-2118-18/+18
| | | | llvm-svn: 242781
* [lldb-mi] Fix Windows build, missing assert.h include.Bruce Mitchener2015-07-211-0/+3
| | | | | | | | | | Reviewers: ki.stfu, abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11387 llvm-svn: 242778
* [lldb-mi] Simplify MICmnMIResultRecord implementation.Bruce Mitchener2015-07-212-67/+54
| | | | | | | | | | | | | | | | | | | | | | | Summary: * Remove extraneous members that were just storing temporary values. * ResultClass_e parameters don't need to be const as they are scalars. * Switch from a map with CMIUtilString values to using a mapping function. This uses a switch statement which will generate a warning if a new result class is added. * Make BuildRecordResult a static function rather than a private member function so that we can construct the result text correctly and avoid having extra stuff in the header. * Don't need (void) parameter lists in C++. Reviewers: abidh, ki.stfu, domipheus Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11052 llvm-svn: 242769
* [lldb-mi] Remove unused portions of MIDataTypes.h.Bruce Mitchener2015-07-211-16/+0
| | | | | | | | | | Reviewers: abidh, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11385 llvm-svn: 242768
* [lldb-mi] size_t rather than MIuint for arg counts.Bruce Mitchener2015-07-214-9/+9
| | | | | | | | | | | | Summary: [lldb-mi] size_t rather than MIuint for arg counts. Reviewers: abidh, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11049 llvm-svn: 242762
* Fix -data-info-line when source includes column number.Dawn Perchik2015-07-151-1/+1
| | | | | | | | | | | | This fixes an off-by-one bug in CMICmdCmdDataInfoLine::Acknowledge. Given: LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:123:1 -data-info-line would report the line as 12, omitting the last digit. Reviewed by: ki.stfu, abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11209 llvm-svn: 242306
OpenPOWER on IntegriCloud