summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [LLDB] Remove lldb-miJonas Devlieghere2019-07-181-905/+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-32/+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] Fix conversion warning for 64-bit buildTatyana Krasnukha2019-02-251-1/+1
| | | | llvm-svn: 354803
* [lldb-mi] Check raw pointers before passing them to std::string ctor/assignmentTatyana Krasnukha2019-02-251-2/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D55653 llvm-svn: 354798
* 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
* Clean up lldb-types.hPavel Labath2017-07-181-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: It defined a couple of types (condition_t) which we don't use anymore, as we have c++11 goodies now. I remove these definitions. Also it unnecessarily included a couple of headers which weren't necessary for it's operation. I remove these, and place the includes in the relevant files (usually .cpp, usually in Host code) which use them. This allows us to reduce namespace pollution in most of the lldb files which don't need the OS-specific definitions. Reviewers: zturner, jingham Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D35113 llvm-svn: 308304
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-561/+610
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-191-1/+2
| | | | | | | | | | | | Take 2, with missing cmake line fixed. Build tested on Ubuntu 14.04 with clang-3.6. See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279202
* Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"Todd Fiala2016-08-191-2/+1
| | | | | | This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8. llvm-svn: 279200
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-191-1/+2
| | | | | | | | | See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279198
* [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-231-1/+91
| | | | | | | | | | | | | | | 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
* Allow to construct CMIUtilString using std::string directly + cleanup ↵Ilia K2015-09-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] Use empty arg lists instead of (void).Bruce Mitchener2015-08-041-15/+15
| | | | | | | | | | | | 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] Spell resource string name correctly.Bruce Mitchener2015-07-071-2/+2
| | | | | | | | | | | | | | Broardcaster -> Broadcaster Summary: [lldb-mi] Spell resource string name correctly. Reviewers: abidh, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10993 llvm-svn: 241591
* Remove typedefs for MIchar, MIschar, MIuchar.Bruce Mitchener2015-07-031-3/+3
| | | | | | | | | | | | | | | | 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
* Fix a variety of typos.Bruce Mitchener2015-06-181-3/+3
| | | | | | No functional change. llvm-svn: 239995
* Fix handling of hijacked events in synchronous modeIlia K2015-05-201-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove quit hook in CMIDriver::DoMainLoop (MI)Ilia K2015-05-071-7/+38
| | | | | | | | | | | | | | | | | | | | Summary: This patch removes quit hook and fixes 1 bug: # Fix "quit" hook in CMIDriver::DoMainLoop (MI) # Fix bug when the handler thread exits without any notification (MI) # Fix a race condition in CMICmnLLDBDebugger::MonitorSBListenerEvents (MI) 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/D9275 llvm-svn: 236702
* Turn off 'quit' confirmation in lldb-miIlia K2015-03-231-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: # Turn off interpreter.prompt-on-quit on startup (MI) # Add CommandInterpreter::SetPromptOnQuit # Add SBCommandInterpreter::GetPromptOnQuit/SetPromptOnQuit All tests pass on OS X. Test Plan: ``` -file-exec-and-symbols ~/p/hello -break-insert -f main -exec-run -interpreter-exec console quit ``` Reviewers: abidh, clayborg Reviewed By: abidh, clayborg Subscribers: lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8444 llvm-svn: 233034
* Fix handling of CommandInterpreter's events in lldb-miIlia K2015-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously lldb-mi contains a stub for that but it didn't work and all CommanInterpreter's events were ignored. This commit adds a handling of CommandInterpreter's events in lldb-mi. Steps: # Fix CMICmnLLDBDebugger::InitSBListener # Add SBCommandInterpreter::EventIsCommandInterpreterEvent # Exit on lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived All tests pass on OS X. In further we can remove "quit" hack in lldb-mi. Test Plan: # Create start_script file: ``` target create ~/p/hello b main r quit ``` # Run lldb-mi --interpreter # Execute start_script file by following command: ``` -interpreter-exec console "command source start_script" ``` Log: ``` $ bin/lldb-mi --interpreter (gdb) -interpreter-exec console "command source start_script" Executing commands in '/Users/IliaK/p/llvm/build_ninja/start_script'. (lldb) target create ~/p/hello Current executable set to '~/p/hello' (x86_64). (lldb) b main Breakpoint 1: where = hello`main + 29 at hello.cpp:12, address = 0x0000000100000e2d (lldb) r Process 1582 launched: '/Users/IliaK/p/hello' (x86_64) (lldb) quit ^done (gdb) =thread-created,id="1",group-id="i1" =thread-selected,id="1" (gdb) =shlibs-added,shlib-info=[num="1",name="hello",dyld-addr="-",reason="dyld",path="/Users/IliaK/p/hello",loaded_addr="-",dsym-objpath="/Users/IliaK/p/hello.dSYM/Contents/Resources/DWARF/hello"] ... =shlibs-added,shlib-info=[num="132",name="libDiagnosticMessagesClient.dylib",dyld-addr="0x7fff91705000",reason="dyld",path="/usr/lib/libDiagnosticMessagesClient.dylib",loaded_addr="0x7fff91705000"] (gdb) *stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x100000e2d",func="main",args=[{name="argc",value="1"},{name="argv",value="0x00007fff5fbffc88"}],file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="12"},thread-id="1",stopped-threads="all" (gdb)<press Enter> MI: Program exited OK ``` Reviewers: abidh, clayborg Reviewed By: abidh Subscribers: jingham, lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8382 llvm-svn: 232891
* Remove redundant comments from lldb-mi source files.Hafiz Abid Qadeer2015-03-161-12/+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 =shlibs-added/=shlibs-removed notifications (MI)Ilia K2015-03-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds =shlibs-added/=shlibs-removed notifications in lldb-mi. In more detail: # Add Target::ModulesDidLoad/ModulesDidUnload notifications # Improve Target::TargetEventData: ## Refactoring ## Move it back to include/lldb/Target/Target.h ## Add Target::{GetModuleListFromEvent,GetModuleList}; Add Target::m_module_list # Add SBModule::{GetSymbolVendorMainFileSpec,GetObjectFileHeaderAddress} # Add SBTarget::{EventIsTaretEvent,GetTargetFromEvent,GetNumModulesFromEvent,GetModuleAtIndexFromEvent} All tests pass on OS X. Reviewers: abidh, zturner, jingham, clayborg Reviewed By: clayborg Subscribers: jingham, zturner, lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8201 llvm-svn: 231858
* Add -exec-abort command (MI); Don't exit on eStateExitedIlia K2015-02-241-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add -exec-abort command + test. Also, I had fixed an error, when lldb-mi exits on eStateExited. With current patch we can re-run target: ``` -file-exec-and-symbols hello ^done -exec-run ^running *stopped,reason="breakpoint-hit"... -exec-abort ^done *stopped,reason="exited-normally"... <- program exits -exec-run <- run again ^running *stopped,reason="breakpoint-hit"... ``` All tests pass on OS X. Reviewers: zturner, emaste, abidh, clayborg Reviewed By: abidh, clayborg Subscribers: lldb-commits, emaste, zturner, clayborg, abidh Differential Revision: http://reviews.llvm.org/D7794 llvm-svn: 230321
* Fix a race condition in lldb-mi.Hafiz Abid Qadeer2015-02-041-1/+7
| | | | | | | | | | | | | | | | | | | | | | lldb-mi has 3 threads. 1. One that waits for user intput. 2. Another waits for 1st thread to get input command. 3. Waits for events from lldb. 2 & 3 needs to be synchronized so that they don't end up doing things at same time. For example, while "break insert" is processing, we can get a breakpoint event. Depending on where we are in "break-insert", it can have different behavior. In some cases, it can cause breakpoint to be deleted too. I have added a mutex so that command processing and event processing are done exclusively and they are not running at the same time. In longer term, I think thread 2 & 3 should be merged to be only one thread which can wait on command or events. Reviewed in http://reviews.llvm.org/D7371. llvm-svn: 228128
* Fix CLI commands in lldb-mi.Hafiz Abid Qadeer2015-02-031-1/+2
| | | | | | | | | | | | | | 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
* 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-538/+559
| | | | | | Courtesy of dawn@burble.org. llvm-svn: 222150
* Add new MI commands, features and fixes to the lldb-mi driver.Deepak Panickal2014-08-081-2/+0
| | | | | | | | | | - 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-92/+36
| | | | llvm-svn: 211607
* Initial commit of LLDB Machine Interface Frontend.Deepak Panickal2014-05-161-0/+765
- 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