summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
* Make sure that the GenerateFunction call can support arbitrary levels of ↵Enrico Granata2013-01-071-2/+4
| | | | | | indentation for user code llvm-svn: 171810
* <rdar://problem/12446222>Enrico Granata2012-12-191-2/+26
| | | | | | | | | | | Implement the ability for Python commands to be interrupted by pressing CTRL+C Also add a new Mutex subclass that attempts to be helpful for debugging by logging actions performed on it FYI of all interested - there is a separate deadlocking issue related to how LLDB dispatches CTRL+C that might cause LLDB to deadlock upon pressing CTRL+C while in a Python command. This is not a regression, and was just previously masked by us not even trying to bail out of Python commands, so that it would not be clear from a user perspective whether we were deadlocked or stuck in an inconsistent state within the Python interpreter. llvm-svn: 170612
* Remove the “len” defaulted parameter from ↵Jim Ingham2012-12-151-16/+9
| | | | | | 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/12156204>Greg Clayton2012-12-151-5/+17
| | | | | | x/a print wouldn't always reset the word size to the size of a pointer if a previous memory read using x/<gdb-format> had been used that set it to another width. llvm-svn: 170264
* <rdar://problem/12582041>Greg Clayton2012-12-151-2/+4
| | | | | | _regexp_attach doesn't handle the case where no arguments are provided. It now also handles the case you were you pass options. llvm-svn: 170262
* Option changes:Enrico Granata2012-12-122-12/+12
| | | | | | | | | | | | | | | | | the option to print the runtime-specific description has been modified in the frame variable, memory read and expression command. All three commands now support a --object-description option, with a shortcut of -O (uppercase letter o) This is a breaking change: frame variable used --objc as the long option name expression used -o as a shortcut memory read uses --objd as the long option name Hopefully, most users won't be affected by the change since people tend to access "expression --object-description" under the alias "po" which still works The test suite has been tweaked accordingly. llvm-svn: 169961
* Adding a validation callback mechanism to OptionValueString (such a feature ↵Enrico Granata2012-12-112-5/+80
| | | | | | | | | | might theoretically be added to the general OptionValue base class should the need arise) Using this mechanism, making sure that the options to pass a summary string or a named summary to frame variable do not have invalid values <rdar://problem/11576143> llvm-svn: 169927
* <rdar://problem/12827031>Greg Clayton2012-12-101-2/+11
| | | | | | Fix the OptionValueFileSpec option value to correctly get the file path when trailing spaces are on the path. The "settings set" command uses the OptionValueFileSpec class to set file paths and if extra spaces are at the end it will include those in the paths. Now we chop up the value send to to OptionValueFileSpec::SetValueFromCString(...) function with "lldb_private::Args" and give an appropriate error if more than one path is used. It also allows for quotes to be used when specifying the path. llvm-svn: 169753
* Even when we aren’t going to init all the lldb.frame, etc, globals, init ↵Jim Ingham2012-12-081-0/+7
| | | | | | lldb.debugger, since each script interpreter is tied to just one debugger. llvm-svn: 169663
* Fix a few more clang (3.2) warnings on Linux:Daniel Malea2012-12-073-5/+8
| | | | | | | | | | | | | | | | | - remove unused members - add NO_PEDANTIC to selected Makefiles - fix return values (removed NULL as needed) - disable warning about four-char-constants - remove unneeded const from operator*() declaration - add missing lambda function return types - fix printf() with no format string - change sizeof to use a type name instead of variable name - fix Linux ProcessMonitor.cpp to be 32/64 bit friendly - disable warnings emitted by swig-generated C++ code Patch by Matt Kopec! llvm-svn: 169645
* More Linux warnings fixes (remove default labels as needed):Daniel Malea2012-12-072-4/+0
| | | | | | | | - as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations Patch by Matt Kopec! llvm-svn: 169633
* Separate initing the stdout/stderr for running the Python Script interpreter ↵Jim Ingham2012-12-071-30/+36
| | | | | | | | | | from initing the lldb.target/frame/etc globals, and only do the latter when it makes sense to. <rdar://problem/12554049> llvm-svn: 169614
* <rdar://problem/12820334>Greg Clayton2012-12-061-4/+102
| | | | | | | | | | | | | I modified the "Args::StringtoAddress(...)" function to be able to evaluate address expressions. This is now used for any command line arguments or options that takes addresses like: memory read <addr> [<end-addr>] memory write <addr> breakpoint set --address <addr> disassemble --start-address <addr> --end-address <addr> It calls the expression parser to evaluate the address expression and will also work around the issue where the compiler doesn't like to add offsets to function pointers (which is what happens when you try to evaluate "main + 12"). So there is a temp fix in the Args::StringtoAddress() to work around this until we can get special compiler support for debug expressions with function pointers. llvm-svn: 169556
* Define isprint8() wrapper around isprint() in order to avoid crashes on LinuxDaniel Malea2012-12-052-8/+8
| | | | llvm-svn: 169417
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-0517-0/+34
| | | | | | | | | - add new header lldb-python.h to be included before other system headers - short term fix (eventually python dependencies must be cleaned up) Patch by Matt Kopec! llvm-svn: 169341
* <rdar://problem/12798131> Greg Clayton2012-12-0414-165/+195
| | | | | | | | | | | | Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite. This fix does the following: - make sure all short options are treated as "int" - make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired - fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates - fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value llvm-svn: 169189
* A few more build fixes for gcc 4.6:Daniel Malea2012-12-041-2/+2
| | | | | | | | - use const char* instead of char* as needed in ObjC language runtime plugin - use int to iterate through enum (operator++ on enum not defined) - use initializer list instead of inline initialization of const field llvm-svn: 169185
* Fixed a crash in which we examined the extension ofSean Callanan2012-12-031-4/+7
| | | | | | | | | a file name, whether the file name had an extension or not. <rdar://problem/12793152> llvm-svn: 169156
* <rdar://problem/12676084> Dump the traceback when a Python error occurs in ↵Enrico Granata2012-11-301-15/+68
| | | | | | "command script import" and the exception is not an ImportError llvm-svn: 169031
* Added new options to "target create" and "target modules add".Greg Clayton2012-11-303-5/+9
| | | | | | | | | | For "target create" you can now specify "--no-dependents" to not track down and add all dependent shared libraries. This can be handy when doing manual symbolication. Also added the "--symfile" or "-s" for short so you can specify a module and a stand alone debug info file: (lldb) target create --symfile /tmp/a.dSYM /usr/bin/a Added the "--symfile" option to the "target modules add" for the same reason. These all help with manualy symbolication and expose functionality that was previously only available through the public API layer. llvm-svn: 169023
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-295-12/+12
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Giving at least some error information when a Python exception happens ↵Enrico Granata2012-11-131-1/+11
| | | | | | during command script import llvm-svn: 167810
* Adding support for loading the scripting resource as part of a framework, ↵Enrico Granata2012-11-081-1/+1
| | | | | | | | lacking the dSYM bundle, or if the bundle has no Pythonic resources whatsoever Solving an issue where "command script import" would fail to pick the file indicated by the user as a result of something with the same name being in an earlier position in sys.path llvm-svn: 167570
* Get rid of hack by making the actual call public. This was causing the ↵Greg Clayton2012-11-011-1/+1
| | | | | | lldb-platform to not be able to link. llvm-svn: 167253
* Makefile patches from Charles Davis and Daniel Malea (+ one or two tweaks).Filipe Cabecinhas2012-11-011-167/+9
| | | | llvm-svn: 167242
* <rdar://problem/12586188> Make ImportError a special case for "command ↵Enrico Granata2012-10-313-30/+64
| | | | | | | | | | | script import", such that the error message for the exception becomes the error for the entire import operation and silence the backtrace printout In the process, refactor the Execute* commands in ScriptInterpreter to take an options object, and add a new setting to not mask out errors so that the callers can handle them directly instead of having the default behavior llvm-svn: 167067
* <rdar://problem/11449953> Change Debugger::SetOutputFileHandle() so that it ↵Enrico Granata2012-10-292-9/+26
| | | | | | | | | does not automatically initialize the script interpreter in order to transfer its output file handle to it This should delay initialization of Python until strictly necessary and speed-up debugger startup Also, convert formatters for SEL and BOOL ObjC data-types from Python to C++, in order to reap more performance benefits from the above changes llvm-svn: 166967
* This is a fix for the command option parser.Sean Callanan2012-10-242-2/+2
| | | | | | | | | | | | | | | | There was a generic catch-all type for path arguments called "eArgTypePath," and a specialized version called "eArgTypeFilename." It turns out all the cases where we used eArgTypePath we could have used Filename or we explicitly meant a directory. I changed Path to DirectoryName, made it use the directory completer, and rationalized the uses of Path. <rdar://problem/12559915> llvm-svn: 166533
* <rdar://problem/12523238> Commit 1 of 3Enrico Granata2012-10-231-5/+32
| | | | | | | | | | | | This commit enables the new HasChildren() feature for synthetic children providers Namely, it hooks up the required bits and pieces so that individual synthetic children providers can implement a new (optional) has_children call Default implementations have been provided where necessary so that any existing providers continue to work and behave correctly Next steps are: 2) writing smart implementations of has_children for our providers whenever possible 3) make a test case llvm-svn: 166495
* Clean up help/usage messages for kdp-remote / gdb-remote a little bit.Jason Molenda2012-10-231-4/+4
| | | | llvm-svn: 166464
* Improved support for language types as commandSean Callanan2012-10-231-1/+28
| | | | | | | | | | | | | | | | | | | | options: - added help ("help language") listing the possible options; - added the possibility of synonyms for language names, in this case "ObjC" for "Objective-C"; and - made matching against language names case insensitive. This should improve discoverability. <rdar://problem/12552359> llvm-svn: 166457
* <rdar://problem/12479701> Use the plain pydoc pager to work around Python ↵Enrico Granata2012-10-221-3/+2
| | | | | | help() pagination conflicts with our I/O management llvm-svn: 166432
* <rdar://problem/12437442>Enrico Granata2012-10-221-30/+7
| | | | | | | | | | | Given our implementation of ValueObjects we could have a scenario where a ValueObject has a dynamic type of Foo* at one point, and then its dynamic type changes to Bar* If Bar* has synthetic children enabled, by the time we figure that out, our public API is already vending SBValues wrapping a DynamicVO, instead of a SyntheticVO and there was no trivial way for us to change the SP inside an SBValue on the fly This checkin reimplements SBValue in terms of a wrapper, ValueImpl, that allows this substitutions on-the-fly by overriding GetSP() to do The Right Thing (TM) As an additional bonus, GetNonSyntheticValue() now works, and we can get rid of the ForceDisableSyntheticChildren idiom in ScriptInterpreterPython Lastly, this checkin makes sure the synthetic VOs get the correct m_value and m_data from their parents (prevented summaries from working in some cases) llvm-svn: 166426
* <rdar://problem/12491387>Greg Clayton2012-10-191-0/+58
| | | | | | | | | | Added commands to the KDP plug-in that allow sending raw commands through the KDP protocol. You specify a command byte and a payload as ASCII hex bytes, and the packet is created with a valid header/sequenceID/length and sent. The command responds with a raw ASCII hex string that contains all bytes in the reply including the header. An example of sending a read register packet for the GPR on x86_64: (lldb) process plugin packet send --command 0x07 --payload 0100000004000000 llvm-svn: 166346
* Added the infrastructure necessary for plug-ins to be able to add their own ↵Greg Clayton2012-10-191-0/+15
| | | | | | | | | | | | | | | | | settings instead of having settings added to existing ones. In particular "target.disable-kext-loading" was added to "target" where it should actually be specific to the the dynamic loader plugin. Now the plug-in manager has the ability to create settings at the root level starting with "plugin". Each plug-in type can add new sub dictionaries, and then each plug-in can register a setting dictionary under its own short name. For example the DynamicLoaderDarwinKernel plug-in now registers a setting dictionary at: plugin dynamic-loader macosx-kernel (bool) disable-kext-loading To settings can be set using: (lldb) settings set plugin.dynamic-loader.macosx-kernel.disable-kext-loading true I currently only hooked up the DynamicLoader plug-ins, but the code is very easy to duplicate when and if we need settings for other plug-ins. llvm-svn: 166294
* Change the "rb" alias to "rbreak" since some people are used to typing more ↵Jim Ingham2012-10-181-2/+2
| | | | | | | | than "rb" and so weren't finding the alias. llvm-svn: 166249
* <rdar://problem/12491420>Greg Clayton2012-10-182-14/+21
| | | | | | | | | | Added a new setting that allows a python OS plug-in to detect threads and provide registers for memory threads. To enable this you set the setting: settings set target.process.python-os-plugin-path lldb/examples/python/operating_system.py Then run your program and see the extra threads. llvm-svn: 166244
* Add the ability to set timeout & "run all threads" options both from the ↵Jim Ingham2012-10-161-2/+3
| | | | | | | | | | "expr" command and from the SB API's that evaluate expressions. <rdar://problem/12457211> llvm-svn: 166062
* <rdar://problem/12491387>Greg Clayton2012-10-132-45/+13
| | | | | | | | | | | I added the ability for a process plug-in to implement custom commands. All the lldb_private::Process plug-in has to do is override: virtual CommandObject * GetPluginCommandObject(); This object returned should be a multi-word command that vends LLDB commands. There is a sample implementation in ProcessGDBRemote that is hollowed out. It is intended to be used for sending a custom packet, though the body of the command execute function has yet to be implemented! llvm-svn: 165861
* Bunch of cleanups for warnings found by the llvm static analyzer.Jim Ingham2012-10-122-2/+5
| | | | llvm-svn: 165808
* When OptionValueFileSpec is given a filename startingJason Molenda2012-10-111-1/+1
| | | | | | | | | | with ~, we need to realpath it. Fixes the case where settings set target.expr-prefix ~/lldb.prefix.header wouldn't read this prefix header file. <rdar://problem/12475676> llvm-svn: 165704
* Don't make regexp commands as regular commands - they are "short cuts" and ↵Jim Ingham2012-10-101-1/+5
| | | | | | users should be able to override them with "unalias" but you can't unalias normal commands. llvm-svn: 165630
* Make the error message from regex commands use the command's syntax string ↵Jim Ingham2012-10-061-3/+6
| | | | | | | | if it exists rather than a generic but not at all helpful message about not matching some unknown regex... llvm-svn: 165349
* Remove "k" as an alias for "kill". It doesn't ask for confirmation andJason Molenda2012-10-051-1/+0
| | | | | | it's too easy to type by mistake when typing "l" (read: I did this once). llvm-svn: 165340
* Remove the bt alias I inadvertently added back in in my last checkin.Jim Ingham2012-10-051-4/+0
| | | | llvm-svn: 165330
* Add one-shot breakpoints (-o option to "break set") and a tbreak alias for ↵Jim Ingham2012-10-051-8/+63
| | | | | | our gdb friends. llvm-svn: 165328
* Change the "bt" command alias defined in ↵Jason Molenda2012-10-051-4/+20
| | | | | | | | | | | | CommandInterpreter::LoadCommandDictionary. It is now a regex command alias that more faithfully emulates gdb's behavior, most importantly, "bt 5" will backtrace 5 frames of the currently selected thread. "bt all" still backtraces all threads (unlike gdb) and for users who have learned to use "bt -c 5", that form is still accepted. llvm-svn: 165300
* Ran the sources through the compiler with -Wshadow warningsJason Molenda2012-10-042-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | enabled after we'd found a few bugs that were caused by shadowed local variables; the most important issue this turned up was a common mistake of trying to obtain a mutex lock for the scope of a code block by doing Mutex::Locker(m_map_mutex); This doesn't assign the lock object to a local variable; it is a temporary that has its dtor called immediately. Instead, Mutex::Locker locker(m_map_mutex); does what is intended. For some reason -Wshadow happened to highlight these as shadowed variables. I also fixed a few obivous and easy shadowed variable issues across the code base but there are a couple dozen more that should be fixed when someone has a free minute. <rdar://problem/12437585> llvm-svn: 165269
* <rdar://problem/12406088> Fixing a crasher with adding a regex command, due ↵Enrico Granata2012-10-011-6/+4
| | | | | | to accessing a shared pointer without first checking for NULL llvm-svn: 164950
* Implementing plugins that provide commands.Enrico Granata2012-09-281-4/+18
| | | | | | | | | | | | | | | | | | | This checkin adds the capability for LLDB to load plugins from external dylibs that can provide new commands It exports an SBCommand class from the public API layer, and a new SBCommandPluginInterface There is a minimal load-only plugin manager built into the debugger, which can be accessed via Debugger::LoadPlugin. Plugins are loaded from two locations at debugger startup (LLDB.framework/Resources/PlugIns and ~/Library/Application Support/LLDB/PlugIns) and more can be (re)loaded via the "plugin load" command For an example of how to make a plugin, refer to the fooplugin.cpp file in examples/plugins/commands Caveats: Currently, the new API objects and features are not exposed via Python. The new commands can only be "parsed" (i.e. not raw) and get their command line via a char** parameter (we do not expose our internal Args object) There is no unloading feature, which can potentially lead to leaks if you overwrite the commands by reloading the same or different plugins There is no API exposed for option parsing, which means you may need to use getopt or roll-your-own llvm-svn: 164865
OpenPOWER on IntegriCloud