summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MICmdCmdData.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [LLDB] Remove lldb-miJonas Devlieghere2019-07-181-1673/+0
| | | | | | | | | | | | | | As discussed on the mailing list [1], this patch removes the lldb-mi tool and its tests from the LLDB repository. We moved lldb-mi into a separate repository on GitHub [2] for downstream users or maintainers to build and package. [1] http://lists.llvm.org/pipermail/lldb-dev/2019-July/015103.html [2] https://github.com/lldb-tools/lldb-mi Differential revision: https://reviews.llvm.org/D64255 llvm-svn: 366465
* [lldb-mi] Include full path in the -data-disassemble responseTatyana Krasnukha2019-05-211-1/+8
| | | | | | | | Differential Revision: https://reviews.llvm.org/D59015 Patch by Anton Kolesov <Anton.Kolesov@synopsys.com> llvm-svn: 361255
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-89/+0
| | | | | | | | | | | | | | | | | | | | | | | A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
* [lldb-mi] Return source line number in proper formatTatyana Krasnukha2019-02-251-1/+1
| | | | | | | | | Line number is a decimal number and is printed as such, however for some reason it was prefixed with '0x', thus turning printed value invalid. Patch by Anton Kolesov <Anton.Kolesov@synopsys.com> llvm-svn: 354804
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Remove comments after header includes.Jonas Devlieghere2018-11-111-2/+2
| | | | | | | | | | This patch removes the comments following the header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. Differential revision: https://reviews.llvm.org/D54385 llvm-svn: 346625
* Fix windows build after r337689Alexander Polyakov2018-07-231-0/+1
| | | | | | Added missing header. llvm-svn: 337692
* [lldb-mi] Re-implement data-info-line command.Alexander Polyakov2018-07-231-141/+75
| | | | | | | | | | | | | | Summary: Now data-info-line command uses SB API instead of HandleCommand. Reviewers: aprantl, clayborg, jingham Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D49062 llvm-svn: 337689
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-1130/+1191
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Replace uses of MIUtilParse::CRegexParser with llvm::RegexPavel Labath2016-09-051-13/+15
| | | | | | | | | | | | | | | | Summary: Replace uses of the local MIUtilParse::CRegexParser class with the LLVM support class llvm::Regex. This reduces duplication of code, and makes it possible to remove the MIUtilParse::CRegexParser class that requires LLVM internal implementation headers. Bug: https://llvm.org/bugs/show_bug.cgi?id=29138 Reviewers: dawn, abidh, ki.stfu Subscribers: labath, ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D23882 Author: Michał Górny <mgorny@gentoo.org> llvm-svn: 280662
* Show real error message in -data-evaluate-expressionEugene Leviant2016-02-081-3/+6
| | | | llvm-svn: 260082
* Handle the options and parameters separator in every MI commandHafiz Abid Qadeer2015-11-021-2/+0
| | | | | | | | | | | | | | | | | | | 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
* Better handle the arguments common to all MI commands.Hafiz Abid Qadeer2015-10-291-23/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Allow to construct CMIUtilString using std::string directly + cleanup ↵Ilia K2015-09-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 the handling of files in -data-info-line and -symbol-list-lines.Dawn Perchik2015-09-171-43/+58
| | | | | | | | | | | | | 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-151-30/+30
| | | | | | | | | | | | | | | | | | | | | | | 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
* Fix -data-evaluate-expression for array.Hafiz Abid Qadeer2015-09-071-45/+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
* [lldb-mi] Use empty arg lists instead of (void).Bruce Mitchener2015-08-041-58/+58
| | | | | | | | | | | | 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] Remove unused bool results.Bruce Mitchener2015-07-221-75/+49
| | | | | | | | | | | | | | | 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 -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
* Use string::find(char) for single character strings.Bruce Mitchener2015-07-041-3/+3
| | | | | | | | | | | | Summary: Use string::find(char) for single character strings. Reviewers: abidh, ki.stfu, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10943 llvm-svn: 241390
* [lldb-mi] Use size_t where appropriate.Bruce Mitchener2015-07-031-19/+19
| | | | | | | | | | | | | | | Summary: Many places should have been using size_t rather than MIuint or MIint. This is particularly true for code that uses std::string::find(), std::string::rfind(), std::string::size(), and related methods. Reviewers: abidh, ki.stfu, domipheus Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10931 llvm-svn: 241360
* Remove typedefs for MIchar, MIschar, MIuchar.Bruce Mitchener2015-07-031-10/+10
| | | | | | | | | | | | | | | | Summary: This is a start on bringing lldb-mi more in line with the typical LLDB coding style. This just removes the usage of the typedefs and doesn't yet clean up any logic or other issues. (This is to keep the review simple.) Reviewers: abidh, ki.stfu, domipheus Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10917 llvm-svn: 241349
* Expand result with type char* to string in -data-evaluate-expressionIlia K2015-06-251-7/+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
* [LLDB-MI] Properly detect missing mandatory arguments to MI commandsBruce Mitchener2015-06-081-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Escape strings in disassembly comments.Ilia K2015-05-121-1/+1
| | | | | | | | | | | | Summary: Patch from chuckr@microsoft.com Reviewers: abidh, ChuckR Subscribers: paulmaybee, lldb-commits Differential Revision: http://reviews.llvm.org/D9544 llvm-svn: 237092
* Fix LLDB-MI -data-read-memory-bytes command to comply with GDB/MI specBruce Mitchener2015-05-071-15/+102
| | | | | | | | | | | | | | | | | | | | | | | Summary: - The address argument can now be an expression (e.g. &array), it's no longer restricted to being just a number literal. - The -o (offset) option is now properly handled, not just silently ignored. - The --thread option is now properly handled. - A new --frame option has been added for consistency with GDB. - Added a new test to verify old and new functionality. Patch by Vadim Macagon. Thanks! Test Plan: ./dotest.py -A x86_64 -C clang --executable $BUILDDIR/bin/lldb tools/lldb-mi/data Reviewers: domipheus, abidh, ki.stfu Reviewed By: abidh, ki.stfu Subscribers: brucem, lldb-commits Differential Revision: http://reviews.llvm.org/D9470 llvm-svn: 236694
* Add -data-info-line command (MI)Ilia K2015-04-301-0/+223
| | | | | | | | | | | | | | | | Summary: Add -data-info-line command + test Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/ Reviewers: abidh Reviewed By: abidh Subscribers: lldb-commits, abidh Differential Revision: http://reviews.llvm.org/D9276 llvm-svn: 236208
* Add comments to LLDB-MI disassembly.Ilia K2015-04-151-1/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the comments which are included in LLDB disassembly, but are currently missing in MI, e.g. ^done,asm_insns=[...,{address="0x00000000004004ff",func-name="main",offset="18",size="2",inst="jmp 0x40050b ; <+30> at main.c:7"}] instead of ^done,asm_insns=[...,{address="0x00000000004004ff",func-name="main",offset="18",size="2",inst="jmp 0x40050b"}] Thanks, Ewan Patch from ewan@codeplay.com Reviewers: abidh, EwanCrawford Subscribers: ted, lldb-commits, deepak2427 Differential Revision: http://reviews.llvm.org/D8964 llvm-svn: 235017
* expose 64 bit addresses through MIIlia K2015-03-191-6/+7
| | | | | | | | | | | | | | | | | Summary: This changes all reporting of addresses from lldb-mi to be 64 bit capable. There could have been cases where a 64 bit address was getting truncated to 32 bit format. Patch from chuckr@microsoft.com Reviewers: abidh, ChuckR Reviewed By: abidh Subscribers: paulmaybee, ki.stfu, zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D8238 llvm-svn: 232736
* Remove redundant comments from lldb-mi source files.Hafiz Abid Qadeer2015-03-161-10/+0
| | | | | | | Most of lldb-mi files have comments about environement, copyright etc which were neither needed nor uptodate. This commit removes those comments. llvm-svn: 232396
* Fix -data-read-memory-bytes command (MI)Ilia K2015-02-131-5/+5
| | | | | | | | | | | | | | | | | | | | | | 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
* Fix test case for data-disassemble instruction in lldb-mi.Hafiz Abid Qadeer2015-02-091-2/+7
| | | | | | | | | 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 evaluation commands (MI)Ilia K2015-02-061-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -data-list-register-names/-data-disassemble, minor fix in ↵Ilia K2015-02-061-47/+129
| | | | | | | | | | | | | | | | | | | | | | | -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
* Fix "-data-list-register-values" MI commands.Hafiz Abid Qadeer2015-02-051-17/+56
| | | | | | | | | | | If register numbers are not provided then this commands is supposed to return all the register values. But it was returning nothing in that case. More details about this command at https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Data-Manipulation.html#GDB_002fMI-Data-Manipulation llvm-svn: 228304
* Fix a typo in list-register-names command.Hafiz Abid Qadeer2015-02-051-1/+1
| | | | | | It was giving error when process was valid. llvm-svn: 228299
* Fix CLI commands in lldb-mi.Hafiz Abid Qadeer2015-02-031-19/+17
| | | | | | | | | | | | | | This patch fixes execution of CLI commands in MI mode. The CLI commands are executed using "-interpreter-exec" command. The bug was in the CMICmnLLDBDebugSessionInfo class which contained the following members: SBProcess, SBTarget, SBDebugger and SBListener, but CLI commands don't affect them and they aren't updated. Therefore some members can contain incorrect (or obsolete) reference and it can cause an error. My patch removes these members and uses getters that provides the updated instance every time it is used. Patch from Ilia K ki.stfu@gmail.com. Approved by Greg. llvm-svn: 227958
* Make --thread argument optional for various commands.Hafiz Abid Qadeer2015-02-021-2/+2
| | | | | | | | Currently it was marked as mandatory for many commands. Although it is recommended that fronends generate this argument, it is not mandatory. GDB seems to treat it as optional too. llvm-svn: 227798
* Added an Xcode target so we build the "lldb-mi" executable as part of the ↵Greg Clayton2015-01-201-4/+4
| | | | | | | | | | "desktop" and "desktop no xpc" targets. Include paths were switched to be user include paths, if this breaks the linux build we will need to fix the Makefiles/cmake stuff. <rdar://problem/19198581> llvm-svn: 226530
* Reformat lldb-mi using clang-format.Zachary Turner2014-11-171-1021/+1084
| | | | | | Courtesy of dawn@burble.org. llvm-svn: 222150
* Remove two unused class variables.Eric Christopher2014-09-091-2/+0
| | | | llvm-svn: 217420
* Add new MI commands, features and fixes to the lldb-mi driver.Deepak Panickal2014-08-081-69/+64
| | | | | | | | | | - Can now load an executable directly as an argument. - Fixes towards supporting local debugging. - Fixes for stack-list-arguments, data-evaluate-expression, environment-cd, stack-list-locals, interpreter-exec. - Fix breakpoint event handling. - Support dynamic loading of libraries using the search paths provided by Eclipse. llvm-svn: 215223
* Added support for new MI commands and bug fixes. More details in MIReadme.txt.Deepak Panickal2014-06-241-13/+1154
| | | | llvm-svn: 211607
* Initial commit of LLDB Machine Interface Frontend.Deepak Panickal2014-05-161-0/+229
- Tested with Eclipse, likely to work with other GDB/MI compatible GUIs. - Some but not all MI commands have been implemented. See MIReadme.txt for more info. - Written from scratch, no GPL code, based on LLDB Public API. - Built for Linux, Windows and OSX. Tested on Linux and Windows. - GDB/MI Command Reference, https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html llvm-svn: 208972
OpenPOWER on IntegriCloud