summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
Commit message (Collapse)AuthorAgeFilesLines
...
* Small fix for the "memory write -i filename" command -- if the user fails to ↵Jason Molenda2015-02-031-1/+1
| | | | | | | | | | | | specify the number of bytes to write into the inferior process, the "default byte size" will be 1. In that case, we want to copy the entire file into memory. The code was looking for a default byte size of 0 to indicate that the user had not provided a specific # of bytes to copy; adjust that to 1 to match the actual default value. <rdar://problem/18074973> llvm-svn: 228067
* Cast to (const OptionPermissions*) to avoid warning.Bruce Mitchener2015-02-031-2/+2
| | | | | | | | | | | | Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7336 llvm-svn: 227951
* Make "process attach" command to support attaching to remote process in case ↵Oleksiy Vyalov2015-02-031-90/+100
| | | | | | | | if selected platform allows this. http://reviews.llvm.org/D7358 llvm-svn: 227899
* Fixed the failing test:Greg Clayton2015-01-281-48/+61
| | | | | | | | | | ./dotest.py -A x86_64 -C clang -v -t -f TestImageListMultiArchitecture.test_image_list_shows_multiple_architectures The problem was that if the platform wasn't compatible with the current file in the "target create" command, it wasn't finding a platform that was like it used to. Also, the currently selected platform was being used upload the file _before_ the target was created which was incorrect as "target create a.out" might switch platforms if its architecture doesn't match, so I moved the uploading to happen after the target was created so we use the right platform (the one in the target, not the selected one). llvm-svn: 227380
* Preparatory infrastructural work to support dynamically determining sizes of ↵Enrico Granata2015-01-281-3/+3
| | | | | | | | | | | | ObjC types via the runtime This is necessary because the byte size of an ObjC class type is not reliably statically knowable (e.g. because superclasses sit deep in frameworks that we have no debug info for) The lack of reliable size info is a problem when trying to freeze-dry an ObjC instance (not the pointer, the pointee) This commit lays the foundation for having language runtimes help in figuring out byte sizes, and having ClangASTType ask for runtime help No feature change as no runtime actually implements the logic, and nowhere is an ExecutionContext passed in yet llvm-svn: 227274
* This patch gets remote-linux platform able to run processesVince Harron2015-01-212-6/+5
| | | | | | | | | | | | | | | | Make sure the selected platform is always used Make sure that the host uses the connect://hostname to connect to both the lldb-platform and the lldb-gdbserver rather than what the platform reports as the hostname of the lldb-gdbserver Make sure that lldb-platform uses the IP address on it's connection back to the host instead of the hostname that the host sends to it when launching lldb-gdbserver with the remote host information Tested on OSX and Linux llvm-svn: 226712
* Don't mention a "--core-file" argument to target create. It isJason Molenda2015-01-201-1/+1
| | | | | | | | "--core". <rdar://problem/19518164> llvm-svn: 226543
* Moved Args::StringToXIntYZ to StringConvert::ToXIntYZVince Harron2015-01-1512-74/+83
| | | | | | | | | | The refactor was motivated by some comments that Greg made http://reviews.llvm.org/D6918 and also to break a dependency cascade that caused functions linking in string->int conversion functions to pull in most of lldb llvm-svn: 226199
* Modified LLDB to be able to lookup global variables by address.Greg Clayton2015-01-151-1/+1
| | | | | | | | | | | | This is done by adding a "Variable *" to SymbolContext and allowing SymbolFile::ResolveSymbolContext() so if an address is resolved into a symbol context, we can include the global or static variable for that address. This means you can now find global variables that are merged globals when doing a "image lookup --verbose --address 0x1230000". Previously we would resolve a symbol and show "_MergedGlobals123 + 1234". But now we can show the global variable name. The eSymbolContextEverything purposely does not include the new eSymbolContextVariable in its lookup since stack frame code does many lookups and we don't want it triggering the global variable lookups. <rdar://problem/18945678> llvm-svn: 226084
* Fix build after r226068: cannot initialize 'int' with 'nullptr_t'Ed Maste2015-01-151-1/+1
| | | | llvm-svn: 226076
* Three related changes to help:Kate Stone2015-01-152-10/+21
| | | | | | | | | | | | | | | | The default help display now shows the alias collection by default, and hides commands whose named begin with an underscore. Help is primarily useful to those unfamiliar with LLDB and should aim to answer typical questions while still being able to provide more esoteric answers when required. To that latter end an argument to include the hidden commands in help has been added, and instead of having a help flag to show aliases there is now one to hide them. This final change might be controversial as it repurposes the -a shorthand as the opposite of its original meaning. The previous implementation of OutputFormattedHelpText was easily confused by embedded newlines. The new algorithm correctly breaks on the FIRST newline or LAST space/tab before the target column count rather than treating all whitespace interchangeably. Command interpreters now have the ability to specify help prologue text and a command prefix string. Neither are used in the current LLDB sources but are required to support REPL-like extensions where LLDB commands must be prefixed and additional help text is required to explain how to access traditional debugging commands. <rdar://problem/17751929> <rdar://problem/16953815> <rdar://problem/16953841> <rdar://problem/16930173> <rdar://problem/16879028> llvm-svn: 226068
* Typing "gui" will crash programs that don't give LLDB a real terminal. Greg Clayton2015-01-141-4/+16
| | | | | | | | | | We now verify that the debugger's input file is a valid terminal file descriptor before allowing the "gui" command to try to run. Xcode would crash if you typed "gui" at the command line prior to this fix. <rdar://problem/18775851> llvm-svn: 226027
* Change the x86 assembly instruction unwind parser toJason Molenda2015-01-131-22/+62
| | | | | | | | | | | | | | | step through the complete function looking for any epilogue instructions. If we find an epilogue sequence, re-instate the correct unwind instructions if there is more code past that epilogue -- this will correctly handle an x86 function with multiple epilogues in it. NB there is still a bug with the "eh_frame augmented" UnwindPlans and mid-function epilogues. Looking at that next. <rdar://problem/18863406> llvm-svn: 225770
* Change int32_t to uint32_t to fix warnings.Zachary Turner2015-01-091-1/+1
| | | | | | | | | | Variable was being declared as signed, but treated as unsigned at every point of use. Patch by Dan Sinclair Differential Revision: http://reviews.llvm.org/D6897 llvm-svn: 225540
* Fixed an issue where you couldn't delete a user defined regex, python, or ↵Greg Clayton2015-01-091-9/+91
| | | | | | | | | | | multi-word command by adding a new "command delete" command. This new command will delete user defined regular commands, but not aliases. We still have "command unalias" to remove aliases as they are currently in different buckets. Appropriate error messages are displayed to inform the user when "command unalias" is used on removable user defined commands that points users to the "command delete" command. Added a test to verify we can remove user defined commands and also verify that "command unalias" fails when used on a user defined command. <rdar://problem/18248300> llvm-svn: 225535
* Don't emit the "WARNING: no locations" message when breakpoints are set inJim Ingham2014-12-191-4/+11
| | | | | | the dummy target. Say they were set in the dummy target instead. llvm-svn: 224606
* Fix a format string warning by noting that StringIsBreakpointNameEric Christopher2014-12-171-2/+0
| | | | | | | will set the error accordingly and so there's no need to set it again. llvm-svn: 224468
* Add the ability to tag one or more breakpoints with a name. TheseJim Ingham2014-12-163-12/+447
| | | | | | | | | names can then be used in place of breakpoint id's or breakpoint id ranges in all the commands that operate on breakpoints. <rdar://problem/10103959> llvm-svn: 224392
* Make the platform process connect path less chatty.Stephane Sezer2014-12-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If a stream contains an empty string, no need to append it to the output (otherwise we end up with a blank line). Also, no need to print a status message when the state changes to connected, as this string brings no information -- "Process 0" does not mean anything to the user, and the process being connected has no meaning either. Test Plan: Connect to a remote linux platform mode daemon with `platform select remote-linux` followed by `platform connect ...`, create a target and run it, observe the output. Also, run the full test suite (dosep.py). Before: (lldb) [...] connect, etc. (lldb) r Process 0 connected Process 5635 launched: '/Users/sas/Source/test' (x86_64) Process 5635 stopped After: (lldb) [...] connect, etc. (lldb) r Process 5635 launched: '/Users/sas/Source/test' (x86_64) Process 5635 stopped Reviewers: tfiala, vharron, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D6593 llvm-svn: 224188
* The lldb unwinder can now use the unwind information from the compact-unwind Jason Molenda2014-12-081-1/+1
| | | | | | | | | | | | | | | | | | section for x86_64 and i386 targets on Darwin systems. Currently only the compact unwind encoding for normal frame-using functions is supported but it will be easy handle frameless functions when I have a bit more free time to test it. The LSDA and personality routines for functions are also retrieved correctly for functions from the compact unwind section. This new code is very fresh -- it passes the lldb testsuite and I've done by-hand inspection of many functions and am getting correct behavior for all of them. There may need to be some bug fixing over the next couple weeks as I exercise and test it further. But I think it's fine right now so I'm committing it. <rdar://problem/13220837> llvm-svn: 223625
* Add the ability to set breakpoints with conditions, commands, etc,Jim Ingham2014-12-064-19/+210
| | | | | | | | | | | | | | in the "dummy-target". The dummy target breakpoints prime all future targets. Breakpoints set before any target is created (e.g. breakpoints in ~/.lldbinit) automatically get set in the dummy target. You can also list, add & delete breakpoints from the dummy target using the "-D" flag, which is supported by most of the breakpoint commands. This removes a long-standing wart in lldb... <rdar://problem/10881487> llvm-svn: 223565
* Add commandsEnrico Granata2014-12-051-0/+99
| | | | | | | | | | | | type format info type summary info type synthetic info These commands all take an expression, evaluate it, and show which of the respective formatter (if any) applies to the result of the expression Fixes rdar://12059317 llvm-svn: 223511
* 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
OpenPOWER on IntegriCloud