summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
Commit message (Collapse)AuthorAgeFilesLines
...
* “process launch” should “detach” not “kill” if the current ↵Jim Ingham2013-03-291-80/+119
| | | | | | | | | | | | | process was one we attached to. “process attach” should ask the same questions as process launch if there is a current process. “process connect” then “process launch” or “process attach” should actually work. <rdar://problem/13524210> <rdar://problem/13524208> <rdar://problem/13488919> llvm-svn: 178324
* Introduces extended register sets whose availability can vary with the ↵Ashok Thirumurthi2013-03-281-3/+11
| | | | | | | | | | target processor. - Includes a stub for AVX support in the x86-64 register context and a failing test for register sets that are unavailable. Thanks to Greg Clayton for his review feedback. llvm-svn: 178252
* Fix a typo in help string.Jim Ingham2013-03-271-1/+1
| | | | llvm-svn: 178154
* Don't use a "uintptr_t" for the metadata key, use a "void *". This removes ↵Greg Clayton2013-03-271-2/+0
| | | | | | all of the casts that were being used and cleans the code up a bit. Also added the ability to dump the metadata. llvm-svn: 178113
* That wasn't a typo, if the short letter option is from a non-obvious source, ↵Jim Ingham2013-03-261-1/+1
| | | | | | I capitolize it in the help as an aid to memory. llvm-svn: 178052
* Our commands that end up displaying a ValueObject as part of their workflow ↵Enrico Granata2013-03-264-62/+5
| | | | | | | | | | | use OptionGroupValueObjectDisplay as their currency for deciding the final representation ValueObjects themselves use DumpValueObjectOptions as the currency for the same purpose The code to convert between these two units was replicated (to varying degrees of correctness) in several spots in the code This checkin provides one and only one (and hopefully correct :-) entry point for this conversion llvm-svn: 178044
* Fixed a typo.Sean Callanan2013-03-261-1/+1
| | | | llvm-svn: 178039
* <rdar://problem/13221060>Enrico Granata2013-03-261-0/+15
| | | | | | | | | | | | | | | | | | | Make register read and write accept $<regname> as valid. This allows: (lldb) reg read rbx rbx = 0x0000000000000000 (lldb) reg read $rbx rbx = 0x0000000000000000 (lldb) reg write $rbx 1 (lldb) reg read $rbx rbx = 0x0000000000000001 to function correctly It is not done at the RegisterContext level because we should keep the internal API clean of this user-friendly behavior and name registers appropriately. If this ends up being needed in more places we can reconsider. llvm-svn: 177961
* <rdar://problem/13365424>Enrico Granata2013-03-251-16/+17
| | | | | | | | | | | | | | | | | Ensure that option -Y also works for expression as it does for frame variable Also, if the user passes an explicit format specifier when printing a variable, override the summary's decision to hide the value. This is required for scenarios like this to work: (lldb) p/x c (Class) $0 = 0x0000000100adb7f8 NSObject Previously this would say: (lldb) p/x c (Class) $0 = NSObject ignoring the explicit format specifier llvm-svn: 177893
* Set the correct byte size for complex integer (-fI) memory reads.Jason Molenda2013-03-231-0/+8
| | | | | | <rdar://problem/12281172> llvm-svn: 177814
* Convert the -a option in "image lookup" to a address-expression, and pass ↵Jim Ingham2013-03-151-6/+8
| | | | | | | | the context in the -a address expression lookup in "image list" so that it actually works. llvm-svn: 177200
* <rdar://problem/13421412>Greg Clayton2013-03-141-1/+1
| | | | | | Many "byte size" members and variables were using a mixture of uint32_t and size_t. Switching over to using uint64_t everywhere. llvm-svn: 177091
* <rdar://problem/13404189>Greg Clayton2013-03-131-11/+27
| | | | | | | | | | | | | | Made the "--reverse" option to "source list" also be able to use the "--count". This helps us implement support for regexp source list command: (lldb) l -10 Which gets turned into: (lldb) source list --reverse --count 10 Also simplified the code that is used to track showing more source from the last file and line. llvm-svn: 176961
* Fix a reversed test for "for_expression" in creating C++ exception breakpoints.Jim Ingham2013-03-091-1/+1
| | | | | | Add a missing "break" in processing the -h option to "breakpoint set". llvm-svn: 176741
* Add a comment to break disable's help to make clearer the relationship ↵Jim Ingham2013-03-081-1/+21
| | | | | | | | between the enable/disable state of a breakpoint, and of its locations. llvm-svn: 176672
* <rdar://problem/13184855>Greg Clayton2013-03-051-45/+19
| | | | | | Spaces in "settings set" value strings no longer cause setting failures. llvm-svn: 176532
* Convert from the C-based LLVM Disassembler shim to the full MC Disassembler ↵Jim Ingham2013-03-022-2/+56
| | | | | | | | | | | | API's. Calculate "can branch" using the MC API's rather than our hand-rolled regex'es. As extra credit, allow setting the disassembly flavor for x86 based architectures to intel or att. <rdar://problem/11319574> <rdar://problem/9329275> llvm-svn: 176392
* breakpoint command add currently doesn't support adding commands to more ↵Jim Ingham2013-02-281-0/+7
| | | | | | | | | | than one breakpoint at a time. Enforce this for now (we should relax the requirement when we have a little more time.) <rdar://problem/13314462> llvm-svn: 176291
* Update CMakeLists.txt as per removed fileDaniel Malea2013-02-281-1/+0
| | | | llvm-svn: 176269
* <rdar://problem/13265297> Greg Clayton2013-02-231-2/+2
| | | | | | StackFrame assumes m_sc is additive, but m_sc can lose its target. So now the SymbolContext::Clear() method takes a bool that indicates if the target should be cleared. Modified all existing code to properly set the bool argument. llvm-svn: 175953
* <rdar://problem/13265017>Enrico Granata2013-02-212-106/+0
| | | | | | | | | | | | | | | The notion of Crossref command has long been forgotten, and there is nothing using CommandObjectCrossref in the current LLDB codebase However, this was causing a conflict with process plugins and command aliases ending up in an infinite loop under situations such as: (lldb) command alias monitor process plugin packet monitor (lldb) process att -n Calendar Process 28709 stopped Executable module set to "/Applications/Calendar.app/Contents/MacOS/Calendar". Architecture set to: x86_64-apple-macosx. (lldb) command alias monitor process plugin packet monitor This fixes the loop (and consequent crash) by disposing of Crossref commands and related code llvm-svn: 175831
* Fix CommandObjectMultiword to initialize all members, and beef up ↵Daniel Malea2013-02-211-1/+2
| | | | | | corresponding test case. llvm-svn: 175798
* Adding CMake build system to LLDB. Some known issues remain:Daniel Malea2013-02-211-0/+32
| | | | | | | | | | | | | | - generate-vers.pl has to be called by cmake to generate the version number - parallel builds not yet supported; dependency on clang must be explicitly specified Tested on Linux. - Building on Mac will require code-signing logic to be implemented. - Building on Windows will require OS-detection logic and some selective directory inclusion Thanks to Carlo Kok (who originally prepared these CMakefiles for Windows) and Ben Langmuir who ported them to Linux! llvm-svn: 175795
* If you sayEnrico Granata2013-02-211-1/+2
| | | | | | | | | | | | | (lldb) frame variable without first launching the inferior, you get: error: invalid frame this is misleading and should probably hint that there is no process. Adding this flag makes sure that we get: error: invalid process The difference between eFlagRequiresProcess and eFlagProcessMustBeLaunched is an open question. llvm-svn: 175702
* One to many always's.Jim Ingham2013-02-141-1/+1
| | | | llvm-svn: 175202
* Make it clear that if you #include .c/.cpp/.m/.mm etc files, you will have toJim Ingham2013-02-141-1/+4
| | | | | | | | change the breakpoint-inline-strategy for the breakpoints to take. <rdar://problem/13189024> llvm-svn: 175197
* <rdar://problem/13207948>Greg Clayton2013-02-141-44/+44
| | | | | | "watchpoint set expression" fails if "--" is present without any option. Made this command match exactly what "expression" does. llvm-svn: 175136
* Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction ↵Jim Ingham2013-02-091-1/+5
| | | | | | | | | | | interoperate to fix problems where hitting auto-continue signals while running a thread plan would cause us to lose control of the debug session. <rdar://problem/12993641> llvm-svn: 174793
* Change CommandObjectTargetSymbolsAdd to require that a target exists;Jason Molenda2013-02-021-1/+1
| | | | | | | | | | | | fixes crash of the form % lldb (lldb) target symbols add /tmp/symbols.dSYM (lldb) Killed: 9 <rdar://problem/13139481> llvm-svn: 174267
* Add "thread return -x" to unwind the innermost user called expression (if ↵Jim Ingham2013-01-312-26/+131
| | | | | | | | | | you happen to have stopped in it due to a crash.) Make the message when you hit an crash while evaluating an expression a little clearer, and mention "thread return -x". rdar://problem/13110464 llvm-svn: 174095
* <rdar://problem/12552374>Enrico Granata2013-01-295-7/+7
| | | | | | | Replacing the address argument type with address-expression in cases where StringToAddress() is used, and hence an expression can be passed where previously only a numeric address was allowed This makes the documentation more clear and helps users discover that they can truly pass in an expression in these situations. llvm-svn: 173753
* <rdar://problem/12890171>Enrico Granata2013-01-291-1/+3
| | | | | | | | Providing a compact display mode for "po" to use where the convenience variable name and the pointer value are both hidden. This is for convenience when dealing with ObjC instances where the description often gets it right and the debugger-provided information is not useful to most people. If you need either of these, "expr" will still show them. llvm-svn: 173748
* <rdar://problem/12524607>Greg Clayton2013-01-291-1/+5
| | | | | | | | | | | Flush the process when symbols are loaded/unloaded manually. This was going on in: - "target modules load" command - SBTarget::SetSectionLoadAddress(...) - SBTarget::ClearSectionLoadAddress(...) - SBTarget::SetModuleLoadAddress(...) - SBTarget::ClearModuleLoadAddress(...) llvm-svn: 173745
* <rdar://problem/12978143>Enrico Granata2013-01-282-14/+14
| | | | | | | | | | | Data formatters now cache themselves. This commit provides a new formatter cache mechanism. Upon resolving a formatter (summary or synthetic), LLDB remembers the resolution for later faster retrieval. Also moved the data formatters subsystem from the core to its own group and folder for easier management, and done some code reorganization. The ObjC runtime v1 now returns a class name if asked for the dynamic type of an object. This is required for formatters caching to work with the v1 runtime. Lastly, this commit disposes of the old hack where ValueObjects had to remember whether they were queried for formatters with their static or dynamic type. Now the ValueObjectDynamicValue class works well enough that we can use its dynamic value setting for the same purpose. llvm-svn: 173728
* Make sure that multi-line expressions don't create a default target. We ↵Greg Clayton2013-01-261-4/+9
| | | | | | recently switched to using a built-in m_exe_ctx when running commands in the DoExecute() so that we can have common code where commands can required having a valid target/process/thread/frame by specifying flags, this caused multi-line expression to always create a new dummy target because m_exe_ctx gets cleared when DoExecute exits. A new input reader has been pushed to handle the input for the expression, which will get popped off and then it was checking the target in m_exe_ctx (which was cleared). llvm-svn: 173596
* Missing newline in a warning message.Jim Ingham2013-01-251-1/+1
| | | | llvm-svn: 173519
* <rdar://problem/13069948>Greg Clayton2013-01-2518-106/+106
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* <rdar://problem/12437929>Enrico Granata2013-01-211-2/+44
| | | | | | | | | | | | | | | | | | Providing a special mode of operator for "memory read -f c-str" which actually works in most common cases Where the old behavior would provide: (lldb) mem read --format s `foo` 0x100000f5d: NULL Now we do: (lldb) mem read --format s `foo` 0x100000f5d: "hello world" You can also specify a count and that many strings will be showed starting at the initial address: (lldb) mem read -c 2 -f c-str `foo` 0x100000f1d: "hello world" 0x100000f29: "short" llvm-svn: 173076
* <rdar://problem/12786725>Enrico Granata2013-01-172-0/+57
| | | | | | | | If there is any alive process being debugged, the user is asked for confirmation before quitting LLDB This should prevent situations where the user mistakenly types "q" and LLDB slaughters their process without any mercy whatsoever Since it can quickly get tedious, there is a new setting on the command interpreter to disable this and replicate the previous behavior llvm-svn: 172757
* Separated the "expr --unwind-on-error" behavior into two parts, actual ↵Jim Ingham2013-01-152-4/+31
| | | | | | | | | | | | | | | | errors (i.e. crashes) which continue to be controlled by the --unwind-on-error flag, and --ignore-breakpoint which separately controls behavior when a called function hits a breakpoint. For breakpoints, we don't unwind, we either stop, or ignore the breakpoint, which makes more sense. Also make both these behaviors globally settable through "settings set". Also handle the case where a breakpoint command calls code that ends up re-hitting the breakpoint. We were recursing and crashing. Now we just stop without calling the second command. <rdar://problem/12986644> <rdar://problem/9119325> llvm-svn: 172503
* <rdar://problem/12790664>Enrico Granata2013-01-141-0/+3
| | | | | | Single-character Unicode data formatters llvm-svn: 172492
* <rdar://problem/12973809> Greg Clayton2013-01-111-2/+24
| | | | | | | | | | | | | Fixed an issue with the auto loading of script resources in debug info files. Any platform can add support for this, and on MacOSX we allow dSYM files to contain python modules that get automatically loaded when a dSYM file is associated with an executable or shared library. The modifications will now: - Let the module locate the symbol file naturally instead of using a function that only works in certain cases. This helps us to locate the script resources as long as the dSYM file can be found. - Don't try and do any of this if the script interpreter has scripting disabled. - Allow more than one scripting resource to be found in a symbol file by returning the list - Load the scripting resources when a symbol file is added via the "target symbols add" command. - Be smarter about matching the dSYM mach-o file to an existing executable in the target images by stripping extensions on the symfile basname if needed. llvm-svn: 172275
* Fixed an issue the "process plugin" proxy object was trying to use the ↵Greg Clayton2013-01-091-1/+1
| | | | | | m_exe_ctx when it wasn't ok to do so. llvm-svn: 172014
* <rdar://problem/12028723>Enrico Granata2013-01-092-58/+19
| | | | | | | | | | Adding useful formatting options to the expression (expr) command. As a side effect of this change, the -d option now supports the same three-values enumeration that frame variables uses (run, don't run, none) instead of a boolean like it did previously These options do not apply to print, p or po because these are aliased to not take any options. In order to use them, use expression or expr. llvm-svn: 171993
* Expanded the flags that can be set for a command object in ↵Greg Clayton2013-01-0914-979/+835
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lldb_private::CommandObject. This list of available flags are: enum { //---------------------------------------------------------------------- // eFlagRequiresTarget // // Ensures a valid target is contained in m_exe_ctx prior to executing // the command. If a target doesn't exist or is invalid, the command // will fail and CommandObject::GetInvalidTargetDescription() will be // returned as the error. CommandObject subclasses can override the // virtual function for GetInvalidTargetDescription() to provide custom // strings when needed. //---------------------------------------------------------------------- eFlagRequiresTarget = (1u << 0), //---------------------------------------------------------------------- // eFlagRequiresProcess // // Ensures a valid process is contained in m_exe_ctx prior to executing // the command. If a process doesn't exist or is invalid, the command // will fail and CommandObject::GetInvalidProcessDescription() will be // returned as the error. CommandObject subclasses can override the // virtual function for GetInvalidProcessDescription() to provide custom // strings when needed. //---------------------------------------------------------------------- eFlagRequiresProcess = (1u << 1), //---------------------------------------------------------------------- // eFlagRequiresThread // // Ensures a valid thread is contained in m_exe_ctx prior to executing // the command. If a thread doesn't exist or is invalid, the command // will fail and CommandObject::GetInvalidThreadDescription() will be // returned as the error. CommandObject subclasses can override the // virtual function for GetInvalidThreadDescription() to provide custom // strings when needed. //---------------------------------------------------------------------- eFlagRequiresThread = (1u << 2), //---------------------------------------------------------------------- // eFlagRequiresFrame // // Ensures a valid frame is contained in m_exe_ctx prior to executing // the command. If a frame doesn't exist or is invalid, the command // will fail and CommandObject::GetInvalidFrameDescription() will be // returned as the error. CommandObject subclasses can override the // virtual function for GetInvalidFrameDescription() to provide custom // strings when needed. //---------------------------------------------------------------------- eFlagRequiresFrame = (1u << 3), //---------------------------------------------------------------------- // eFlagRequiresRegContext // // Ensures a valid register context (from the selected frame if there // is a frame in m_exe_ctx, or from the selected thread from m_exe_ctx) // is availble from m_exe_ctx prior to executing the command. If a // target doesn't exist or is invalid, the command will fail and // CommandObject::GetInvalidRegContextDescription() will be returned as // the error. CommandObject subclasses can override the virtual function // for GetInvalidRegContextDescription() to provide custom strings when // needed. //---------------------------------------------------------------------- eFlagRequiresRegContext = (1u << 4), //---------------------------------------------------------------------- // eFlagTryTargetAPILock // // Attempts to acquire the target lock if a target is selected in the // command interpreter. If the command object fails to acquire the API // lock, the command will fail with an appropriate error message. //---------------------------------------------------------------------- eFlagTryTargetAPILock = (1u << 5), //---------------------------------------------------------------------- // eFlagProcessMustBeLaunched // // Verifies that there is a launched process in m_exe_ctx, if there // isn't, the command will fail with an appropriate error message. //---------------------------------------------------------------------- eFlagProcessMustBeLaunched = (1u << 6), //---------------------------------------------------------------------- // eFlagProcessMustBePaused // // Verifies that there is a paused process in m_exe_ctx, if there // isn't, the command will fail with an appropriate error message. //---------------------------------------------------------------------- eFlagProcessMustBePaused = (1u << 7) }; Now each command object contains a "ExecutionContext m_exe_ctx;" member variable that gets initialized prior to running the command. The validity of the target objects in m_exe_ctx are checked to ensure that any target/process/thread/frame/reg context that are required are valid prior to executing the command. Each command object also contains a Mutex::Locker m_api_locker which gets used if eFlagTryTargetAPILock is set. This centralizes a lot of checking code that was previously and inconsistently implemented across many commands. llvm-svn: 171990
* Add a "--reverse" or "-r" option to the "list" with no options command. ↵Jim Ingham2013-01-091-14/+32
| | | | | | | | | | | This will list backwards from the last source point listed. Also fix the setting of the default file & line to the file containing main, when you do a plain "list". <rdar://problem/12685226> llvm-svn: 171945
* If we can't find the python function for a given summary, print the name of ↵Jim Ingham2012-12-201-1/+3
| | | | | | the function in the warning message. llvm-svn: 170729
* Fix typo in error message (print requested URL instead of command name when ↵Daniel Malea2012-12-181-1/+1
| | | | | | plugin missing) llvm-svn: 170447
* Remove the “len” defaulted parameter from ↵Jim Ingham2012-12-151-3/+3
| | | | | | CommandReturnObject::AppendMessage, AppendWarning and AppendError. Nobody was using them, and it meant if you accidentally used the AppendWarning when you meant AppendWarningWithFormat with an integer in the format string, it would compile and then return your string plus some unknown amount of junk. llvm-svn: 170266
* <rdar://problem/11990131>Greg Clayton2012-12-151-13/+23
| | | | | | Memory read's "repeat" behavior forgets "-t" option. It also formatted the type as hex bytes + ASCII. Now we revert to the default format when displaying types unless the user sets the format option manually. llvm-svn: 170265
OpenPOWER on IntegriCloud