summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MICmdCmdStack.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [LLDB] Remove lldb-miJonas Devlieghere2019-07-181-1053/+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
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-60/+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
* 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
* iwyu fixes on lldbUtility.Zachary Turner2017-04-061-0/+2
| | | | | | | | | | | | | This patch makes adjustments to header file includes in lldbUtility based on recommendations by the iwyu tool (include-what-you-use). The goal here is to make sure that all files include the exact set of headers which are needed for that file only, to eliminate cases of dead includes (e.g. someone deleted some code but forgot to delete the header includes that that code necessitated), and to eliminate the case where header includes are picked up transitively. llvm-svn: 299676
* Enable lldm-mi commands -stack-list-locals -stack-list-variables and ↵Ilia K2017-04-041-2/+4
| | | | | | | | | | | | | | | | -var-create to work only with variables in scope Patch by ayuckhulk Reviewers: abidh, lldb-commits, ki.stfu Reviewed By: ki.stfu Tags: #lldb Differential Revision: https://reviews.llvm.org/D31073 llvm-svn: 299417
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-621/+680
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* 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-291-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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] Clean up CMICmdArgSet usage.Bruce Mitchener2015-09-151-16/+16
| | | | | | | | | | | | | | | | | | | | | | | 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] Use empty arg lists instead of (void).Bruce Mitchener2015-08-041-42/+42
| | | | | | | | | | | | 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-27/+20
| | | | | | | | | | | | | | | 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 parsing of print-values arg (MI)Ilia K2015-05-151-99/+10
| | | | | | | | | # 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
* Add support for -stack-list-variables.Hafiz Abid Qadeer2015-04-291-0/+194
| | | | | | | | This command is able to list both local variables and stack arguments for a specific thread/frame. Args are denoted with 'arg="1"'. Patch from Chuck Ries. llvm-svn: 236090
* Refactor ↵Ilia K2015-04-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CMICmnLLDBDebuggerHandleEvents/CMICmnLLDBDebugSessionInfo/CMICmnLLDBDebugSessionInfoVarObj (MI) Summary: This patch includes the following changes: # Refactor GetVariableInfo/GetValueStringFormatted/GetValue to use the same code (MI) Also it expands the variable value format for strings (aka char*): was: ``` ^done,name="v4",numchild="1",value="0x0000000100000f56",type="const char *",thread-id="1",has_more="0" ``` now: ``` ^done,name="v4",numchild="1",value="0x0000000100000f56 \"ab\"",type="const char *",thread-id="1",has_more="0" ``` # Expand the variable value format for arrays (according to GDB) For example: was: ``` ^done,name="v3",numchild="2",value="{...}",type="char [2]",thread-id="1",has_more="0" ``` now: ``` ^done,name="v3",numchild="2",value="[2]",type="char [2]",thread-id="1",has_more="0" ``` # Rename MiGdbSetShowTestCase.test_lldbmi_gdb_show_process_stopatentry_default to test_lldbmi_gdb_show_process_stopatentry (MI) # Fix a comment in MiGdbSetShowTestCase.test_lldbmi_gdb_show_process_stopatentry (MI) # Refactor CMICmnLLDBUtilSBValue ## Add CMICmnLLDBUtilSBValue::IsPointerType/IsArrayType ## Refactor CMICmnLLDBUtilSBValue::GetValue ## Fix CMICmnLLDBUtilSBValue::IsChildCharType to ignore a number of childs ## Rename CMICmnLLDBUtilSBValue::IsChildCharType to IsFirstChildCharType ## Fix CMICmnLLDBUtilSBValue::GetValueCString to accept char[] # Minor changes in CMICmnLLDBUtilSBValue::GetValue # Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo family functions (MI) # Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo family functions (MI) ## Remove CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo2 ## Improve CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo to accept args # Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo family functions (MI) ## Add vArgInfo arg to CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo ## Move CMICmnLLDBDebugSessionInfo::GetFrameInfo/MIResponseFormFrameInfo to private namespace # Refactor CMICmnLLDBDebugSessionInfo::GetThreadFrames family functions (MI) ## Remove CMICmnLLDBDebugSessionInfo::GetThreadFrames2 ## Improve CMICmnLLDBDebugSessionInfo::GetThreadFrames to accept vnMaxDepth # Fix vnMaxDepth arg name in CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo (MI) # Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo family functions (MI) ## Merge CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo functions into one # Don't modify fnName in CMICmnLLDBDebugSessionInfo::GetThreadFrames (MI) # Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo family functions (MI) ## Remove CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo3 ## Improve -CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo to accept vnMaxDepth # Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo family functions (MI) ## Remove CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo2 ## Add CMICmnLLDBDebugSessionInfo::ThreadInfoFormat_e enum to specify thread format ## Improve CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo to accept veThreadInfoFormat ## Remove vnMaxDepth arg in CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo (not needed because veThreadInfoFormat was added) # Move CMICmnLLDBDebugSessionInfo::GetThreadFrames to private namespace (MI) # Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo (MI) ## Add CMICmnLLDBDebugSessionInfo::FrameInfoFormat_e enum to specify frame format ## Improve CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo to accept veFrameInfoFormat ## Remove vnMaxDepth arg in CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo (not needed because veFrameInfoFormat was added) # Remove duplicated level field in CMICmnLLDBDebugSessionInfo::GetThreadFrames (MI) # Refactor CMICmnLLDBUtilSBValue::GetValue (MI) ## Add CMICmnLLDBUtilSBValue::GetSimpleValue ## Use CMICmnLLDBUtilSBValue::GetSimpleValue in GetVlaue # Fix CMICmnLLDBDebugSessionInfo::GetThreadFrames (MI) ## Add CMICmnLLDBDebugSessionInfo::FrameInfoFormat_e::eFrameInfoFormat_AllArgumentsInSimpleForm which is used to get stack-args in simple form (i.e. show {...} for composite types). It can be done by calling MIResponseFormVariableInfo with vnMaxDepth=0. ## Improve CMICmnLLDBDebugSessionInfo::GetThreadFrames to accept veFrameInfoFormat ## Remove vnMaxDepth from CMICmnLLDBDebugSessionInfo::GetThreadFrames (we should use veFrameInfoFormat instead) # Refactor CMICmnLLDBUtilSBValue::GetValue to expand composite types (MI) ## Add CMICmnLLDBUtilSBValue::GetCompositeValue to expand composite types ## Add CMICmnLLDBUtilSBValue::m_pComposite to avoid multiple {...} in the code ## Improve CMICmnLLDBUtilSBValue::GetValue to accept vbExpandAggregates option (default=false) ## Clean up CMICmnLLDBDebugSessionInfo::GetVariableInfo to use CMICmnLLDBUtilSBValue::GetValue ## Remove the wrapping into {} in CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo ## Fix MiStackTestCase.test_lldbmi_stack_list_locals test to expect result without superfluous space ' ' around the '{' or '}' brackets: was: ``` {name=\"var_c\",value=\"{var_a = 10,var_b = 97 'a',inner_ = { var_d = 30 }} ``` now: ``` {name=\"var_c\",value=\"{var_a = 10,var_b = 97 'a',inner_ = {var_d = 30}} ``` ## Fix vwrValue arg name in CMICmnLLDBUtilSBValue::GetSimpleValue (was vrValue) # Refactor CMICmnLLDBDebugSessionInfo::GetVariableInfo (MI) ## Remove vnMaxDepth/vbIsChildValue/vnDepth args in CMICmnLLDBDebugSessionInfo::GetVariableInfo ## Improve CMICmnLLDBDebugSessionInfo::GetVariableInfo to accept vwrStrValue ## Remove vwrMiValueList arg in CMICmnLLDBDebugSessionInfo::GetVariableInfo (we should use vwrStrValue instead) ## Fix CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo to Escape values was: ``` {name="p",value="0x0000000000000000 """} ``` now: ``` {name="p",value="0x0000000000000000 \"\""} ``` # Refactor CMICmnLLDBUtilSBValue ## Improve CMICmnLLDBUtilSBValue::GetValue to handle PrintExpandAggregates ## Improve CMICmnLLDBUtilSBValue::GetSimpleValue to handle vbHandleArrayType (use it to specify that array should be represented as simple type, i.e. value="[2]") # Add spacing between fields in CMICmnLLDBUtilSBValue::GetCompositeValue (MI) For example: was: ``` ^done,name="var3",numchild="3",value="{i = 3,inner = {l = 3},complex_ptr = 0x00007fff5fbff848}",type="complex_type",thread-id="1",has_more="0" ``` now: ``` ^done,name="var3",numchild="3",value="{i = 3, inner = {l = 3}, complex_ptr = 0x00007fff5fbff848}",type="complex_type",thread-id="1",has_more="0" ``` # Fix spacing in MiStackTestCase.test_lldbmi_stack_list_locals test (MI) Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/ Reviewers: abidh Subscribers: lldb-commits, abidh Differential Revision: http://reviews.llvm.org/D8913 llvm-svn: 234476
* 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
* Add low-frame/high-frame options to -stack-list-arguments (MI)Ilia K2015-03-121-1/+29
| | | | | | | | | | | | | | | | | Summary: Add low-frame/high-frame options to -stack-list-arguments All tests pass on OS X. Reviewers: clayborg, abidh Reviewed By: abidh Subscribers: lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8282 llvm-svn: 232048
* Add -stack-select-frame command (MI)Ilia K2015-02-191-0/+122
| | | | | | | | | | | | | | | | | Summary: Add -stack-select-frame command + test. All tests pass on OS X. Reviewers: abidh, emaste, clayborg Reviewed By: clayborg Subscribers: lldb-commits, emaste, clayborg, abidh Differential Revision: http://reviews.llvm.org/D7765 llvm-svn: 229901
* Add -stack-info-frame command (MI)Ilia K2015-02-191-0/+108
| | | | | | | | | | | | | | | | | Summary: Add -stack-info-frame command + test. All tests pass on OS X. Reviewers: emaste, clayborg, abidh Reviewed By: abidh Subscribers: lldb-commits, clayborg, emaste, abidh Differential Revision: http://reviews.llvm.org/D7750 llvm-svn: 229857
* Fix for http://llvm.org/bugs/show_bug.cgi?id=21744Hafiz Abid Qadeer2015-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | GetVariableInfo () collected the values of the variable in a list. But it also tried to generate the name/value pairs for children. This caused generation of a wrong value string for may items. This function has been fixed to put value in the list only. The handling of --print-value related option has been moved to caller. GetVariableInfo2 and MIResponseFormVariableInfo3 have been removed. They were almost the duplicate of functions of similar names. I dont see any difference in the output of -stack-list-locals and -stack-list-arguments. So these functions just seemed unnecessary. Char variable was being printed as a string which caused garbage output. This has been fixed. Some misc. cleanup. Test cases have been added that check -stack-list-locals for struct, array and pointers. Modified other tests which depended on hard coded line numbers. Reviewed in http://reviews.llvm.org/D7589 llvm-svn: 229102
* Fix -stack-list-locals and -stack-list-arguments (MI)Ilia K2015-02-061-6/+71
| | | | | | | | | | | | | | | | | | | | 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 CLI commands in lldb-mi.Hafiz Abid Qadeer2015-02-031-8/+8
| | | | | | | | | | | | | | 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-4/+4
| | | | | | | | 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-1/+1
| | | | | | | | | | "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
* Fix a bug where global variable can be reported as local.Hafiz Abid Qadeer2014-12-081-2/+2
| | | | | | | | | | There was an error in ORing mask which is used for getting a list of variables. Previously, these constants were unnamed, and possible it become the reason of this bug. Also added test case for -stack-list-local and -stack-list_arguments. Patch from Ilia K <ki.stfu@gmail.com>. llvm-svn: 223674
* Reformat lldb-mi using clang-format.Zachary Turner2014-11-171-469/+489
| | | | | | Courtesy of dawn@burble.org. llvm-svn: 222150
* Compare against the right size integer.Eric Christopher2014-09-091-1/+1
| | | | llvm-svn: 217422
* Add new MI commands, features and fixes to the lldb-mi driver.Deepak Panickal2014-08-081-66/+44
| | | | | | | | | | - 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-16/+16
| | | | llvm-svn: 211607
* Initial commit of LLDB Machine Interface Frontend.Deepak Panickal2014-05-161-0/+656
- 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