summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* Add format specifiers to various format ids so we can print thread ids in ↵Michael Sartain2013-07-301-2/+2
| | | | | | | | | | decimal on Linux and FreeBSD. CC: emaste Differential Revision: http://llvm-reviews.chandlerc.com/D1234 llvm-svn: 187425
* Fixed several problems with watchpoint expressions.Sean Callanan2013-07-251-1/+1
| | | | | | | | | | | | | | | | - First, the watchpoint size was being cast to the wrong type. This is primarily cosmetic, but annoying. - Second, the options for the watchpoint command were not being initialized correctly, which led to the watchpoint size sometimes having absurdly large values. This caused watchpoints to fail to be set in some cases. <rdar://problem/12658775> llvm-svn: 187169
* Added Repr() and Str() member functions to our PythonObject class to allow ↵Enrico Granata2013-07-121-0/+22
| | | | | | easy conversion to-string of every PythonObject llvm-svn: 186205
* Second attempt at getting the PyCallable changes in trunkEnrico Granata2013-07-092-12/+20
| | | | | | Thanks to Daniel Malea for helping test this patch for Linux happiness! llvm-svn: 185965
* Revert commits that cause broken builds on GCC buildbotsDaniel Malea2013-07-032-14/+6
| | | | | | | | - build fails due to PyCallable template definition inside an extern "C" scope This commit reverts 185240, 184893 and 184608. llvm-svn: 185560
* <rdar://problem/14266411>Enrico Granata2013-06-252-6/+14
| | | | | | | | | | | | The semi-unofficial way of returning a status from a Python command was to return a string (e.g. return "no such variable was found") that LLDB would pick as a clue of an error having happened This checkin changes that: - SBCommandReturnObject now exports a SetError() call, which can take an SBError or a plain C-string - script commands now drop any return value and expect the SBCommandReturnObject ("return object") to be filled in appropriately - if you do nothing, a success will be assumed If your commands were relying on returning a value and having LLDB pick that up as an error, please change your commands to SetError() through the return object or expect changes in behavior llvm-svn: 184893
* Fix some more mismatched integer types causing compiler warnings.Andy Gibbs2013-06-241-1/+1
| | | | llvm-svn: 184737
* In thread and frame format strings, it is now allowed to use Python ↵Enrico Granata2013-06-201-0/+160
| | | | | | | | | | | | | | | functions to generate part or all of the output text Specifically, the ${target ${process ${thread and ${frame specifiers have been extended to allow a subkeyword .script:<fctName> (e.g. ${frame.script:FooFunction}) The functions are prototyped as def FooFunction(Object,unused) where object is of the respective SB-type (SBTarget for target.script, ... and so on) This has not been implemented for ${var because it would be akin to a Python summary which is already well-defined in LLDB llvm-svn: 184500
* Sort out a number of mismatched integer types in order to cut down the ↵Andy Gibbs2013-06-194-16/+16
| | | | | | number of compiler warnings. llvm-svn: 184333
* Improvements to "command script import" to better support reloading in XcodeEnrico Granata2013-06-191-8/+26
| | | | | | | | | | | Xcode spawns a new LLDB SBDebugger for each debug session, and this was causing the reloading of python modules to fail across debug sessions (long story short: the module would not be loaded in the current instance of the ScriptInterpreter, but would still be present in sys.modules, hence the import call would just make a copy of it and not run it again Greg's new decorator uncovered the issue since it relies on actually loading the module's code rather than using __lldb_init_module as the active entity) This patch introduces the notion of a local vs. global import and crafts an appropriate command to allow reloading to work across debug sessions llvm-svn: 184279
* We were getting an assert because somebody was making a watchpoint that wasJim Ingham2013-06-181-2/+7
| | | | | | | | neither read nor write. Tighten up the checking so this isn't possible. <rdar://problem/14111167> llvm-svn: 184245
* Fix a missing pointer deref that was uncovered by one of the buildbots.Adrian Prantl2013-06-181-1/+1
| | | | llvm-svn: 184216
* This patch fixes the issue where our command-line tab completer would ↵Enrico Granata2013-06-181-13/+18
| | | | | | | | | | | | | | | | | sometimes replicate commands e.g. (lldb) pl<TAB> Available completions: platform plugin platform plugin Thanks to Matthew Sorrels for doing work and testing on this issue llvm-svn: 184212
* <rdar://problem/13270271>Enrico Granata2013-06-181-8/+1
| | | | | | | Only add the — (double dash) separator to a command syntax if it has any options to be separated from arguments Also remove the unused Translate() method from CommandObject llvm-svn: 184163
* <rdar://problem/13926101>Enrico Granata2013-06-181-3/+17
| | | | | | | | Allow “command script import” to work with folder names that have a ‘ (tick) in them Kudos to StackOverflow (question 1494399) for the replace_all code! llvm-svn: 184158
* Add new files to CMakeLists.txt to fix cmake build error.Michael Sartain2013-06-171-0/+1
| | | | llvm-svn: 184143
* <rdar://problem/14134716>Enrico Granata2013-06-172-65/+149
| | | | | | | | | | | | This is a rewrite of the command history facility of LLDB It takes the history management out of the CommandInterpreter into its own CommandHistory class It reimplements the command history command to allow more combinations of options to work correctly (e.g. com hist -c 1 -s 5) It adds a new --wipe (-w) option to command history to allow clearing the history on demand It extends the lldbtest runCmd: and expect: methods to allow adding commands to history if need be It adds a test case for the reimplemented facility llvm-svn: 184140
* <rdar://problem/11914077>Enrico Granata2013-06-121-0/+77
| | | | | | | If you type help command <word> <word> <word> <missingSubCommand> (e.g. help script import or help type summary fake), you will get help on the deepest matched command word (i.e. script or type summary in the examples) Also, reworked the logic for commands to produce their help to make it more object-oriented llvm-svn: 183822
* <rdar://problem/13299214>Enrico Granata2013-06-121-2/+4
| | | | | | Make the error message here more interesting for the user llvm-svn: 183818
* Making our Python decrefs NULL-safeEnrico Granata2013-06-111-7/+7
| | | | llvm-svn: 183774
* <rdar://problem/12876503>Enrico Granata2013-06-111-1/+10
| | | | | | | Adding a new setting interpreter.stop-command-source-on-error that dictates a default behavior for whether command source should stop upon hitting an error You can still override the setting for each individual invocation with the usual -e setting llvm-svn: 183719
* Fix various build warnings.Matt Kopec2013-06-031-2/+3
| | | | llvm-svn: 183140
* <rdar://problem/11109316>Enrico Granata2013-05-311-1/+4
| | | | | | | | | | | | | | | | | command script import now does reloads - for real If you invoke command script import foo and it detects that foo has already been imported, it will - invoke reload(foo) to reload the module in Python - re-invoke foo.__lldb_init_module This second step is necessary to ensure that LLDB does not keep cached copies of any formatter, command, ... that the module is providing Usual caveats with Python imports persist. Among these: - if you have objects lurking around, reloading the module won't magically update them to reflect changes - if module A imports module B, reloading A won't reload B These are Python-specific issues independent of LLDB that would require more extensive design work The --allow-reload (-r) option is maintained for compatibility with existing scripts, but is clearly documented as redundant - reloading is always enabled whether you use it or not llvm-svn: 182977
* Fixed a file leak introduced with my last checkin. Also be sure to include ↵Greg Clayton2013-05-221-5/+8
| | | | | | <stdio.h> just in case. llvm-svn: 182537
* Added a new "lldb" log channel named "os" for the OperatingSystem plug-ins ↵Greg Clayton2013-05-221-1/+26
| | | | | | | | to use. Added logging for the OS plug-in python objects in OperatingSystemPython so we can see the python dictionary returned from the plug-in when logging is enabled. llvm-svn: 182530
* Apropos should search user commands as well as built-in commands.Jim Ingham2013-05-171-14/+39
| | | | | | rdar://problem/13916722 llvm-svn: 182068
* <rdar://problem/11158023>Enrico Granata2013-05-161-2/+8
| | | | | | Make type summary add and breakpoint command add show an helpful prototype + argument reference when manually typing Python code for these elements llvm-svn: 181968
* <rdar://problem/13892319>Greg Clayton2013-05-151-1/+1
| | | | | | The command "po" by itself yields odd errors. I fixed the alias. llvm-svn: 181856
* <rdar://problem/13854277>Greg Clayton2013-05-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <rdar://problem/13594769> Main changes in this patch include: - cleanup plug-in interface and use ConstStrings for plug-in names - Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp - Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging The plug-in interface changes: Modified the lldb_private::PluginInterface class that all plug-ins inherit from: Changed: virtual const char * GetPluginName() = 0; To: virtual ConstString GetPluginName() = 0; Removed: virtual const char * GetShortPluginName() = 0; - Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names. - Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc. llvm-svn: 181631
* Test case added for importing packagesEnrico Granata2013-05-081-8/+10
| | | | llvm-svn: 181472
* Improvements to the package importing feature - test case will followEnrico Granata2013-05-081-4/+14
| | | | llvm-svn: 181461
* Remove the UUID::GetAsCString() method which required a buffer to save the Jason Molenda2013-05-031-3/+4
| | | | | | | UUID string in; added UUID::GetAsString() which returns the uuid string in a std::string. Updated callers to use the new method. llvm-svn: 181078
* Fixed 'command script import' by eliminating the shadowing of basename.Ashok Thirumurthi2013-05-031-2/+1
| | | | | | Reviewed by: Daniel Malea llvm-svn: 181027
* <rdar://problem/11558812>Enrico Granata2013-05-021-27/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow command script import to load packages. e.g.: egranata$ ./lldb (lldb) command script import lldb.macosx.crashlog "crashlog" and "save_crashlog" command installed, use the "--help" option for detailed help "malloc_info", "ptr_refs", "cstr_refs", and "objc_refs" commands have been installed, use the "--help" options on these commands for detailed help. The "unwind-diagnose" command has been installed, type "help unwind-diagnose" for detailed help. (lldb) ./lldb (lldb) command script import theFoo I am happy (lldb) fbc àèìòù (lldb) egranata$ ls theFoo/ __init__.py theBar.py egranata$ cat theFoo/__init__.py import lldb import theBar def __lldb_init_module(debugger, internal_dict): print "I am happy" debugger.HandleCommand("command script add -f theFoo.theBar.theCommand fbc") return None egranata$ cat theFoo/theBar.py #encoding=utf-8 def theCommand(debugger, command, result, internal_dict): result.PutCString(u"àèìòù") return None llvm-svn: 180975
* If HandleCommands is called with add_to_history set to false, turn on the ↵Jim Ingham2013-05-021-1/+7
| | | | | | | | m_command_source_depth so that when we forget the value for regex & alias commands it still stays off. <rdar://problem/13795202> llvm-svn: 180971
* Recommitting r180831 with trivial fix - remember to return errors if you ↵Jim Ingham2013-05-021-1/+0
| | | | | | compute. llvm-svn: 180898
* Reverting 180831 as it crashes TestDefaultConstructorForAPIObjects.pyDaniel Malea2013-05-011-0/+1
| | | | llvm-svn: 180868
* Change CommandReturnObject::AppendMessage to print an empty line ifJason Molenda2013-05-011-1/+1
| | | | | | | | | AppendMessage("") is called. This idiom is used in a handful of places right now (e.g. to put space between different threads in 'bt all') but the empty newline is being omitted instead of emitted. <rdar://problem/13753830> llvm-svn: 180841
* Added an option to "process detach" to keep the process stopped, if the ↵Jim Ingham2013-04-301-1/+0
| | | | | | | | | | process plugin (or in the case of ProcessGDBRemote the stub we are talking to) know how to do that. rdar://problem/13680832 llvm-svn: 180831
* Avoiding a potentially memory allocating code path in the Python ↵Enrico Granata2013-04-291-17/+36
| | | | | | InputReader's CTRL+C handling code path - this can potentially cause a deadlock while interrupting a user-made Python command llvm-svn: 180726
* Cleanup logging to use the new "std::string FileSpec::GetPath()" function. ↵Greg Clayton2013-04-291-11/+1
| | | | | | | | | | | Also added a similar function for modules: std::string Module::GetSpecificationDescription () const; This returns the module as "/usr/lib/libfoo.dylib" for normal files (calls "std::string FileSpec::GetPath()" on m_file) but it also might include the object name in case the module is for a .o file in a BSD archive ("/usr/lib/libfoo.a(bar.o)"). Cleaned up necessary logging code to use it. llvm-svn: 180717
* Look for an inexact match in just the commands before searching the alias ↵Matt Kopec2013-04-231-2/+7
| | | | | | commands as well. llvm-svn: 180117
* Fix linux argument completion with for "--" options (llvm.org/bugs/pr14425)Daniel Malea2013-04-231-2/+1
| | | | | | | | | | | | | | | | | | | Patch by Yacine Belkadi! When __GLIBC__ is defined, optind gets initialized to 0. So for the first parsed option, parse_start is 0, too. If this option has no argument (Like "--continue" of "process attach"), then the position stored is 0, instead of 1. This prevents the completion later on in Options::HandleOptionCompletion() because the opt_pos doesn't match the cursor_index. Fix that by getting the option's position from the value of optind, as it's done for the other types of options. Re-enable test_process_attach_dash_dash_con() on Linux. No regressions detected on Mac OS X (in TestCompletion.py) llvm-svn: 180114
* Fixed some linux buildbot warnings.Greg Clayton2013-04-192-3/+6
| | | | llvm-svn: 179892
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-184-21/+21
| | | | | | the macros and just use C++11. llvm-svn: 179805
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-184-21/+21
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* Removed the "expr" alias for "expression," whichSean Callanan2013-04-171-3/+1
| | | | | | | is entirely unnecessary and confuses the command interpreter when the user types "exp". llvm-svn: 179691
* <rdar://problem/13457391>Greg Clayton2013-04-043-21/+24
| | | | | | LLDB now can use a single dash for all long options for all commands form the command line and from the command interpreter. This involved just switching all calls from getopt_long() to getopt_long_only(). llvm-svn: 178789
* <rdar://problem/13384801>Greg Clayton2013-04-032-7/+10
| | | | | | Make lldb_private::RegularExpression thread safe everywhere. This was done by removing the m_matches array from the lldb_private::RegularExpression class and putting it into the new lldb_private::RegularExpression::Match class. When executing a regular expression you now have the option to create a lldb_private::RegularExpression::Match object and pass a pointer in if you want to get parenthesized matching. If you don't want any matching, you pass in NULL. The lldb_private::RegularExpression::Match object is initialized with the number of matches you desire. Any matching strings are now extracted from the lldb_private::RegularExpression::Match objects. This makes the regular expression objects thread safe and as a result many more regex objects were turned into static objects that end up using a local lldb_private::RegularExpression::Match object when executing. llvm-svn: 178702
* <rdar://problem/13506727> Greg Clayton2013-04-031-2/+2
| | | | | | | | | | | | Symbol table function names should support lookups like symbols with debug info. To fix this I: - Gutted the way FindFunctions is used, there used to be way too much smarts only in the DWARF plug-in - Made it more efficient by chopping the name up once and using simpler queries so that SymbolFile and Symtab plug-ins don't need to do as much - Filter the results at a higher level - Make the lldb_private::Symtab able to chop up C++ mangled names and make as much sense out of them as possible and also be able to search by basename, fullname, method name, and selector name. llvm-svn: 178608
OpenPOWER on IntegriCloud