summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* build: Fix SWIG include paths on Darwin.Daniel Dunbar2011-10-311-1/+8
| | | | llvm-svn: 143390
* Revert 143359 and modify the test case to not include non-valid c identifier ↵Johnny Chen2011-10-311-0/+7
| | | | | | character. llvm-svn: 143372
* Fix the r143266 check-in which broke TestCommandRegex.py.Johnny Chen2011-10-311-7/+0
| | | | llvm-svn: 143359
* Fixed the "expression" command when it comes to using it with the new GDB formatGreg Clayton2011-10-292-52/+98
| | | | | | | | | | | | | | | | | | command suffix: (lldb) expression/x 3+3 Since "expression" is a raw command that has options, we need to make sure the command gets its options properly terminated with a "--". Also fixed an issue where if you try to use the GDB command suffix on a command that doesn't support the "--gdb-format" command, it will report an appropriate error. For the fix above, you can query an lldb_private::Options object to see if it supports a long option by name. llvm-svn: 143266
* Get a dummy target to allow for calculator mode while processing backticks.Johnny Chen2011-10-291-0/+4
| | | | | | | | | | | | | | This also helps break the infinite loop caused when target is null. So that we can have: $ /Volumes/data/lldb/svn/trunk/build/Debug/lldb (lldb) itob `0x123 - 0x321` 32 v 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0] (lldb) llvm-svn: 143260
* Fixed the GDB format to allow the size and format characters to come in anyGreg Clayton2011-10-281-57/+27
| | | | | | | order. Also hooked up the new formats for instruction, hex float and address to the new formats. llvm-svn: 143251
* Added the ability to have GDB formats appended to any command so you can doGreg Clayton2011-10-281-60/+111
| | | | | | | | | | | | | | | | | things like: (lldb) x/32xb 0x1000 "x" is an alias to "memory read", so this will actually turn into: (lldb) memory read --gdb-format=32xb 0x1000 This applies to all commands, so the GDB formats will work with "register read", "frame variable", "target variable" and others. All commands that can accept formats, counts and sizes have been modified to support the "--gdb-format" option. llvm-svn: 143230
* Added support for the new ".apple_objc" accelerator tables. These tables areGreg Clayton2011-10-271-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the same hashed format as the ".apple_names", but they map objective C class names to all of the methods and class functions. We need to do this because in the DWARF the methods for Objective C are never contained in the class definition, they are scattered about at the translation unit level and they don't even have attributes that say the are contained within the class itself. Added 3 new formats which can be used to display data: eFormatAddressInfo eFormatHexFloat eFormatInstruction eFormatAddressInfo describes an address such as function+offset and file+line, or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants). The format character for this is "A", the long format is "address". eFormatHexFloat will print out the hex float format that compilers tend to use. The format character for this is "X", the long format is "hex float". eFormatInstruction will print out disassembly with bytes and it will use the current target's architecture. The format character for this is "i" (which used to be being used for the integer format, but the integer format also has "d", so we gave the "i" format to disassembly), the long format is "instruction". Mate the lldb::FormatterChoiceCriterion enumeration private as it should have been from the start. It is very specialized and doesn't belong in the public API. llvm-svn: 143114
* Update the GDB format text to be a bit more clear.Greg Clayton2011-10-261-9/+31
| | | | llvm-svn: 143043
* A simple fix for the GDB format strings so the byte size parameter getsGreg Clayton2011-10-262-1/+2
| | | | | | | | | | | | | properly marked as valid. Also modified the "memory read" command to be able to intelligently repeat subsequent memory requests, so now you can do: (lldb) memory read --format hex --count 32 0x1000 Then hit enter to keep viewing the memory that follows the last valid request. llvm-svn: 143015
* Cleaned up many error codes. For any who is filling in error strings intoGreg Clayton2011-10-2611-33/+215
| | | | | | | | | | | | | lldb_private::Error objects the rules are: - short strings that don't start with a capitol letter unless the name is a class or anything else that is always capitolized - no trailing newline character - should be one line if possible Implemented a first pass at adding "--gdb-format" support to anything that accepts format with optional size/count. llvm-svn: 142999
* Updated all commands that use a "--format" / "-f" options to use the newGreg Clayton2011-10-253-18/+46
| | | | | | | | | | | | OptionGroupFormat. Updated OptionGroupFormat to be able to also use the "--size" and "--count" options. Commands that use a OptionGroupFormat instance can choose which of the options they want by initializing OptionGroupFormat accordingly. Clients can either get only the "--format", "--format" + "--size", or "--format" + "--size" + "--count". This is in preparation for upcoming chnages where there are alternate ways (GDB format specification) to set a format. llvm-svn: 142911
* Prefix display/undisplay regexp command alises with "_regexp" as per theJason Molenda2011-10-251-6/+6
| | | | | | style of the other regexp command aliases. llvm-svn: 142902
* Simplified the CommandInterpreter::StripFirstWord logic by making it a staticGreg Clayton2011-10-251-55/+52
| | | | | | | | function and having it not require both a bool and a quote char to fill in. We intend to get rid of this functionality when we rewrite the command interpreter for streams eventually, but not for now. llvm-svn: 142888
* Add "di" and "dis" aliases to "disassemble" so they will win over "display".Jim Ingham2011-10-241-0/+10
| | | | llvm-svn: 142834
* Decoupling of lock-related code from the core of ScriptInterpreterPython. ↵Enrico Granata2011-10-241-224/+120
| | | | | | All that concerns locking the Python interpreter is now delegated to the internal ScriptInterpreterPython::Locker class. Several changes in ScriptInterpreterPython to accommodate this new pattern. llvm-svn: 142802
* Move Python.h includes out of the headers into the .cpp file where it's ↵Benjamin Kramer2011-10-231-5/+10
| | | | | | | | actually used. Python.h includes a ton of macros that can cause weird behavior down the road. llvm-svn: 142754
* Add "display" and "undisplay" aliases for target stop-hook add/delete.Jason Molenda2011-10-221-1/+37
| | | | | | | | A patina of gdb's "display" command, intended mostly for simply monitoring a variable as you step through source code. Formatters do not work, e.g. display/x $pc does not work. llvm-svn: 142710
* Add "stepi" as an alias for thread step-inst in addition to "si".Jason Molenda2011-10-221-0/+10
| | | | | | Add "nexti" an "ni" as aliases for thread step-inst-over. llvm-svn: 142707
* Moved lldb::user_id_t values to be 64 bit. This was going to be needed forGreg Clayton2011-10-191-3/+3
| | | | | | | | | | | process IDs, and thread IDs, but was mainly needed for for the UserID's for Types so that DWARF with debug map can work flawlessly. With DWARF in .o files the type ID was the DIE offset in the DWARF for the .o file which is not unique across all .o files, so now the SymbolFileDWARFDebugMap class will make the .o file index part (the high 32 bits) of the unique type identifier so it can uniquely identify the types. llvm-svn: 142534
* Remove stale comment.Johnny Chen2011-10-181-1/+0
| | | | llvm-svn: 142392
* Modify the help text for watching a variable or its pointee.Johnny Chen2011-10-181-2/+2
| | | | llvm-svn: 142391
* this patch introduces a new command script import command which takes as ↵Enrico Granata2011-10-172-19/+120
| | | | | | input a filename for a Python script and imports the module contained in that file. the containing directory is added to the Python path such that dependencies are honored. also, the module may contain an __lldb_init_module(debugger,dict) function, which gets called after importing, and which can somehow initialize the module's interaction with lldb llvm-svn: 142283
* Added the ability to run expressions in any command. Expressions can be Greg Clayton2011-10-141-0/+121
| | | | | | | | | | | | | | | | | inserted in commands by using backticks: (lldb) memory read `$rsp-16` `$rsp+16` (lldb) memory read -c `(int)strlen(argv[0])` `argv[0]` The result of the expression will be inserted into the command as a sort of preprocess stage where this gets done first. We might need to tweak where this preprocess stage goes, but it is very functional already. Added ansi color support to the Debugger::FormatPrompt() so you can use things like "${ansi.fg.blue}" and "${ansi.bold}" many more. This helps in adding colors to your prompts without needing to know the ANSI color code strings. llvm-svn: 141948
* Re-organized the contents of RangeMap.h to be more concise and also allow ↵Greg Clayton2011-10-073-28/+35
| | | | | | | | | | for a Range, RangeArray, RangeData (range + data), or a RangeDataArray. We have many range implementations in LLDB and I will be converting over to using the classes in RangeMap.h so we can have one set of code that does ranges and searching of ranges. Fixed up DWARFDebugAranges to use the new range classes. Fixed the enumeration parsing to take a lldb_private::Error to avoid a lot of duplicated code. Now when an invalid enumeration is supplied, an error will be returned and that error will contain a list of the valid enumeration values. llvm-svn: 141382
* Fix a problem where the stop-hook command 'frame variable g_val' produces ↵Johnny Chen2011-10-051-3/+10
| | | | | | | | | | | | | | nothing when newly created threads were subsequently stopped due to breakpoint hit. The stop-hook mechanism delegates to CommandInterpreter::HandleCommands() to execuet the commands. Make sure the execution context is switched only once at the beginning of HandleCommands() only and don't update the context while looping on each individual command to be executed. rdar://problem/10228156 llvm-svn: 141144
* Add an accompanying option to the 'frame variable -w' command to, instead of ↵Johnny Chen2011-09-301-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | watching the variable, watch the location pointed to by the variable. An example, (lldb) frame variable -w write -x 1 -g g_char_ptr (char *) g_char_ptr = 0x0000000100100860 ""... Watchpoint created: WatchpointLocation 1: addr = 0x100100860 size = 1 state = enabled type = w declare @ '/Volumes/data/lldb/svn/trunk/test/functionalities/watchpoint/hello_watchlocation/main.cpp:21' ... (lldb) c Process 3936 resuming ... rocess 3936 stopped * thread #2: tid = 0x3403, 0x00000001000009b7 a.out`do_bad_thing_with_location(char*, char) + 23 at main.cpp:27, stop reason = watchpoint 1 frame #0: 0x00000001000009b7 a.out`do_bad_thing_with_location(char*, char) + 23 at main.cpp:27 24 do_bad_thing_with_location(char *char_ptr, char new_val) 25 { 26 *char_ptr = new_val; -> 27 } 28 29 uint32_t access_pool (uint32_t flag = 0); 30 (lldb) Also add TestWatchLocation.py test to exercise this functionality. llvm-svn: 140836
* Remember to mark the OptionValueUUID as set in SetOptionValue. Jim Ingham2011-09-301-0/+2
| | | | llvm-svn: 140835
* Added to the public API to allow symbolication:Greg Clayton2011-09-241-1/+1
| | | | | | | | | | | | | | | | | - New SBSection objects that are object file sections which can be accessed through the SBModule classes. You can get the number of sections, get a section at index, and find a section by name. - SBSections can contain subsections (first find "__TEXT" on darwin, then us the resulting SBSection to find "__text" sub section). - Set load addresses for a SBSection in the SBTarget interface - Set the load addresses of all SBSection in a SBModule in the SBTarget interface - Add a new module the an existing target in the SBTarget interface - Get a SBSection from a SBAddress object This should get us a lot closer to being able to symbolicate using LLDB through the public API. llvm-svn: 140437
* Watchpoint IDs and ID Ranges are not quite the same as Breakpoint IDs and ID ↵Johnny Chen2011-09-221-3/+5
| | | | | | | | | | | | | | | | | Ranges. Add eArgTypeWatchpointID and eArgTypeWatchpointIDRange to the CommandArgumentType enums and modify the signature of CommandObject::AddIDsArgumentData() from: AddIDsArgumentData(CommandArgumentEntry &arg) to: AddIDsArgumentData(CommandArgumentEntry &arg, CommandArgumentType ID, CommandArgumentType IDRange) to accommodate. llvm-svn: 140346
* Add initial implementation of watchpoint commands for list, enable, disable, ↵Johnny Chen2011-09-221-0/+2
| | | | | | | | and delete. Test cases to be added later. llvm-svn: 140322
* Converted the lldb_private::Process over to use the intrusiveGreg Clayton2011-09-224-26/+30
| | | | | | | | | | | | | | | | | | | | shared pointers. Changed the ExecutionContext over to use shared pointers for the target, process, thread and frame since these objects can easily go away at any time and any object that was holding onto an ExecutionContext was running the risk of using a bad object. Now that the shared pointers for target, process, thread and frame are just a single pointer (they all use the instrusive shared pointers) the execution context is much safer and still the same size. Made the shared pointers in the the ExecutionContext class protected and made accessors for all of the various ways to get at the pointers, references, and shared pointers. llvm-svn: 140298
* Fix comment typo.Johnny Chen2011-09-211-1/+1
| | | | llvm-svn: 140222
* A little refactoring of the way to add break IDs or ID ranges as command ↵Johnny Chen2011-09-211-0/+20
| | | | | | | | | | | | | argument data to the command argument entry. Add a static helper function: CommandObject::AddIDsArgumentData(CommandArgumentEntry &arg) to be used from CommandObjectBreakpoint.cpp. The helper function could also be useful for commands in the future to manipulate watchpoints. llvm-svn: 140221
* One last printf-style call cleanup.Jason Molenda2011-09-201-1/+1
| | | | llvm-svn: 140205
* Update declarations for all functions/methods that accept printf-styleJason Molenda2011-09-202-5/+4
| | | | | | | | stdarg formats to use __attribute__ format so the compiler can flag incorrect uses. Fix all incorrect uses. Most of these are innocuous, a few were resulting in crashes. llvm-svn: 140185
* Adopt the intrusive pointers in:Greg Clayton2011-09-172-1/+2
| | | | | | | | | | | | lldb_private::Breakpoint lldb_private::BreakpointLocations lldb_private::BreakpointSite lldb_private::Debugger lldb_private::StackFrame lldb_private::Thread lldb_private::Target llvm-svn: 139985
* Watchpoint WIP:Johnny Chen2011-09-122-5/+5
| | | | | | | | | | | | o Rename from OptionGroupWatchpoint::WatchMode to OptionGroupWatchpoint::WatchType, and CommandArgumentType::eArgTypeWatchMode to CommandArgumentType::eArgTypeWatchType. Update the sources to reflect the change. o Add a CreateWatchpointLocation() method to Target class, which is currently not implmeneted (returns an empty WatchpointLocationSP object). Add logic to CommandObjectFrame::Execute() to exercise the added API for creating a watchpoint location. llvm-svn: 139560
* Fix a bug in OptionGroupWatchpoint.cpp where the '-w' option arg parsing ↵Johnny Chen2011-09-121-1/+2
| | | | | | | | | | | result was not checked to effect an early error return. Plus add logic to 'frame variable' command object to check that when watchpoint option is on, only one variable with exact name (no regex) is specified as the sole command arg. llvm-svn: 139524
* Don't skip the application specific ~/.lldbinit file when the programGreg Clayton2011-09-111-27/+34
| | | | | | | | | | | | | | | | | | | name is "lldb". So currently when you startup any application and you have not specified that you would like to skip loading init files through the API or from "lldb" options, then LLDB will try and load: "~/.lldbinit-%s" where %s the basename of your program "~/.lldbinit" Then LLDB will load any program specified on the command line and then source the "./.llbinit" file for any temporary debug session specific commands. I want this feature because I have thread and frame formats that do ANSI color codes that I only want to load when running in a terminal which is when I am running the "lldb" command line program. llvm-svn: 139476
* A little bit of cleanup; set watch_mode to eWatchInvalid at the ↵Johnny Chen2011-09-101-1/+1
| | | | | | OptionParsingStarting() lifecycle point. llvm-svn: 139467
* Convert OptionGroupVariable.cpp to use the arraysize() template function, as ↵Johnny Chen2011-09-101-3/+7
| | | | | | well. llvm-svn: 139452
* Refactoring: replace a bunch of static array size computation or hardcoded ↵Johnny Chen2011-09-107-26/+20
| | | | | | | | constant with a template function 'arraysize(static_array)', defined in Utils.h. llvm-svn: 139444
* Add OptionGroupWatchpoint.cpp/.h (preparatory work) for hooking up ↵Johnny Chen2011-09-092-1/+92
| | | | | | | | | | | | watchpoint to the 'frame variable' comand. To watch a variable for read/write, issue: frame variable -w read_write Note that '-w' option is not working yet. :-) llvm-svn: 139434
* Adding two new options to the 'help' command:Enrico Granata2011-09-091-1/+1
| | | | | | | | | | | --show-aliases (-a) shows aliases for commands, as well as built-in commands --hide-user-defined (-u) hides user defined commands by default 'help' without arguments does not show aliases anymore. to see them, add --show-aliases to have only built-in commands appear, use 'help --hide-user-defined' ; there is currently no way to hide built-in commands from the help output 'help command' is not changed by this commit, and help is shown even if command is an alias and -a is not specified llvm-svn: 139377
* Fixing an issue with Python commands defined interactivelyEnrico Granata2011-09-091-1/+1
| | | | llvm-svn: 139345
* Redesign of the interaction between Python and frozen objects:Enrico Granata2011-09-062-177/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored in frozen objects ; now such reads transparently move from host to target as required - as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also removed code that enabled to recognize an expression result VO as such - introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO representing a T* or T[], and doing dereferences transparently in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData - as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it en lieu of doing the raw read itself - introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers, this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory) in public layer this returns an SBData, just like GetPointeeData() - introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values - added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing Solved a bug where global pointers to global variables were not dereferenced correctly for display New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128 Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file addresses that generate file address children UNLESS we have a live process) Updated help text for summary-string Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers Edited the syntax and help for some commands to have proper argument types llvm-svn: 139160
* Don't change the host's environment, just append our Python Directory Jim Ingham2011-08-271-27/+21
| | | | | | directly to the one in sys. llvm-svn: 138693
* Make ThreadList::GetSelectedThread() select and return the 0th thread if ↵Johnny Chen2011-08-251-7/+0
| | | | | | | | there's no currently selected thread. And update the call sites accordingly. llvm-svn: 138577
* Include lldb/commands as a valid logging type in theJason Molenda2011-08-251-1/+4
| | | | | | | | | | | | 'log list' output. Remove an extraneous \n from one of the lldb/commands log line. Add an lldb/commands log indicating whether the command was successful or not. llvm-svn: 138530
OpenPOWER on IntegriCloud