summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
Commit message (Collapse)AuthorAgeFilesLines
...
* Initial merge of some of the iOS 8 / Mac OS X Yosemite specificJason Molenda2014-06-131-0/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lldb support. I'll be doing more testing & cleanup but I wanted to get the initial checkin done. This adds a new SBExpressionOptions::SetLanguage API for selecting a language of an expression. I added adds a new SBThread::GetInfoItemByPathString for retriving information about a thread from that thread's StructuredData. I added a new StructuredData class for representing key-value/array/dictionary information (e.g. JSON formatted data). Helper functions to read JSON and create a StructuredData object, and to print a StructuredData object in JSON format are included. A few Cocoa / Cocoa Touch data formatters were updated by Enrico to track changes in iOS 8 / Yosemite. Before we query a thread's extended information, the system runtime may provide hints to the remote debug stub that it will use to retrieve values out of runtime structures. I added a new SystemRuntime method AddThreadExtendedInfoPacketHints which allows the SystemRuntime to add key-value type data to the initial request that we send to the remote stub. The thread-format formatter string can now retrieve values out of a thread's extended info structured data. The default thread-format string picks up two of these - thread.info.activity.name and thread.info.trace_messages. I added a new "jThreadExtendedInfo" packet in debugserver; I will add documentation to the lldb-gdb-remote.txt doc soon. It accepts JSON formatted arguments (most importantly, "thread":threadnum) and it returns a variety of information regarding the thread to lldb in JSON format. This JSON return is scanned into a StructuredData object that is associated with the thread; UI layers can query the thread's StructuredData to see if key-values are present, and if so, show them to the user. These key-values are likely to be specific to different targets with some commonality among many targets. For instance, many targets will be able to advertise the pthread_t value for a thread. I added an initial rough cut of "thread info" command which will print the information about a thread from the jThreadExtendedInfo result. I need to do more work to make this format reasonably. Han Ming added calls into the pmenergy and pmsample libraries if debugserver is run on Mac OS X Yosemite to get information about the inferior's power use. I added support to debugserver for gathering the Genealogy information about threads, if it exists, and returning it in the jThreadExtendedInfo JSON result. llvm-svn: 210874
* Added the ability to save core files:Greg Clayton2014-06-131-0/+67
| | | | | | | | | | | (lldb) file /bin/ls (lldb) b malloc (lldb) run (lldb) process save-core /tmp/ls.core Each ObjectFile plug-in now has the option to save core files by registering a new static callback. llvm-svn: 210864
* Fix Windows warnings.Todd Fiala2014-05-281-7/+1
| | | | | | | | | | This fixes a number of trivial warnings in the Windows build. This is part of a larger effort to make the Windows build warning-free. See http://reviews.llvm.org/D3914 for more details. Change by Zachary Turner llvm-svn: 209749
* lldb TOT is dropping the last entry for multi-line IOHandlers that use the ↵Greg Clayton2014-05-085-6/+6
| | | | | | | | IOHandlerDelegateMultiline. <rdar://problem/16844164> llvm-svn: 208336
* Rename eExecution*** to eExpression*** to be consistent with the result type.Jim Ingham2014-05-052-3/+3
| | | | llvm-svn: 207945
* Make the Expression Execution result enum available to the SB API layer.Jim Ingham2014-05-052-2/+2
| | | | | | | | | Add a callback that will allow an expression to be cancelled between the expression evaluation stages (for the ClangUserExpressions.) <rdar://problem/16790467>, <rdar://problem/16573440> llvm-svn: 207944
* "DONE" is being left in multi-line results when it shouldn't for non ↵Greg Clayton2014-05-025-6/+6
| | | | | | | | terminal input. <rdar://problem/16790579> llvm-svn: 207818
* sweep up -Wformat warnings from gccSaleem Abdulrasool2014-04-041-309/+278
| | | | | | | This is a purely mechanical change explicitly casting any parameters for printf style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux. llvm-svn: 205607
* Get "dis -c -s" working again.Jim Ingham2014-04-031-1/+1
| | | | | | pr19324 llvm-svn: 205544
* Make the fail messagesJim Ingham2014-04-032-4/+7
| | | | llvm-svn: 205497
* sanitise sign comparisonsSaleem Abdulrasool2014-04-025-6/+7
| | | | | | | | This is a mechanical change addressing the various sign comparison warnings that are identified by both clang and gcc. This helps cleanup some of the warning spew that occurs during builds. llvm-svn: 205390
* Add the ability to set python breakpoint commands from the SBBreakpoint & ↵Jim Ingham2014-04-021-8/+2
| | | | | | | | | | | SBBreakpointLocation API's. You can either provide the function name, or function body text. Also propagate the compilation error up from where it is checked so we can report compilation errors. <rdar://problem/9898371> llvm-svn: 205380
* Fixed a crasher when using 1 character type names in “type summary”, ↵Greg Clayton2014-03-261-32/+26
| | | | | | | | | | “type synthetic” and “type filter”. Also fixed a missing return when making python summary functions on the fly. <rdar://problem/16265491> llvm-svn: 204867
* A fix for: http://llvm.org/bugs/show_bug.cgi?id=19241 Greg Clayton2014-03-251-1/+1
| | | | | | When there was no process, the expression options were set to not ignore breakpoints. This causes debug info to be generated and causes errors when evaluating simple expressions. llvm-svn: 204745
* Make "disassemble -a" work when the target is not running yet. It will dump ↵Jim Ingham2014-03-251-57/+102
| | | | | | | | all the functions matching that address, just like "disassemble -n" does before running. <rdar://problem/16406570> llvm-svn: 204689
* JITed functions can now have debug info and be debugged with debug and ↵Greg Clayton2014-03-241-0/+6
| | | | | | | | | | | | | | | | | | | source info: (lldb) b puts (lldb) expr -g -i0 -- (int)puts("hello") First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression. Main features: - New ObjectFileJIT class that can be easily created for JIT functions - debug info can now be enabled when parsing expressions - source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit - "expr -g --" allows you to single step through your expression function with source code <rdar://problem/16382881> llvm-svn: 204682
* Cleanup some dead assignements reported by scan-buildArnaud A. de Grandmaison2014-03-222-9/+3
| | | | | | No functionnal change. llvm-svn: 204545
* cleanup unreferenced functionsSaleem Abdulrasool2014-03-201-8/+2
| | | | | | | | | | | | | This is a mechanical cleanup of unused functions. In the case where the functions are referenced (in comment form), I've simply commented out the functions. A second pass to clean that up is warranted. The functions which are otherwise unused have been removed. Some of these were introduced in the initial commit and not in use prior to that point! NFC llvm-svn: 204310
* create constants for multichar constantsSaleem Abdulrasool2014-03-181-2/+9
| | | | | | | | Multichar constants are not portable as the byte order is undefined. Use a constant value instead. This avoids a warning when compiling with gcc 4.8+ (-Wmultichar) and makes the code more portable. llvm-svn: 204110
* One more time. Multi-line expressions when there is no valid expression that ↵Greg Clayton2014-03-131-1/+1
| | | | | | follow “expr [options] —“. llvm-svn: 203874
* Fixed crasher when “expr” was NULL due to no characters following the ↵Greg Clayton2014-03-131-1/+1
| | | | | | terminating "--". llvm-svn: 203873
* Allow a multi-line expression to follow expression commands with options ↵Greg Clayton2014-03-132-19/+35
| | | | | | when there is no expression following the option terminating “—“. llvm-svn: 203872
* This commit reworks how the thread plan's ShouldStopHere mechanism works, so ↵Jim Ingham2014-03-131-7/+31
| | | | | | | | | | | | | | | that it is useful not only for customizing "step-in" behavior (e.g. step-in doesn't step into code with no debug info), but also the behavior of step-in/step-out and step-over when they step out of the frame they started in. I also added as a proof of concept of this reworking a mode for stepping where stepping out of a frame into a frame with no debug information will continue stepping out till it arrives at a frame that does have debug information. This is useful when you are debugging callback based code where the callbacks are separated from the code that initiated them by some library glue you don't care about, among other things. llvm-svn: 203747
* Remove %zx in printf (only GCC supports it, not MSVC).Virgile Bello2014-03-081-1/+1
| | | | llvm-svn: 203349
* Allow line numbers to be shown in multi-line expressions.Greg Clayton2014-03-072-2/+4
| | | | llvm-svn: 203185
* Stop messages from being emitted out of order when detaching. Greg Clayton2014-03-031-1/+0
| | | | llvm-svn: 202756
* "size_t" isn't always 64 bit, it is 32 bit on 32 bit systems. All printf ↵Greg Clayton2014-03-034-20/+20
| | | | | | | | style statements that were assuming size_t were 64 bit were changed, and they were also changed to display them as unsigned values as "size_t" isn't signed. If you print anything with 'size_t', please cast it to "uint64_t" in the printf and use PRIu64 or PRIx64. llvm-svn: 202738
* Fix Windows build using portable types for formatting the log outputsDeepak Panickal2014-03-036-26/+26
| | | | llvm-svn: 202723
* When a multiline expression produces output, the multi-line help message is ↵Greg Clayton2014-02-112-15/+7
| | | | | | | | printed twice. <rdar://problem/16031890> llvm-svn: 201171
* Modified ObjectFile::SetLoadAddress() to now be:Greg Clayton2014-02-071-1/+2
| | | | | | | | | | | | | | ObjectFile::SetLoadAddress (Target &target, lldb::addr_t value, bool value_is_offset); Now "value" is a slide if "value_is_offset" is true, and "value" is an image base address otherwise. All previous usage of this API was using slides. Updated the ObjectFileELF and ObjectFileMachO SetLoadAddress methods to do the right thing. Also updated the ObjectFileMachO::SetLoadAddress() function to not load __LINKEDIT when it isn't needed and to only load sections that belong to the executable object file. llvm-svn: 201003
* <rdar://problem/12857181>Enrico Granata2014-02-071-1/+34
| | | | | | | | | | | | When a user says type formatter add ... unsigned int he most probably means to deal with the "unsigned int" type. However, given how the LLDB command parser works, that command will try to add the formatter to the TWO types 'unsigned' AND 'int' Since this is unlikely to be what the user wants, warn about it, and suggest they can use quotes to override the debugger's understanding llvm-svn: 200996
* Fixed output to display correctly for "command source" by fixing the correct ↵Greg Clayton2014-02-051-2/+0
| | | | | | | | | | flags being set. Also emit the "Executing commands" message so it properly only comes out when desired and so it comes out in the right place. <rdar://problem/15992208> llvm-svn: 200875
* Fixed an issue where "command source" would not do the right thing:Greg Clayton2014-02-051-26/+45
| | | | | | | - empty lines in init files would repeat previous command and cause errors to be displayed - all options to control showing the command, its output, if it should stop on error or continue, weren't being obeyed. llvm-svn: 200860
* Fixing the Windows build for the changes brought in from the iohandler merge.Deepak Panickal2014-01-312-3/+9
| | | | llvm-svn: 200565
* Merging the iohandler branch back into main. Greg Clayton2014-01-2714-1156/+841
| | | | | | | | | | | | The many many benefits include: 1 - Input/Output/Error streams are now handled as real streams not a push style input 2 - auto completion in python embedded interpreter 3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use 4 - it is now possible to use curses to drive LLDB (please try the "gui" command) We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases. llvm-svn: 200263
* The default timeout for EvaluateExpressionOptions is not 0, so if no timeout ↵Jim Ingham2014-01-171-0/+2
| | | | | | | | is provided, we have to set the option timeout to 0 by hand. <rdar://problem/15846781> llvm-svn: 199509
* Fix a couple of memory leaks.Jean-Daniel Dupas2013-12-291-2/+6
| | | | llvm-svn: 198178
* Add a new way to bind a format to a type: by enum typeEnrico Granata2013-12-281-10/+22
| | | | | | | | | | | The "type format add" command gets a new flag --type (-t). If you pass -t <sometype>, upon fetching the value for an object of your type, LLDB will display it as-if it was of enumeration type <sometype> This is useful in cases of non-contiguous enums where there are empty gaps of unspecified values, and as such one cannot type their variables as the enum type, but users would still like to see them as-if they were of the enum type (e.g. DWARF field types with their user-reserved ranges) The SB API has also been improved to handle both types of formats, and a test case is added llvm-svn: 198105
* FormatNavigator has long stopped navigating anything - the generation of ↵Enrico Granata2013-12-201-36/+36
| | | | | | | | | possible formatters matches is now done elsewhere So, rename the class for what it truly is: a FormattersContainer Also do a bunch of related text substitutions in the interest of overall naming clarity llvm-svn: 197795
* Centralized the launching of a process into Target::Launch()Greg Clayton2013-12-131-112/+29
| | | | | | | | | | | | | While investigating test suite failures when running the test suite remotely, I noticed we had 3 copies of code that launched a process: 1 - in "process launch" command 2 - SBTarget::Launch() with args 3 - SBTarget::Launch() with SBLaunchInfo "process launch" was launching through the platform if it was supported (this is needed for remote debugging) and the 2 and 3 were not. Now all code is in one place. llvm-svn: 197247
* Fix autocompletion for multi-word commands.Greg Clayton2013-12-101-4/+5
| | | | | | <rdar://problem/14183288> llvm-svn: 196949
* For logical backtrace work, lldb needs to track Module unloads etc & ↵Greg Clayton2013-12-064-0/+4
| | | | | | | | | | symoblicate an address based on a point in time <rdar://problem/15314403> This patch adds a new lldb_private::SectionLoadHistory class that tracks what shared libraries were loaded given a process stop ID. This allows us to keep a history of the sections that were loaded for a time T. Many items in history objects will rely upon the process stop ID in the future. llvm-svn: 196557
* Fixed internal code to not link against and code from "lldb/API/*". Greg Clayton2013-12-021-6/+0
| | | | | | | | | | lldb_private::Debugger was #including some "lldb/API" header files which causes tools (lldb-platform and lldb-gdbserver) that link against the internals only (no API layer) to fail to link depending on which calls were being used. Also fixed the current working directory so that it gets set correctly for remote test suite runs. Now the remote working directory is set to: "ARCH/TESTNUM/..." where ARCH is the current architecture name and "TESTNUM" is the current test number. Fixed the "lldb-platform" and "lldb-gdbserver" to not warn about mismatched visibility settings by having each have their own exports file which contains nothing. This forces all symbols to not be exported, and also quiets the linker warnings. llvm-svn: 196141
* Only use a PTY master/slave when launching for local processes.Greg Clayton2013-11-221-3/+3
| | | | llvm-svn: 195483
* Expose SBPlatform through the public API.Greg Clayton2013-11-201-170/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example code: remote_platform = lldb.SBPlatform("remote-macosx"); remote_platform.SetWorkingDirectory("/private/tmp") debugger.SetSelectedPlatform(remote_platform) connect_options = lldb.SBPlatformConnectOptions("connect://localhost:1111"); err = remote_platform.ConnectRemote(connect_options) if err.Success(): print >> result, 'Connected to remote platform:' print >> result, 'hostname: %s' % (remote_platform.GetHostname()) src = lldb.SBFileSpec("/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework", False) dst = lldb.SBFileSpec() # copy src to platform working directory since "dst" is empty err = remote_platform.Install(src, dst); if err.Success(): print >> result, '%s installed successfully' % (src) else: print >> result, 'error: failed to install "%s": %s' % (src, err) Implemented many calls needed in lldb-platform to be able to install a directory that contains symlinks, file and directories. The remote lldb-platform can now launch GDB servers on the remote system so that remote debugging can be spawned through the remote platform when connected to a remote platform. The API in SBPlatform is subject to change and will be getting many new functions. llvm-svn: 195273
* Minor improvement to the "memory find" commandEnrico Granata2013-11-131-16/+18
| | | | | | | | | | Remove the --do-read option, and always provide a small dump of memory at each match spot Add a --dump-offset (-o) option, to specify a byte offset from which to start dumping relative to the matching address The real solution is to actually provide the format options found on "memory read" and use those as the key to actually printing memory upon each find That, however, requires a little refactoring work, so put this in for now until I get a chance to do the required shuffling around of moving parts llvm-svn: 194600
* Small typos in previous commitEnrico Granata2013-11-131-3/+3
| | | | llvm-svn: 194546
* <rdar://problem/14322677>Enrico Granata2013-11-131-5/+308
| | | | | | | | | Implement a "memory find" command for LLDB This is still fairly rough around the edges but works well enough for simple scenarios where a chunk of text or a number are to be found within a certain range of memory, as in mem find `buffer` `buffer+0x1000` -s "me" -c 5 -r llvm-svn: 194544
* Change SBThread::GetExtendedBacktrace toJason Molenda2013-11-121-1/+1
| | | | | | | SBThread::GetExtendedBacktraceThread to make it more clear what is being returned. llvm-svn: 194531
* Add initial --extended / -e support to thread backtrace.Jason Molenda2013-11-121-0/+49
| | | | llvm-svn: 194455
OpenPOWER on IntegriCloud