summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* Python synthetic children:Enrico Granata2011-07-243-4/+218
| | | | | | | | | | | | | | - you can now define a Python class as a synthetic children producer for a type the class must adhere to this "interface": def __init__(self, valobj, dict): def get_child_at_index(self, index): def get_child_index(self, name): then using type synth add -l className typeName (e.g. type synth add -l fooSynthProvider foo) (This is still WIP with lots to be added) A small test case is available also as reference llvm-svn: 135865
* when typing a summary string you can use the %S symbol to explicitly ↵Enrico Granata2011-07-221-2/+9
| | | | | | | | | | | | | | | indicate that you want the summary to be used to print the target object (e.g. ${var%S}). this might already be the default if your variable is of an aggregate type new feature: synthetic filters. you can restrict the number of children for your variables to only a meaningful subset - the restricted list of children obeys the typical rules (e.g. summaries prevail over children) - one-line summaries show only the filtered (synthetic) children, if you type an expanded summary string, or you use Python scripts, all the real children are accessible - to provide a synthetic children list use the "type synth add" command, as in: type synth add foo_type --child varA --child varB[0] --child varC->packet->flags[1-4] (you can use ., ->, single-item array operator [N] and bitfield operator [N-M]; array slice access is not supported, giving simplified names to expression paths is not supported) - a new -S option to frame variable and target variable lets you override synthetic children and instead show real ones llvm-svn: 135731
* Some descriptive text for the Python script feature:Enrico Granata2011-07-161-9/+19
| | | | | | | | | | | | | | | - help type summary add now gives some hints on how to use it frame variable and target variable now have a --no-summary-depth (-Y) option: - simply using -Y without an argument will skip one level of summaries, i.e. your aggregate types will expand their children and display no summary, even if they have one. children will behave normally - using -Y<int>, as in -Y4, -Y7, ..., will skip as many levels of summaries as given by the <int> parameter (obviously, -Y and -Y1 are the same thing). children beneath the given depth level will behave normally -Y0 is the same as omitting the --no-summary-depth parameter entirely This option replaces the defined-but-unimplemented --no-summary llvm-svn: 135336
* Python summary strings:Enrico Granata2011-07-152-4/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - you can use a Python script to write a summary string for data-types, in one of three ways: -P option and typing the script a line at a time -s option and passing a one-line Python script -F option and passing the name of a Python function these options all work for the "type summary add" command your Python code (if provided through -P or -s) is wrapped in a function that accepts two parameters: valobj (a ValueObject) and dict (an LLDB internal dictionary object). if you use -F and give a function name, you're expected to define the function on your own and with the right prototype. your function, however defined, must return a Python string - test case for the Python summary feature - a few quirks: Python summaries cannot have names, and cannot use regex as type names both issues will be fixed ASAP major redesign of type summary code: - type summary working with strings and type summary working with Python code are two classes, with a common base class SummaryFormat - SummaryFormat classes now are able to actively format objects rather than just aggregating data - cleaner code to print descriptions for summaries the public API now exports a method to easily navigate a ValueObject hierarchy New InputReaderEZ and PriorityPointerPair classes Several minor fixes and improvements llvm-svn: 135238
* Fixed a crasher where entering 'help disasm' on the command line would crash ↵Johnny Chen2011-07-141-1/+3
| | | | | | | | | | | lldb. The reasom of the crash is because of a missing entry in the argument table corresponding to eArgTypeUnsignedInteger. Add such entry and modify the call site of the crash to go through a fail-fast API to retrieve the argument table. Add a regression test to TestHelp.py. llvm-svn: 135206
* Added "command history" command to dump the command history.Jim Ingham2011-07-121-2/+100
| | | | | | | | | | | | | | | | | Also made: (lldb) !<NUM> (lldb) !-<NUM> (lldb) !! work with the history. For added benefit: (lldb) !<NUM><TAB> will insert the command at position <NUM> in the history into the command line to be edited. This is only partial, I still need to sync up editline's history list with the one kept by the interpreter. llvm-svn: 134955
* named summaries:Enrico Granata2011-07-122-5/+10
| | | | | | | | | | | | - a new --name option for "type summary add" lets you give a name to a summary - a new --summary option for "frame variable" lets you bind a named summary to one or more variables ${var%s} now works for printing the value of 0-terminated CStrings type format test case now tests for cascading - this is disabled on GCC because GCC may end up stripping typedef chains, basically breaking cascading new design for the FormatNavigator class new template class CleanUp2 meant to support cleanup routines with 1 additional parameter beyond resource handle llvm-svn: 134943
* Allow reading memory from files before the target has been run.Jim Ingham2011-07-091-3/+7
| | | | llvm-svn: 134780
* final fix for the global constructors issueEnrico Granata2011-07-081-2/+2
| | | | | | | new GetValueForExpressionPath() method in ValueObject to navigate expression paths in a more bitfield vs slices aware way changes to the varformats.html document (WIP) llvm-svn: 134679
* Fixed a warning where initializing CommandObject::g_arguments_data[] ↵Enrico Granata2011-07-071-64/+64
| | | | | | required global constructors llvm-svn: 134613
* Centralize the variable display prefs into a new optionGreg Clayton2011-07-071-0/+109
| | | | | | | | | | | | | group class: OptionGroupVariable. It gets initialized with a boolean that indicates if the frame specific options are included so that this can be used in both the "frame variable" and "target variable" commands. Removed the global functionality from the "frame variable" command. Users should switch to using the "target variable" command. llvm-svn: 134594
* Added "target variable" command that allows introspection of globalGreg Clayton2011-07-072-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variables prior to running your binary. Zero filled sections now get section data correctly filled with zeroes when Target::ReadMemory reads from the object file section data. Added new option groups and option values for file lists. I still need to hook up all of the options to "target variable" to allow more complete introspection by file and shlib. Added the ability for ValueObjectVariable objects to be created with only the target as the execution context. This allows them to be read from the object files through Target::ReadMemory(...). Added a "virtual Module * GetModule()" function to the ValueObject class. By default it will look to the parent variable object and return its module. The module is needed when we have global variables that have file addresses (virtual addresses that are specific to module object files) and in turn allows global variables to be displayed prior to running. Removed all of the unused proxy object support that bit rotted in lldb_private::Value. Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code with the more efficient "FileSpec::Equal (lhs, rhs)". Improved logging in GDB remote plug-in. llvm-svn: 134579
* new detailed descriptions for type summary add and type format addEnrico Granata2011-07-072-12/+95
| | | | | | | some changes to the help system code for better display of long help text -p and -r flags now also work for type format add llvm-svn: 134574
* Cleanup errors that come out of commands and make sure they all have newlinesGreg Clayton2011-07-021-1/+31
| | | | | | | | | | | | | _only_ in the resulting stream, not in the error objects (lldb_private::Error). lldb_private::Error objects should always just have an error string with no terminating newline characters or periods. Fixed an issue with GDB remote packet detection that could end up deadlocking if a full packet wasn't received in one chunk. Also modified the packet checking function to properly toss one or more bytes when it detects bad data. llvm-svn: 134357
* several improvements to "type summary":Enrico Granata2011-07-021-1/+33
| | | | | | | | | | | | | - type names can now be regular expressions (exact matching is done first, and is faster) - integral (and floating) types can be printed as bitfields, i.e. ${var[low-high]} will extract bits low thru high of the value and print them - array subscripts are supported, both for arrays and for pointers. the syntax is ${*var[low-high]}, or ${*var[]} to print the whole array (the latter only works for statically sized arrays) - summary is now printed by default when a summary string references a variable. if that variable's type has no summary, value is printed instead. to force value, you can use %V as a format specifier - basic support for ObjectiveC: - ObjectiveC inheritance chains are now walked through - %@ can be specified as a summary format, to print the ObjectiveC runtime description for an object - some bug fixes llvm-svn: 134293
* ++ cannot be used to increment an enum, so do it another wayPeter Collingbourne2011-06-241-1/+1
| | | | llvm-svn: 133781
* Centralized all of the format to c-string and to format character code insideGreg Clayton2011-06-232-52/+18
| | | | | | | | | | | | | | | the FormatManager class. Modified the format arguments in any commands to be able to use a single character format, or a full format name, or a partial format name if no full format names match. Modified any code that was displaying formats to use the new FormatManager calls so that our help text and errors never get out of date. Modified the display of the "type format list" command to be a bit more human readable by showing the format as a format string rather than the single character format char. llvm-svn: 133765
* Fix header pathsPeter Collingbourne2011-06-231-1/+1
| | | | llvm-svn: 133755
* Fix typo spotted by Elias Pipping.Charles Davis2011-06-231-2/+2
| | | | llvm-svn: 133744
* Committing type format code for Enrico Granata.Greg Clayton2011-06-232-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a new top level command named "type". Currently this command implements three commands: type format add <format> <typename1> [<typename2> ...] type format delete <typename1> [<typename2> ...] type format list [<typename1> [<typename2>] ...] This allows you to specify the default format that will be used to display types when you use "frame variable" or "expression", or the SBValue classes. Examples: // Format uint*_t as hex type format add x uint16_t uint32_t uint64_t // Format intptr_t as a pointer type format add p intptr_t The format characters are the same as "printf" for the most part with many additions. These format character specifiers are also used in many other commands ("frame variable" for one). The current list of format characters include: a - char buffer b - binary B - boolean c - char C - printable char d - signed decimal e - float f - float g - float i - signed decimal I - complex integer o - octal O - OSType p - pointer s - c-string u - unsigned decimal x - hex X - complex float y - bytes Y - bytes with ASCII llvm-svn: 133728
* When installing the Python modules:Charles Davis2011-06-231-5/+5
| | | | | | | | | | | - Respect DESTDIR. - Use the realpath function on the path before prepending DESTDIR. - Don't depend on liblldb.{so,dylib} being installed already. - Don't put the DESTDIR into the _lldb.so symlink. Patch by Elias Pipping! llvm-svn: 133689
* Remove -MT options from SWIG invocationPeter Collingbourne2011-06-221-2/+1
| | | | | | | | | SWIG on Darwin does not support -MT, and it only means that we lose the .d target, which doesn't seem to be used or needed. Pointed out by Charles Davis. llvm-svn: 133660
* Add dependency tracking/clean rule to interpreter makefilePeter Collingbourne2011-06-201-4/+16
| | | | llvm-svn: 133463
* Create a _lldb.so symlink in the bin directoryPeter Collingbourne2011-06-201-7/+9
| | | | | | This is required to run the test suite without installing. llvm-svn: 133459
* Added a new format for displaying an array of characters: eFormatCharArrayGreg Clayton2011-06-171-0/+2
| | | | | | | | | | | | | | This us useful because sometomes you have to show a single character as: 'a' (using eFormatChar) and other times you might have an array of single charcters for display as: 'a' 'b' 'c', and other times you might want to show the contents of buffer of characters that can contain non printable chars: "\0\x22\n123". This also fixes an issue that currently happens when you have a single character C string (const char *a = "a"; or char b[1] = { 'b' };) that was being output as "'a'" incorrectly due to the way the eFormatChar format output worked. llvm-svn: 133316
* Added the notion of an system root for SDKs. This is a directory where allGreg Clayton2011-06-171-2/+20
| | | | | | | | | | | | | | | | libraries and headers exist. This can be specified using the platform select function: platform select --sysroot /Volumes/remote-root remote-macosx Each platform subclass is free to interpret the sysroot as needed. Expose the new SDK root directory through the SBDebugger class. Fixed an issue with the GDB remote protocol where unimplemented packets were not being handled correctly. llvm-svn: 133231
* Add 'batch_mode' to CommandInterpreter. Modify InputReaders toCaroline Tice2011-06-162-22/+37
| | | | | | | | | | not write output (prompts, instructions,etc.) if the CommandInterpreter is in batch_mode. Also, finish updating InputReaders to write to the asynchronous stream, rather than using the Debugger's output file directly. llvm-svn: 133162
* Add error message; clean up comment.Caroline Tice2011-06-141-1/+1
| | | | llvm-svn: 132997
* Cleaning up the Python script interpreter: Use theCaroline Tice2011-06-131-133/+7
| | | | | | | | embedded_interpreter.py file rather than keeping it all in a string and compiling the string (easier to maintain, easier to read, remove redundancy). llvm-svn: 132935
* Use Py_InitializeEx(0) instead of Py_Initialize,Caroline Tice2011-06-021-1/+1
| | | | | | | to prevent Python from installing its own signal handlers. llvm-svn: 132492
* Fix remaining Python issues leftover from my previous patch.Charles Davis2011-06-011-1/+8
| | | | | | | | | | | | | - The Swig post-processing scripts are now run. - edit-swig-python-wrapper-file.py has been modified so it can be run from the Makefile. - The issue that prompted me to pass -classic to swig is fixed by this, so -classic isn't passed anymore. Python shouldn't complain anymore about a missing method 'FindDebuggerByID' on the SBDebugger object whenever lldb is run. llvm-svn: 132383
* When installing the binary part of the LLDB Python modules, symlink to theCharles Davis2011-05-201-1/+1
| | | | | | | installed liblldb instead of the built one. Now Python support won't break if you clean your build directories. llvm-svn: 131741
* Fix typo. Stupid 'n' key...Charles Davis2011-05-201-1/+1
| | | | llvm-svn: 131720
* Some makefile fixes for the Interpreter:Charles Davis2011-05-201-2/+17
| | | | | | | | | | | | | - Make the generation of LLDBWrapPython.cpp respect the VERBOSE setting. - Use -classic mode when generating. LLDPWrapPython.cpp #errors out if -classic wasn't set when it was generated with recent Swig. - Install the Python modules. Now we shouldn't get loads of Python errors trying to run LLDB. Last of my build fixes. The LLDB that I built works, except that I can't debug anything with it until debugserver gets built. llvm-svn: 131719
* Headers have been moved to /includes/lldb/Interpreter. This patchJohnny Chen2011-05-138-9/+9
| | | | | | | | reflects this change. Marco Minutoli <mminutoli@gmail.com> llvm-svn: 131306
* Add ability to recognize/handle quotes around commandsCaroline Tice2011-05-111-14/+61
| | | | | | (e.g. '"target" create' works as well as 'target create'). llvm-svn: 131185
* Replace calls to HandleCommand in lldb core with more appropriateCaroline Tice2011-05-061-26/+158
| | | | | | | direct function calls. As part of this, collect code that processes arguments & options for aliases into a single function. llvm-svn: 131020
* Change "frame var" over to using OptionGroups (and thus the ↵Jim Ingham2011-05-041-2/+25
| | | | | | | | | OptionGroupVariableObjectDisplay). Change the boolean "use_dynamic" over to a tri-state, no-dynamic, dynamic-w/o running target, and dynamic with running target. llvm-svn: 130832
* Added new OptionGroup classes for UInt64, UUID, File and Boolean values.Greg Clayton2011-05-037-3/+279
| | | | | | | | | | | | | | | | | | | | | Removed the "image" command and moved it to "target modules". Added an alias for "image" to "target modules". Added some new target commands to be able to add and load modules to a target: (lldb) target modules add <path> (lldb) target modules load [--file <path>] [--slide <offset>] [<sect-name> <sect-load-addr> ...] So you can load individual sections without running a target: (lldb) target modules load --file /usr/lib/libSystem.B.dylib __TEXT 0x7fccc80000 __DATA 0x1234000000 Or you can rigidly slide an entire shared library: (lldb) target modules load --file /usr/lib/libSystem.B.dylib --slid 0x7fccc80000 This should improve bare board debugging when symbol files need to be slid around manually. llvm-svn: 130796
* Pre-load the Python script interpreter with the followingCaroline Tice2011-05-031-0/+41
| | | | | | | | | | | convenience variables (from the ExecutionContext) each time it is entered: lldb.debugger, lldb.target, lldb.process, lldb.thread, lldb.frame. If a frame (or thread, process, etc) does not currently exist, the variable contains the Python value 'None'. llvm-svn: 130792
* This patch captures and serializes all output being written by theCaroline Tice2011-05-022-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | command line driver, including the lldb prompt being output by editline, the asynchronous process output & error messages, and asynchronous messages written by target stop-hooks. As part of this it introduces a new Stream class, StreamAsynchronousIO. A StreamAsynchronousIO object is created with a broadcaster, who will eventually broadcast the stream's data for a listener to handle, and an event type indicating what type of event the broadcaster will broadcast. When the Write method is called on a StreamAsynchronousIO object, the data is appended to an internal string. When the Flush method is called on a StreamAsynchronousIO object, it broadcasts it's data string and clears the string. Anything in lldb-core that needs to generate asynchronous output for the end-user should use the StreamAsynchronousIO objects. I have also added a new notification type for InputReaders, to let them know that a asynchronous output has been written. This is to allow the input readers to, for example, refresh their prompts and lines, if desired. I added the case statements to all the input readers to catch this notification, but I haven't added any code for handling them yet (except to the IOChannel input reader). llvm-svn: 130721
* Added the ability to specify dumping options (show types, show location,Greg Clayton2011-04-284-45/+75
| | | | | | | depth control, pointer depth, and more) when dumping memory and viewing as a type. llvm-svn: 130436
* Added a new OptionValue subclass for lldb::Format: OptionValueFormat. AddedGreg Clayton2011-04-276-22/+341
| | | | | | | | | | | | | | | | | | | | | new OptionGroup subclasses for: - output file for use with options: long opts: --outfile <path> --append--output short opts: -o <path> -A - format for use with options: long opts: --format <format> - variable object display controls for depth, pointer depth, wether to show types, show summary, show location, flat output, use objc "po" style summary. Modified ValueObjectMemory to be able to be created either with a TypeSP or a ClangASTType. Switched "memory read" over to use OptionGroup subclasses: one for the outfile options, one for the command specific options, and one for the format. llvm-svn: 130334
* Fixed the SymbolContext::DumpStopContext() to correctly indent and dumpGreg Clayton2011-04-232-12/+13
| | | | | | | | | | | | | | | | | inline contexts when the deepest most block is not inlined. Added source path remappings to the lldb_private::Target class that allow it to remap paths found in debug info so we can find source files that are elsewhere on the current system. Fixed disassembly by function name to disassemble inline functions that are inside other functions much better and to show enough context before the disassembly output so you can tell where things came from. Added the ability to get more than one address range from a SymbolContext class for the case where a block or function has discontiguous address ranges. llvm-svn: 130044
* Erase from a string instead of using substr when you don't really need to.Greg Clayton2011-04-221-1/+1
| | | | llvm-svn: 130013
* Change code for reading emulation data files to read the new fileCaroline Tice2011-04-221-0/+15
| | | | | | | format. (The newly formatted files will go in as a separate commit in a few minutes). llvm-svn: 129981
* Did some work on the "register read" command to only show the first registerGreg Clayton2011-04-221-19/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set by default when dumping registers. If you want to see all of the register sets you can use the "--all" option: (lldb) register read --all If you want to just see some register sets, you can currently specify them by index: (lldb) register read --set 0 --set 2 We need to get shorter register set names soon so we can specify the register sets by name without having to type too much. I will make this change soon. You can also have any integer encoded registers resolve the address values back to any code or data from the object files using the "--lookup" option. Below is sample output when stopped in the libc function "puts" with some const strings in registers: Process 8973 stopped * thread #1: tid = 0x2c03, 0x00007fff828fa30f libSystem.B.dylib`puts + 1, stop reason = instruction step into frame #0: 0x00007fff828fa30f libSystem.B.dylib`puts + 1 (lldb) register read --lookup General Purpose Registers: rax = 0x0000000100000e98 "----------------------------------------------------------------------" rbx = 0x0000000000000000 rcx = 0x0000000000000001 rdx = 0x0000000000000000 rdi = 0x0000000100000e98 "----------------------------------------------------------------------" rsi = 0x0000000100800000 rbp = 0x00007fff5fbff710 rsp = 0x00007fff5fbff280 r8 = 0x0000000000000040 r9 = 0x0000000000000000 r10 = 0x0000000000000000 r11 = 0x0000000000000246 r12 = 0x0000000000000000 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x0000000000000000 rip = 0x00007fff828fa30f libSystem.B.dylib`puts + 1 rflags = 0x0000000000000246 cs = 0x0000000000000027 fs = 0x0000000000000000 gs = 0x0000000000000000 As we can see, we see two constant strings and the PC (register "rip") is showing the code it resolves to. I fixed the register "--format" option to work as expected. Added a setting to disable skipping the function prologue when setting breakpoints as a target settings variable: (lldb) settings set target.skip-prologue false Updated the user settings controller boolean value handler funciton to be able to take the default value so it can correctly respond to the eVarSetOperationClear operation. Did some usability work on the OptionValue classes. Fixed the "image lookup" command to correctly respond to the "--verbose" option and display the detailed symbol context information when looking up line table entries and functions by name. This previously was only working for address lookups. llvm-svn: 129977
* More iteration on the new option value stuff. We now define an Greg Clayton2011-04-211-37/+2
| | | | | | | OptionValueCollection class that can be subclassed to provide access to internal settings that are stored as ObjectValue subclasses. llvm-svn: 129926
* Made the constructors public for all OptionValue classesGreg Clayton2011-04-211-56/+138
| | | | | | | | so we can instantiate them, and also moved the code that can get the specific subclass for a OptionValue into the OptionValue class. llvm-svn: 129920
* Fixed some more 'commands' to 'command' change.Johnny Chen2011-04-211-2/+2
| | | | llvm-svn: 129897
OpenPOWER on IntegriCloud