summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
Commit message (Collapse)AuthorAgeFilesLines
...
* This is the first step of making lldb able to create target-specific thingsJim Ingham2014-11-223-13/+13
| | | | | | | | | | | | | (e.g. breakpoints, stop-hooks) before we have any targets - for instance in your ~/.lldbinit file. These will then get copied over to any new targets that get created. So far, you can only make stop-hooks. Breakpoints will have to learn to move themselves from target to target for us to get them from no-target to new-target. We should also make a command & SB API way to prime this ur-target. llvm-svn: 222600
* Change CommandObjectTargetModulesLoad so that the filename argumentJason Molenda2014-11-211-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is treated as a string instead of a FileSpec. OptionValueFileSpec::SetValueFromCString() passes the c string to FileSpec::SetFile(str, true /* resolve */) - and with Zachary's changes to FileSpec we're using llvm::sys::fs::make_absolute() to do that "resolve" action now, where we used to use realpath(). One important difference between llvm::sys::fs::make_absolute and realpath is that when they're handed a filename (no directory), realpath prepends the current working directory *and if the file exists*, returns that full path. If that file doesn't exist, the caller uses the basename only. llvm::sys::fs::make_absolute prepends the current working directory regardless of whether it exists or not. I considered having FileSpec::SetFile save the initial pathname, call FileSpec::Resolve, and then check to see if the Resolve return path exists - and if not, go back to the original one. But instead I just went with changing 'target modules load' to treat its filename argument as a string instead of a FileSpec. This brings it in line with how 'target modules list' works. <rdar://problem/18955416> llvm-svn: 222498
* More override warning cleanup.Eric Christopher2014-11-181-3/+3
| | | | llvm-svn: 222271
* Patch from dawn@burble.org to make the --silent-run do what it says, not the ↵Jim Ingham2014-11-181-3/+3
| | | | | | opposite of what it says. llvm-svn: 222243
* Have CommandObjectCommandsAddRegex inherit from IOHandlerDelegateMultiline ↵Greg Clayton2014-11-181-58/+16
| | | | | | | | | | | | so it will not immediately terminate after the first regular expression in "command regex <name>" commands. Fixed the prompt to not include non-printable characters as it was hosing up the prompt when you ran "command regex foo" and entered multi-line editing mode. Fixed error strings to include more complete descriptions when bad regular expressions are entered. Removed the old IOHandlerLinesUpdated function as it is no longer needed (inheriting from IOHandlerDelegateMultiline takes care of what this function used to do). llvm-svn: 222207
* Fixed more fallout from running the test suite remotely on iOS devices.Greg Clayton2014-11-172-3/+2
| | | | | | | | | | | | | | | | Fixed include: - Change Platform::ResolveExecutable(...) to take a ModuleSpec instead of a FileSpec + ArchSpec to help resolve executables correctly when we have just a path + UUID (no arch). - Add the ability to set the listener in SBLaunchInfo and SBAttachInfo in case you don't want to use the debugger as the default listener. - Modified all places that use the SBLaunchInfo/SBAttachInfo and the internal ProcessLaunchInfo/ProcessAttachInfo to not take a listener as a parameter since it is in the launch/attach info now - Load a module's sections by default when removing a module from a target. Since we create JIT modules for expressions and helper functions, we could end up with stale data in the section load list if a module was removed from the target as the section load list would still have entries for the unloaded module. Target now has the following functions to help unload all sections a single or multiple modules: size_t Target::UnloadModuleSections (const ModuleList &module_list); size_t Target::UnloadModuleSections (const lldb::ModuleSP &module_sp); llvm-svn: 222167
* Complete rewrite of interactive editing support for single- and multi-line ↵Kate Stone2014-11-172-0/+8
| | | | | | | | | | | | | | | | | | | input. Improvements include: * Use of libedit's wide character support, which is imperfect but a distinct improvement over ASCII-only * Fallback for ASCII editing path * Support for a "faint" prompt clearly distinguished from input * Breaking lines and insert new lines in the middle of a batch by simply pressing return * Joining lines with forward and backward character deletion * Detection of paste to suppress automatic formatting and statement completion tests * Correctly reformatting when lines grow or shrink to occupy different numbers of rows * Saving multi-line history, and correctly preserving the "tip" of history during editing * Displaying visible ^C and ^D indications when interrupting input or sending EOF * Fledgling VI support for multi-line editing * General correctness and reliability improvements llvm-svn: 222163
* Reverting r220435. Jim Ingham and I discussed this for a bit, and we came up ↵Enrico Granata2014-10-221-117/+0
| | | | | | with a better command model for this feature llvm-svn: 220437
* Add a 'type info' command, which can be fed one or more local variables - ↵Enrico Granata2014-10-221-0/+117
| | | | | | and it will spew out the list of formatters that apply to each of those variables, if any llvm-svn: 220435
* Make the "synchronous" mode actually work without race conditions.Greg Clayton2014-10-212-23/+55
| | | | | | There were many issues with synchronous mode that we discovered when started to try and add a "batch" mode. There was a race condition where the event handling thread might consume events when in sync mode and other times the Process::WaitForProcessToStop() would consume them. This also led to places where the Process IO handler might or might not get popped when it needed to be. llvm-svn: 220254
* Break out of the command word parsing loop if we hitJason Molenda2014-10-171-0/+6
| | | | | | | | an invalid combination of words; don't accidentally continue trying to parse the command line. clang static analysis fixit. llvm-svn: 220026
* Rework the way we pass "run multiple command" options to the various API's thatJim Ingham2014-10-113-29/+25
| | | | | | | | | | | | | | | do that (RunCommandInterpreter, HandleCommands, HandleCommandsFromFile) to gather the options into an options class. Also expose that to the SB API's. Change the way the "-o" options to the lldb driver are processed so: 1) They are run synchronously - didn't really make any sense to run the asynchronously. 2) The stop on error 3) "quit" in one of the -o commands will not quit lldb - not the command interpreter that was running the -o commands. I added an entry to the run options to stop-on-crash, but I haven't implemented that yet. llvm-svn: 219553
* LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and ↵Kuba Brecka2014-10-101-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | report data extraction Reviewed at http://reviews.llvm.org/D5592 This patch gives LLDB some ability to interact with AddressSanitizer runtime library, on top of what we already have (historical memory stack traces provided by ASan). Namely, that's the ability to stop on an error caught by ASan, and access the report information that are associated with it. The report information is also exposed into SB API. More precisely this patch... adds a new plugin type, InstrumentationRuntime, which should serve as a generic superclass for other instrumentation runtime libraries, these plugins get notified when modules are loaded, so they get a chance to "activate" when a specific dynamic library is loaded an instance of this plugin type, AddressSanitizerRuntime, which activates itself when it sees the ASan dynamic library or founds ASan statically linked in the executable adds a collection of these plugins into the Process class AddressSanitizerRuntime sets an internal breakpoint on __asan::AsanDie(), and when this breakpoint gets hit, it retrieves the report information from ASan this breakpoint is then exposed as a new StopReason, eStopReasonInstrumentation, with a new StopInfo subclass, InstrumentationRuntimeStopInfo the StopInfo superclass is extended with a m_extended_info field (it's a StructuredData::ObjectSP), that can hold arbitrary JSON-like data, which is the way the new plugin provides the report data the "thread info" command now accepts a "-s" flag that prints out the JSON data of a stop reason (same way the "-j" flag works now) SBThread has a new API, GetStopReasonExtendedInfoAsJSON, which dumps the JSON string into a SBStream adds a test case for all of this I plan to also get rid of the original ASan plugin (memory history stack traces) and use an instance of AddressSanitizerRuntime for that purpose. Kuba llvm-svn: 219546
* Add a new disassembly-format specification so that the disassemblerJason Molenda2014-10-101-1/+3
| | | | | | | | | | | | | | | | | | | | | output style can be customized. Change the built-in default to be more similar to gdb's disassembly formatting. The disassembly-format for a gdb-like output is ${addr-file-or-load} <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>: The disassembly-format for the lldb style output is {${function.initial-function}{${module.file.basename}`}{${function.name-without-args}}:\n}{${function.changed}\n{${module.file.basename}`}{${function.name-without-args}}:\n}{${current-pc-arrow} }{${addr-file-or-load}}: The two backticks in the lldb style formatter triggers the sub-expression evaluation in CommandInterpreter::PreprocessCommand() so you can't use that one as-is ... changing to use ' characters instead of ` would work around that. <rdar://problem/9885398> llvm-svn: 219544
* Issuing a "type category disable *" command followed by a "type category ↵Enrico Granata2014-10-031-24/+2
| | | | | | | | | | enable *" command does not honor the order in which categories were previously enabled While we didn't really promise it would, it seems like it should This checkin enables just that, and fixes rdar://18527468 llvm-svn: 218949
* Allow Python commands to optionally take an SBExecutionContext argument in ↵Enrico Granata2014-10-011-1/+2
| | | | | | case they need to handle 'where they want to act' separately from the notion of 'currently-selected entity' that is associated to the debugger. Do this in an (hopefully) non-breaking way by running an argcount check before passing in the new argument. Update the test case to also check for this new feature. www update to follow llvm-svn: 218834
* This checkin is the first step in making the lldb thread stepping mechanism ↵Jim Ingham2014-09-291-199/+398
| | | | | | | | | | | | more accessible from the user level. It adds the ability to invent new stepping modes implemented by python classes, and to view the current thread plan stack and to some extent alter it. I haven't gotten to documentation or tests yet. But this should not cause any behavior changes if you don't use it, so its safe to check it in now and work on it incrementally. llvm-svn: 218642
* Very minimal support 24-bit kalimbas. Vanilla "memory read" for data sectionsMatthew Gardiner2014-09-291-4/+14
| | | | | | | | | | | works, as do breakpoints, run and pause, display zeroth frame. See http://reviews.llvm.org/D5503 for a fuller description of the changes in this commit. llvm-svn: 218596
* Test suite runs better again after recent fixes that would select a platform ↵Greg Clayton2014-09-191-1/+1
| | | | | | | | | | | | | if a "file a.out" auto selected a different platform than the selected one. Changes include: - fix it so you can select the "host" platform using "platform select host" - change all callbacks that create platforms to returns shared pointers - fix TestImageListMultiArchitecture.py to restore the "host" platform by running "platform select host" - Add a new "PlatformSP Platform::Find(const ConstString &name)" method to get a cached platform - cache platforms that are created and re-use them instead of always creating a new one llvm-svn: 218145
* Add a --help (-h) option to "command script add" that enables users to ↵Enrico Granata2014-09-151-4/+25
| | | | | | | | | | | | | define a one-liner short help for their command Also, in case they don't define any, change the default from "Run Python function <blah>" into "For more information run help <blah>" The core issue here is that Python only allows one docstring per function, so we can't really attach both a short and a long help to the same command easily There are alternatives but this is not a pressing enough concern to go through the motions quite yet Fixes rdar://18322737 llvm-svn: 217795
* Correct copied error messageEd Maste2014-09-061-1/+1
| | | | | | Patch by Remco Verhoef. llvm-svn: 217312
* ASan malloc/free history threadsKuba Brecka2014-09-041-0/+93
| | | | | | Reviewed at http://reviews.llvm.org/D4596 llvm-svn: 217116
* lldb - fix misleading "valid target indexes are" error messageTodd Fiala2014-08-291-3/+10
| | | | | | | | See http://reviews.llvm.org/D4430 for more details. Change by Paul Osmialowski. llvm-svn: 216766
* Allow "breakpoint command add" to add commands to more than one breakpoint ↵Jim Ingham2014-08-291-58/+70
| | | | | | | | at a time. <rdar://problem/13314462> llvm-svn: 216747
* Make it clear in the help that "breakpoint command add" will act on the last setJim Ingham2014-08-281-2/+3
| | | | | | | | breakpoint if no breakpoint id is specified. <rdar://problem/17885160> llvm-svn: 216637
* On x86 & x86_64, try to use eh_frame for frame 0.Todd Fiala2014-08-251-1/+1
| | | | | | | | | | | | | We decided to use assmbly profiler instead of eh_frame for frame 0 because for compiler generated code, eh_frame is usually synchronous(a.k.a. only valid at call site); and we have no way to tell if it's asynchronous or not. But for x86 & x86_64 compiler generated code: 1. clang & GCC describes all prologue instructions in eh_frame; 2. mid-function stack pointer altering instructions can be easily detected. So we can grab eh_frame, and use assembly profiler to augment it into asynchronous unwind table. This change also benefits hand-written assembly; eh_frame for hand-written assembly is often asynchronous,so we have a much better chance to successfully unwind through them. Change by Tong Shen. llvm-svn: 216406
* Fixed a typo.Sean Callanan2014-08-211-1/+1
| | | | | | <rdar://problem/18084105> llvm-svn: 216189
* Adjust process launch --disable-aslr to take true/false value.Todd Fiala2014-08-191-1/+18
| | | | | | This change modifies the 'process launch' --disable-aslr option to take a boolean argument. If the user directly specifies --disable-aslr {true,false}, that setting will control whether the process is launched with ASLR disabled accordingly. In the event that the setting is not explicitly made on the process launch command line, then the value is retrieved from the target.disable-aslr setting (i.e. settings show target.disable-aslr). llvm-svn: 215996
* Fix the missleading indentation. Fix CID 1096300Sylvestre Ledru2014-08-181-3/+3
| | | | llvm-svn: 215892
* Don't crash when specifying a core file that isn't readable.Greg Clayton2014-08-151-1/+27
| | | | | | | | | | | | | Fixes include: 1 - added new FileSpec method: bool FileSpec::Readable() 2 - detect when an executable is not readable and give an appropriate error for: (lldb) file /tmp/unreadablefile 3 - detect when a core file is not readable and give an appropriate error 4 - detect when a specified core file doesn't exist and give an appropriate error <rdar://problem/17727734> llvm-svn: 215741
* Fix iohandler prompt race condition.Todd Fiala2014-08-122-2/+12
| | | | | | | | | | | | | | | | | This issue caused the lldb prompt to not show up in certain cases, very noticeable on Linux systems. See details on this review: http://reviews.llvm.org/D4863 And on this lldb-commits thread: http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140811/012306.html Change by Shawn Best. (Much useful help and testing by the rest of the community, thanks all!) llvm-svn: 215446
* Fix some typos:Sylvestre Ledru2014-08-111-1/+1
| | | | | | | | * transfered => transferred * unkown => unknown * sucessfully => successfully llvm-svn: 215367
* Optimizations for FileSpec.Zachary Turner2014-08-071-19/+12
| | | | llvm-svn: 215124
* (no commit message)Greg Clayton2014-07-301-1/+8
| | | | llvm-svn: 214319
* Fix some warnings in the Windows build.Zachary Turner2014-07-161-1/+1
| | | | llvm-svn: 213194
* Reapply typo fix.Bruce Mitchener2014-07-101-1/+1
| | | | | | This was lost in the re-merging of command validation changes. llvm-svn: 212721
* Make sure the "command regex add" has a unique name for editline history ↵Greg Clayton2014-07-091-1/+1
| | | | | | purposes. llvm-svn: 212644
* Revert "Fix broken tests due to new error output."Zachary Turner2014-07-0920-341/+346
| | | | | | | This reverts commit ec7c94f8e6860968d384b578e5564a9c55c80b4a and re-enables OptionValidators. llvm-svn: 212627
* Add the ability to provide a "count" option to the various "thread step-*" ↵Jim Ingham2014-07-081-0/+19
| | | | | | | | | operations. Only step-inst and step-inst are currently supported, the rest just warn that they are not supported if you try to provide a count. llvm-svn: 212559
* Document the "thread.completed-expression" feature in the "expression" ↵Jim Ingham2014-07-081-0/+9
| | | | | | command help. llvm-svn: 212558
* Fix typos.Bruce Mitchener2014-07-081-1/+1
| | | | llvm-svn: 212553
* Fix broken tests due to new error output.Todd Fiala2014-07-0820-345/+340
| | | | | | | | | | | This reverses out the options validators changes. We'll get these back in once the changes to the output can be resolved. Restores broken tests on FreeBSD, Linux, MacOSX. Changes reverted: r212500, r212317, r212290. llvm-svn: 212543
* Invalidate process UID/GID-related command options on Windows.Zachary Turner2014-07-071-4/+10
| | | | | | | | | | | | Windows uses a different process security model and does not have a concept of process UID or GID. This patch makes these options invalid on Windows. Attempting to specify these options when the current platform is Windows will generate an error. Reviewed by: Jim Ingham Differential Revision: http://reviews.llvm.org/D4373 llvm-svn: 212500
* Fix OptionDefinition break from r212290.Todd Fiala2014-07-041-15/+15
| | | | | | | | Fixes some structure definitions in CommandObjectType that needed to be adjusted for a new OptionDefinition field. llvm-svn: 212317
* Fix -Wnull-conversion warning.Zachary Turner2014-07-031-1/+1
| | | | llvm-svn: 212304
* Adds the notion of an OptionValidator.Zachary Turner2014-07-0320-325/+324
| | | | | | | | | | | | | | | | | | The purpose of the OptionValidator is to determine, based on some arbitrary set of conditions, whether or not a command option is valid for a given debugger state. An example of this might be to selectively disable or enable certain command options that don't apply to a particular platform. This patch contains no functional change, and does not actually make use of an OptionValidator for any purpose yet. A follow-up patch will begin to add the logic and users of OptionValidator. Reviewed by: Greg Clayton, Jim Ingham Differential Revision: http://reviews.llvm.org/D4369 llvm-svn: 212290
* Add enumerations for additional languages from DWARF spec updates.Bruce Mitchener2014-07-031-0/+3
| | | | llvm-svn: 212246
* Fix typos.Bruce Mitchener2014-07-013-3/+3
| | | | llvm-svn: 212132
* lldb: remove adhoc implementation of array_sizeofSaleem Abdulrasool2014-06-272-2/+4
| | | | | | | | Replace adhoc inline implementation of llvm::array_lengthof in favour of the implementation in LLVM. This is simply a cleanup change, no functional change intended. llvm-svn: 211868
* Added an option to turn OFF the "detach on error" behavior that was addedJim Ingham2014-06-251-0/+3
| | | | | | | | to debugserver when launching processes. <rdar://problem/16216199> llvm-svn: 211658
OpenPOWER on IntegriCloud