summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
Commit message (Collapse)AuthorAgeFilesLines
* Improve LLDB prompt handlingPavel Labath2015-05-272-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There is an issue in lldb where the command prompt can appear at the wrong time. The partial fix we have in for this is not working all the time and is introducing unnecessary delays. This change does: - Change Process:SyncIOHandler to use integer start id's for synchronization to avoid it being confused by quick start-stop cycles. I picked this up from a suggested patch by Greg to lldb-dev. - coordinates printing of asynchronous text with the iohandlers. This is also based on a (different) Greg's patch, but I have added stronger synchronization to it to avoid races. Together, these changes solve the prompt problem for me on linux (both with and without libedit). I think they should behave similarly on Mac and FreeBSD and I think they will not make matters worse for windows. Test Plan: Prompt comes out alright. All tests still pass on linux. Reviewers: clayborg, emaste, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9823 llvm-svn: 238313
* Add support for custom commands to set flags on themselvesEnrico Granata2015-05-2712-126/+128
| | | | | | | | | This works for Python commands defined via a class (implement get_flags on your class) and C++ plugin commands (which can call SBCommand::GetFlags()/SetFlags()) Flags allow features such as not letting the command run if there's no target, or if the process is not stopped, ... Commands could always check for these things themselves, but having these accessible via flags makes custom commands more consistent with built-in ones llvm-svn: 238286
* Add real time signals support to LinuxSignalsPavel Labath2015-05-221-3/+3
| | | | | | | | | | | | | | Summary: This enables correct handling of real time signals by lldb. Test Plan: Added a test that verifies handling of SIGRTMIN Reviewers: tberghammer, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9911 llvm-svn: 238009
* Default dst value for platform put-file.Chaoren Lin2015-05-201-2/+2
| | | | | | | | | | | | | | Summary: It should default to working-dir/src-filename if dst is not specified. Reviewers: clayborg, flackr Reviewed By: flackr Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9890 llvm-svn: 237831
* Add --move-to-nearest-code / target.move-to-nearest-code options (attempt 2)Ilia K2015-05-181-3/+28
| | | | | | | | | | | | This patch initially was committed in r237460 but later it was reverted (r237479) due to 4 new failures: * TestExitDuringStep.py * TestNumThreads.py * TestThreadExit.py * TestThreadStates.py This patch also fixes these tests. llvm-svn: 237566
* Reverting r237460 to fix test failures introduced on OSX & LinuxVince Harron2015-05-151-28/+3
| | | | | | | | | TestExitDuringStep.py TestNumThreads.py TestThreadExit.py TestThreadStates.py llvm-svn: 237479
* Add --move-to-nearest-code / target.move-to-nearest-code optionsIlia K2015-05-151-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This option forces to only set a source line breakpoint when there is an exact-match This patch includes the following commits: # Add the -m/--exact-match option in "breakpoint set" command ## Add exact_match arg in BreakpointResolverFileLine ctor ## Add m_exact_match field in BreakpointResolverFileLine ## Add exact_match arg in BreakpointResolverFileRegex ctor ## Add m_exact_match field in BreakpointResolverFileRegex ## Add exact_match arg in Target::CreateSourceRegexBreakpoint ## Add exact_match arg in Target::CreateBreakpoint ## Add -m/--exact-match option in "breakpoint set" command # Add target.exact-match option to skip BP if source line doesn't match ## Add target.exact-match global option ## Add Target::GetExactMatch ## Refactor Target::CreateSourceRegexBreakpoint to accept LazyBool exact_match (was bool) ## Refactor Target::CreateBreakpoint to accept LazyBool exact_match (was bool) # Add target.exact-match test in SettingsCommandTestCase # Add BreakpointOptionsTestCase tests to test --skip-prologue/--exact-match options # Fix a few typos in lldbutil.check_breakpoint_result func # Rename --exact-match/m_exact_match/exact_match/GetExactMatch to --move-to-nearest-code/m_move_to_nearest_code/move_to_nearest_code/GetMoveToNearestCode # Add exact_match field in BreakpointResolverFileLine::GetDescription and BreakpointResolverFileRegex::GetDescription, for example: was: ``` 1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, locations = 1, resolved = 1, hit count = 2 1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2 ``` now: ``` 1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, exact_match = 0, locations = 1, resolved = 1, hit count = 2 1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2 ``` Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb functionalities/breakpoint/ ./dotest.py -v --executable $BUILDDIR/bin/lldb settings/ ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/breakpoint/ Reviewers: jingham, clayborg Reviewed By: clayborg Subscribers: lldb-commits, clayborg, jingham Differential Revision: http://reviews.llvm.org/D9273 llvm-svn: 237460
* Remote Non-Stop SupportEwan Crawford2015-05-131-0/+6
| | | | | | | | | | | | | | | | | | | | Summary: This patch is the beginnings of support for Non-stop mode in the remote protocol. Letting a user examine stopped threads, while other threads execute freely. Non-stop mode is enabled using the setting target.non-stop-mode, which sends a QNonStop packet when establishing the remote connection. Changes are also made to treat the '?' stop reply packet differently in non-stop mode, according to spec https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Non_002dStop.html#Remote-Non_002dStop. A setting for querying the remote for default thread on setup is also included. Handling of '%' async notification packets will be added next. Reviewers: clayborg Subscribers: lldb-commits, ADodds, ted, deepak2427 Differential Revision: http://reviews.llvm.org/D9656 llvm-svn: 237239
* Fixed a ton of gcc compile warningsVince Harron2015-05-131-1/+1
| | | | | | | | | | Removed some unused variables, added some consts, changed some casts to const_cast. I don't think any of these changes are very controversial. Differential Revision: http://reviews.llvm.org/D9674 llvm-svn: 237218
* Platform settings doesn't need permission options.Chaoren Lin2015-05-121-3/+0
| | | | | | | | | | | | | | | | Summary: Also removes conflict error message for '-w' between --user-write and --working-dir. Reviewers: flackr, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9711 llvm-svn: 237178
* Don't call the Process::SyncIOHandler in Target::LaunchIlia K2015-05-071-1/+6
| | | | | | | | | | | | | | Summary: This patch moves synchronization of iohandler to CommandObjectProcessLaunch::DoExecute like it was done in CommandObjectProcessContinue::DoExecute. Reviewers: jingham, clayborg Reviewed By: clayborg Subscribers: lldb-commits, clayborg, jingham Differential Revision: http://reviews.llvm.org/D9373 llvm-svn: 236699
* Add language command and LanguageRuntime plugin changes to allow vending of ↵Colin Riley2015-05-043-0/+88
| | | | | | | | command objects. Differential Revision: http://reviews.llvm.org/D9402 llvm-svn: 236443
* Change process kill to call Process::Destroy (force_kill = true);Jason Molenda2015-05-011-1/+1
| | | | | | | | follow-up to the change in r235158. Right now if you attach to a process and type "kill", lldb doesn't kill it, it detaches. <rdar://problem/20691198> llvm-svn: 236363
* Factor resolution of abbreviations and aliases so that they can be tested ↵Adrian McCarthy2015-04-231-1/+1
| | | | | | directly. http://reviews.llvm.org/D9033 llvm-svn: 235633
* This is some groundwork for filtering the language ExceptionJim Ingham2015-04-221-9/+31
| | | | | | | | | | | | | | breakpoints, for instance on the class of the thrown object. This change doesn't actually make that work, the part where we extract the thrown object type from the throw site isn't done yet. This provides a general programmatic "precondition" that you can add to breakpoints to give them the ability to do filtering on the LLDB side before we pass the stop on to the user-provided conditions & callbacks. llvm-svn: 235538
* Add a "force_kill" arg to Process::Destroy(). This is needed afterJason Molenda2015-04-171-2/+2
| | | | | | | | | | | | | | | | | | the changes in r233255/r233258. Normally if lldb attaches to a running process, when we call Process::Destroy, we want to detach from the process. If lldb launched the process itself, ::Destroy should kill it. However, if we attach to a process and the driver calls SBProcess::Kill() (which calls Destroy), we need to kill it even if we didn't launch it originally. The force_kill param allows for the SBProcess::Kill method to force the behavior of Destroy. <rdar://problem/20424439> llvm-svn: 235158
* The last argument to CreateExceptionBreakpoint is "internal" not Hardware.Jim Ingham2015-04-161-1/+1
| | | | llvm-svn: 235122
* Adds lldb support for querying the register mapping from gdbserver remote ↵Colin Riley2015-04-161-1/+1
| | | | | | | | targets using qXfer:features:read packet. Only enabled if libxml2 enabled in build. Differential Revision: http://reviews.llvm.org/D8999 llvm-svn: 235109
* If memory read does not find a NULL terminator, still print whatever it ↵Enrico Granata2015-04-061-2/+10
| | | | | | | | | | gathered instead of just NOP'ing out However, remark that this is an incomplete chunk of data by still emitting the "no NULL found" warning rdar://20330073 llvm-svn: 234194
* Fix -Wsign-compare warningDavid Blaikie2015-03-271-1/+1
| | | | llvm-svn: 233408
* Add an assertion for frame[0] being valid in CommandObjectThread.cpp.Stephane Sezer2015-03-261-1/+2
| | | | | | | | | | | | | | | | | | Summary: This should always be true but sometimes is not, during platform bring up. As recommended by Jim Ingham, an assertion should be enough here to help. This addresses post commit comments in http://reviews.llvm.org/D8554. Test Plan: Run unit tests. Reviewers: jasonmolenda, emaste, jingham, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8574 llvm-svn: 233298
* Add a --all command option to "target delete".Zachary Turner2015-03-261-55/+64
| | | | llvm-svn: 233283
* Add a missing null pointer check in CommandObjectThread.cpp.Stephane Sezer2015-03-231-1/+1
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8554 llvm-svn: 232979
* Support for truncate/append on log filesPavel Labath2015-03-201-0/+2
| | | | | | | | | | | | | | | Summary: Presently, if a log file already exists, lldb simply starts overwriting bits of it, without truncating or anything. This patch makes it use eFileOptionFileTruncate by default. It also adds an --append option, which will append to the file without truncating. A test is included. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8450 llvm-svn: 232801
* Move lldb-log.cpp to core/Logging.cppZachary Turner2015-03-181-2/+0
| | | | | | | | | So that we don't have to update every single #include in the entire codebase to #include this new header (which used to get included by lldb-private-log.h, we automatically #include "Logging.h" from within "Log.h". llvm-svn: 232653
* Clean up CommandObjectBreakpointNameList: remove duplicated 'protected' ↵Ilia K2015-03-181-1/+0
| | | | | | access modifier llvm-svn: 232618
* Remove ScriptInterpreterObject.Zachary Turner2015-03-171-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This removes ScriptInterpreterObject from the codebase completely. Places that used to rely on ScriptInterpreterObject now use StructuredData::Object and its derived classes. To support this, a new type of StructuredData object is introduced, called StructuredData::Generic, which stores a void*. Internally within the python library, StructuredPythonObject subclasses this StructuredData::Generic class so that it can addref and decref the python object on construction and destruction. Additionally, all of the classes in PythonDataObjects.h such as PythonList, PythonDictionary, etc now provide a method to create an instance of the corresponding StructuredData type. For example, there is PythonDictionary::CreateStructuredDictionary. To eliminate dependencies on PythonDataObjects for external callers, all ScriptInterpreter methods now return only StructuredData classes The rest of the changes in this CL are focused on fixing up users of PythonDataObjects classes to use the new StructuredData classes. llvm-svn: 232534
* Report an error for line number values that don't convert to integers during ↵Jim Ingham2015-03-161-4/+12
| | | | | | | | | | argument parsing so that we can give a more accurate error message. <rdar://problem/20145563> llvm-svn: 232433
* If creating a Python command via a class, the help text is handled directly ↵Enrico Granata2015-03-131-1/+1
| | | | | | by the class object, no need for setting it manually via the cmdline llvm-svn: 232228
* Add support for Python object commands to return custom short and long help ↵Enrico Granata2015-03-131-1/+33
| | | | | | | | | | | | | by implementing def get_short_help(self) def get_long_help(self) methods on the command object Also, add a test case for this feature llvm-svn: 232224
* Bulk of the infrastructure work to allow script commands to be backed by ↵Enrico Granata2015-03-131-13/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | object instances in addition to free functions This works by creating a command backed by a class whose interface should - at least - include def __init__(self, debugger, session_dict) def __call__(self, args, return_obj, exe_ctx) What works: - adding a command via command script add --class - calling a thusly created command What is missing: - support for custom help - test cases The missing parts will follow over the next couple of days This is an improvement over the existing system as: a) it provides an obvious location for commands to provide help strings (i.e. methods) b) it allows commands to store state in an obvious fashion c) it allows us to easily add features to script commands over time (option parsing and subcommands registration, I am looking at you :-) llvm-svn: 232136
* Add SymbolVendor::GetMainFileSpec and simplify ↵Ilia K2015-03-101-16/+12
| | | | | | | | | | | | | | | | | | | CommandObjectTargetModulesList::PrintModule Summary: Add SymbolVendor::GetMainFileSpec and simplify CommandObjectTargetModulesList::PrintModule. All tests pass on OS X. Reviewers: abidh, clayborg Reviewed By: clayborg Subscribers: lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8002 llvm-svn: 231849
* Further reduce header footprint of Debugger.h.Zachary Turner2015-03-043-0/+3
| | | | llvm-svn: 231202
* Don't #include FormatManager.h from Debugger.hZachary Turner2015-03-036-0/+6
| | | | | | | | Debugger.h is a huge file that gets included everywhere, and FormatManager.h brings in a ton of unnecessary stuff and doesn't even use anything from it in the header. llvm-svn: 231161
* Further reduce the header footprint of Process.hZachary Turner2015-03-031-0/+1
| | | | | | | No functional change here, only deletes unnecessary headers and moves one function's body from the .h file to the .cpp. llvm-svn: 231145
* Don't #include ClangPersistentVariables.h from Process.hZachary Turner2015-03-031-0/+1
| | | | | | | Nothing from this header file was even being referenced in Process.h anyway, so it was a completely unnecessary include. llvm-svn: 231131
* Reduce header footprint of Target.hZachary Turner2015-03-034-0/+4
| | | | | | | | | | | | This continues the effort to reduce header footprint and improve build speed by removing clang and other unnecessary headers from Target.h. In one case, some headers were included solely for the purpose of declaring a nested class in Target, which was not needed by anybody outside the class. In this case the definition and implementation of the nested class were isolated in the .cpp file so the header could be removed. llvm-svn: 231107
* Fix handling of backslashes in Args parsingPavel Labath2015-03-023-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Presently Args::SetCommandString allows quotes to be escaped with backslash. However, the backslash itself is not removed from the argument, nor there is a way to escape the backslash itself. This leads to surprising results: "a b" c" -> 'a b', 'c' # Here we actually have an unterminated quote, but that is ignored "a b\" c" -> 'a b\" c' # We try to escape the quote. That works but the backslash is not removed. "a b\\" c" -> 'a b\\" c' # Escaping the backslash has no effect. This change changes quote handling to be more shell-like: - single quotes and backquotes are literal and there is no way to escape the closing quote or anything else inside; - inside double quotes you can use backslash to escape the closing quote and another backslash - outside any quotes, you can use backslash to escape quotes, spaces and itself. This makes the parsing more consistent with what the user is familiar and increases the probability that pasting the command line from shell to the "process launch" command "just work". Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7855 llvm-svn: 230955
* If you try to auto-complete "target symbols<TAB>" you get "target ↵Greg Clayton2015-02-251-15/+19
| | | | | | | | | | symbolsadd" instead of "target symbols ". Fix this by returning the fact that the "symbols" word is complete if there is nothing else to complete after the "symbols" word. <rdar://problem/19164599> llvm-svn: 230408
* Refactor OptionValue::SetValueFromCString to use llvm::StringRefPavel Labath2015-02-203-15/+15
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7676 llvm-svn: 230005
* Handle trailing spaces on "settings set" command more correctlyPavel Labath2015-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently we have some settings which treat "\ " on settings set commands specially. E.g., it is a valid way of specifying an argument of " " to a target. However, this fails if "\ " is the last argument as CommandObjectSettingsSet strips trailing whitespace. This resulted in a surprising argument of "\" to the target. This patch disables the training whitespace removal at a global level. Instead, for each argument type we locally determine whether whitespace stripping makes sense. Currently, I strip whitespace for all simple object type except of regex and format-string, with the rationale that these two object types do their own complex parsing and we want to interfere with them as least as possible. Specifically, stripping the whitespace of a regex "\ " will result in a (surprising?) error "trailing backslash". Furthermore, the default value of dissasembly-format setting already contains a trailing space and there is no way for the user to type this in manually if we strip whitespace. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7592 llvm-svn: 229382
* Change the default disassembly format again. First attempt atJason Molenda2015-02-131-1/+3
| | | | | | | | | | | | | | | | changing it was in r219544 - after living on that for a few months, I wanted to take another crack at this. The disassembly-format setting still exists and the old format can be user specified with a setting like ${current-pc-arrow}${addr-file-or-load}{ <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>}: This patch was discussed in http://reviews.llvm.org/D7578 <rdar://problem/19726421> llvm-svn: 229186
* Fix Arg0 argument after r229110. The problem was that ↵Ilia K2015-02-131-1/+1
| | | | | | Arg0ValueChangedCallback isn't twitching when Arg0 was updated, therefore target was launched with empty 1st argument or without it at all. In this patch I update Arg0 by hand. llvm-svn: 229125
* Add -exec-arguments commandIlia K2015-02-131-3/+1
| | | | | | | | | | | | | | | | | Summary: This patch adds -exec-arguments command for lldb-mi. -exec-arguments command allows to specify arguments for executable file in MI mode. Also it contains tests for that command. Btw, new added files was formatted by clang-format. Reviewers: abidh, zturner, clayborg Reviewed By: clayborg Subscribers: zturner, emaste, clayborg, jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D6965 llvm-svn: 229110
* Add an -A option to "break set -p" to search all files for matches. Also ↵Jim Ingham2015-02-121-2/+12
| | | | | | | | | | | add the version of SBTarget::BreakpointCreateBySourceRegex that takes file spec lists to the Python interface, and add a test for this. <rdar://problem/19805037> llvm-svn: 228938
* Introduce the notion of "runtime support values"Enrico Granata2015-02-112-4/+16
| | | | | | | | | | | | A runtime support value is a ValueObject whose only purpose is to support some language runtime's operation, but it does not directly provide any user-visible benefit As such, unless the user is working on the runtime support, it is mostly safe for them not to see such a value when debugging It is a language runtime's job to check whether a ValueObject is a support value, and that - in conjunction with a target setting - is used by frame variable and target variable SBFrame::GetVariables gets a new overload with yet another flag to dictate whether to return those support values to the caller - that which defaults to the setting's value rdar://problem/15539930 llvm-svn: 228791
* Extract attach core logic from SBTarget::Attach* methods into unified ↵Oleksiy Vyalov2015-02-101-59/+8
| | | | | | | | SBTarget::AttachToProcess and make it work with platform for remote attach purposes. http://reviews.llvm.org/D7471 llvm-svn: 228757
* Add additional DWARF 5 language constants.Bruce Mitchener2015-02-061-0/+1
| | | | | | | | | This also hooks up the new C++14 language constant to be treated the same as the other C++ language constants. Differential Revision: http://reviews.llvm.org/D7429 llvm-svn: 228386
* Add a "-a/--address" option to "thread until". You can specify one or more ↵Jim Ingham2015-02-061-27/+61
| | | | | | | | | | | line numbers (as arguments) and/or one or more addresses (with -a) and until will stop at the first one of thesepoints it hits, or on exit from the function if you leave the function before hitting any of these stop points. <rdar://problem/12438270> llvm-svn: 228370
* Get test/types tests passing on remote targetsVince Harron2015-02-041-3/+0
| | | | | | | | redirecting output to a path that will work well on host or target. copying file from output location to location on local host that test will read from llvm-svn: 228217
OpenPOWER on IntegriCloud