summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix broken tests due to new error output.Todd Fiala2014-07-0812-132/+68
| | | | | | | | | | | This reverses out the options validators changes. We'll get these back in once the changes to the output can be resolved. Restores broken tests on FreeBSD, Linux, MacOSX. Changes reverted: r212500, r212317, r212290. llvm-svn: 212543
* Fix a compilation failure caused by a non-const reference.Zachary Turner2014-07-081-1/+1
| | | | llvm-svn: 212509
* Invalidate process UID/GID-related command options on Windows.Zachary Turner2014-07-074-33/+97
| | | | | | | | | | | | Windows uses a different process security model and does not have a concept of process UID or GID. This patch makes these options invalid on Windows. Attempting to specify these options when the current platform is Windows will generate an error. Reviewed by: Jim Ingham Differential Revision: http://reviews.llvm.org/D4373 llvm-svn: 212500
* Windows build fixes and removal of endlessly recursive termination function.Todd Fiala2014-07-041-9/+0
| | | | | | | | | | | | | This change removes the ScriptInterpreter::TerminateInterpreter() call which ended up endlessly calling itself as things currently stand. It also cleans up some other Windows-related cmake changes. See http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140630/011544.html for more details. Change by Zachary Turner llvm-svn: 212320
* Adds the notion of an OptionValidator.Zachary Turner2014-07-039-35/+35
| | | | | | | | | | | | | | | | | | The purpose of the OptionValidator is to determine, based on some arbitrary set of conditions, whether or not a command option is valid for a given debugger state. An example of this might be to selectively disable or enable certain command options that don't apply to a particular platform. This patch contains no functional change, and does not actually make use of an OptionValidator for any purpose yet. A follow-up patch will begin to add the logic and users of OptionValidator. Reviewed by: Greg Clayton, Jim Ingham Differential Revision: http://reviews.llvm.org/D4369 llvm-svn: 212290
* Add host layer support for pipes.Greg Clayton2014-07-021-12/+8
| | | | | | | | | | | Windows does support pipes, but they do so in a slightly different way. Added a Host layer which abstracts the use of pipes into a new Pipe class that everyone can use. Windows benefits include: - Being able to interrupt running processes when IO is directly hooked up - being able to interrupt long running python scripts - being able to interrupt anything based on ConnectionFileDescriptor llvm-svn: 212220
* This creates a valid Python API for Windows, pending some issues. The ↵Deepak Panickal2014-07-011-0/+5
| | | | | | | | | | | | | changes included are - - Ported the SWIG wrapper shell scripts to Python so that they would work on Windows too along with other platforms - Updated CMake handling to fix SWIG errors and manage sym-linking on Windows to liblldb.dll - More build fixes for Windows The pending issues are that two Python modules, termios and pexpect are not available on Windows. These are currently required for the Python command interpreter to be used from within LLDB. llvm-svn: 212111
* lldb: remove adhoc implementation of array_sizeofSaleem Abdulrasool2014-06-272-2/+5
| | | | | | | | Replace adhoc inline implementation of llvm::array_lengthof in favour of the implementation in LLVM. This is simply a cleanup change, no functional change intended. llvm-svn: 211868
* Fix a few typos.Bruce Mitchener2014-06-271-2/+2
| | | | llvm-svn: 211851
* Interpreter: kill some dead codeSaleem Abdulrasool2014-06-131-4/+1
| | | | | | | Remove commented out code and an unnecessary associated scope. No functional change. llvm-svn: 210882
* Interpreter: explicitly initialize base classSaleem Abdulrasool2014-06-131-0/+1
| | | | | | | Initialise base class std::enable_shared_from_this explicitly. Identified by GCC. llvm-svn: 210881
* Remove unused variablesSaleem Abdulrasool2014-06-131-3/+0
| | | | | | | | Address the 'variable set but not used' warning from GCC. In some cases a few additional calls were removed where there should be no visible side effects of the calls (i.e. should not effect any cached state). llvm-svn: 210879
* Args::StringToGenericRegister will now accept "lr" as Jason Molenda2014-05-091-1/+1
| | | | | | | | | | | | | another way to indicate that this register is a generic Return Address register (in addition to "ra") - this is used primarily by OperatingSystem plugins. Correctly annotate the UnwindPlan created by EmulateInstructionARM64 to indicate that it was not sourced from a compiler and it is valid at every instruction. <rdar://problem/16639754> llvm-svn: 208390
* lldb TOT is dropping the last entry for multi-line IOHandlers that use the ↵Greg Clayton2014-05-081-1/+1
| | | | | | | | IOHandlerDelegateMultiline. <rdar://problem/16844164> llvm-svn: 208336
* Rename eExecution*** to eExpression*** to be consistent with the result type.Jim Ingham2014-05-052-11/+11
| | | | llvm-svn: 207945
* Make the Expression Execution result enum available to the SB API layer.Jim Ingham2014-05-052-2/+7
| | | | | | | | | 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-021-1/+1
| | | | | | | | terminal input. <rdar://problem/16790579> llvm-svn: 207818
* Fixed CTRL+C related issues:Greg Clayton2014-05-022-11/+45
| | | | | | | | | | | | - CTRL+C wasn't clearing the command in lldb - CTRL+C doesn't work in python macros in lldb - Ctrl+C no longer interrupts the running process that you attach to <rdar://problem/15949205> <rdar://problem/16778652> <rdar://problem/16774411> llvm-svn: 207816
* Free the strong reference to a lldb::SBDebugger that the script interpreter ↵Greg Clayton2014-04-252-0/+14
| | | | | | was holding onto in the "lldb.debugger" global variable. llvm-svn: 207292
* Make sure that the CommandInterpreter::m_command_io_handler_sp gets reset ↵Greg Clayton2014-04-251-0/+6
| | | | | | | | | | when we quit. Currently if you run _any_ python, python has the "lldb.debugger" global variable and it has a strong reference to a lldb_private::Debugger since it is a lldb::SBDebugger object with a shared pointer. This makes sure that your LLDB command interpreter history is saved each time you quit command line LLDB. llvm-svn: 207164
* Switch NULL to C++11 nullptr in source/InterpreterEd Maste2014-04-2033-399/+399
| | | | | | Patch by Robert Matusewicz llvm-svn: 206711
* Cleanup the code a bit.Greg Clayton2014-04-071-1/+1
| | | | llvm-svn: 205739
* Remember to clear the cached data for the OptionValueFileSpec in ↵Jim Ingham2014-04-041-0/+1
| | | | | | | | SetValueFromCString. <rdar://problem/16179718> target.expr-prefix contents appear to be cached for an entire session llvm-svn: 205636
* sanitise sign comparisonsSaleem Abdulrasool2014-04-025-8/+9
| | | | | | | | 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-32/+54
| | | | | | | | | | | 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
* lldb arm64 import.Jason Molenda2014-03-291-1/+1
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* Don't build LLDBWrapPython.cpp for mingw.Hafiz Abid Qadeer2014-03-211-1/+2
| | | | | | | | | | Previous check relied on -DLLDB_DISABLE_PYTHON which was not valid as it is defined in the top level LLDB Makefile which is included after the check. If this check is moved after the inclusion of top level Makefile then BUILT_SOURCES is not properly handled. So I am using the scheme present in the Host/Makefile. llvm-svn: 204459
* cleanup unreferenced functionsSaleem Abdulrasool2014-03-201-7/+0
| | | | | | | | | | | | | 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/+6
| | | | | | | | 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
* Allow line numbers to be shown in multi-line expressions.Greg Clayton2014-03-071-0/+4
| | | | llvm-svn: 203185
* "size_t" isn't always 64 bit, it is 32 bit on 32 bit systems. All printf ↵Greg Clayton2014-03-031-1/+1
| | | | | | | | 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-032-8/+8
| | | | llvm-svn: 202723
* Suppress python readline module under Linux to fix a seg fault.Todd Fiala2014-02-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug fix for pr18841: http://llvm.org/bugs/show_bug.cgi?id=18841 This change creates a stub Python readline.so module that does almost nothing. Its whole purpose is to prevent Python from loading the real module, something it does during the embedded Python interpreter's initialization sequence (and way before lldb ever requests it within embedded_interpreter.py). On Ubuntu 12.04 and 13.10 x86_64, and in the Python 2.7.6 tree, the stock Python readline module links against the GNU readline library. This appears to be the case on all Pythons except where __APPLE__ is defined. LLDB now requires linking against the libedit library. Something about having both libedit.so and libreadline.so linked into the same process space is causing the Python readline.so to trigger a NULL memory access. I have put in a separate patch to python.org. This suppression of embedded interpreter readline support can be removed if at least any one of the following happens: 1. The stock python distribution accepts a patch similar to what I submitted to Python 2.7.6's Modules/readline.c file. 2. The stock python distribution implements Modules/readline.c in terms of libedit's readline compatibility mode (i.e. essentially compiles it the way __APPLE__ compiles that module) under Linux. 3. a clean-room implementation of the python readline module is implemented against libedit (either readline compatibility mode or native libedit). This could be implemented within the readline.cpp file that this change introduces. It cannot be a fork of python's readline.c module due to llvm licensing. The net effect of this change on Linux is that the embedded python's readline support will not exist. llvm-svn: 202243
* Fixed the command line LLDB so that "CTRL+C" will interrupt a running ↵Greg Clayton2014-02-241-1/+7
| | | | | | process again. llvm-svn: 202086
* Don't crash when we build with python enabled, yet we don't link in the ↵Greg Clayton2014-02-211-2/+2
| | | | | | | | lldb::SB* API layer. Previously the lldb-platform and lldb-gdbserver would crash. llvm-svn: 201872
* <rdar://problem/15906684>Enrico Granata2014-02-192-5/+7
| | | | | | | | The way in which we were determining whether a python module had already been imported in the current session stopped working due to the IOHandler changes As a result, importing in a new debug session a module which had been imported in a previous session did not work This commit restores that functionality by checking for the module's presence in the session dictionary (which should be more correct anyway) llvm-svn: 201623
* Fixed deadlocks that could occur when using python for breakpoints, ↵Greg Clayton2014-02-131-38/+48
| | | | | | | | | operating system plugins, and other async python usage. <rdar://problem/16054348> <rdar://problem/16040833> llvm-svn: 201372
* Now that the command interpreter runs in a separate thread in Xcode, we need ↵Greg Clayton2014-02-071-7/+1
| | | | | | | | | | | | | to lock the target API lock instead of trying to lock it. What was happening was: 1 - Xcode ran and stopped and was doing work on thread 2 2 - Users would type something in Xcode console on thread 1 3 - thread 3 would be running command interpreter thread and try to execute command but get "failed to get API lock" error for any command that wanted the target API lock (like "expression") <rdar://problem/15775016> llvm-svn: 200997
* Don't print out "script" results twice.Greg Clayton2014-02-051-9/+25
| | | | | | | | We now properly detect when a result object has an immediate output stream and don't echo the results a second time. <rdar://problem/15954906> llvm-svn: 200882
* Fixed output to display correctly for "command source" by fixing the correct ↵Greg Clayton2014-02-051-8/+14
| | | | | | | | | | 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-37/+138
| | | | | | | - 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
* <rdar://problem/15936507>Enrico Granata2014-02-051-7/+5
| | | | | | | | ScriptInterpreterPython caches the lldb.embedded_interpreter module, and since it caches it in a refcounting-safe PythonObject, the refcount will appropriately go down 1 every time a ScriptInterpreterPython is deallocated However, we were only importing the module once - in InitializePrivate(). In a handful of interpreter creations, the refcount on the run_one_line function would end up at 0, causing LLDB to crash This fixes it by also importing the module for every interpreter, which ensures correct refcounting llvm-svn: 200816
* Fixed b18655: cleaned up script interpreter file reference handling.Todd Fiala2014-01-301-5/+22
| | | | | | | | | | | | | | This change addresses shutdown crashes in the python lldb module when the script interpreter was hanging on to saved file references after leaving a session. It also gets rid of extra references to the stdin/stdout/stderr python file objects that are created when entering the session. This change also moves the bundled pyexpect 2.4 library to the front of the python library path so that a python distribution default pyexpect (2.3 in Ubuntu 12.04) is not picked up first. llvm-svn: 200486
* "script help (lldb.SBThread)" output stops before all output is displayed. ↵Greg Clayton2014-01-301-7/+9
| | | | | | | | Fixed now. <rdar://problem/15942977> llvm-svn: 200476
* Don't crash when trying to auto complete 'breakpoint set -n "_'Greg Clayton2014-01-291-1/+1
| | | | | | <rdar://problem/15921898> llvm-svn: 200402
* Merging the iohandler branch back into main. Greg Clayton2014-01-275-1265/+808
| | | | | | | | | | | | 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
* Add a new-lineEnrico Granata2013-12-211-1/+1
| | | | llvm-svn: 197860
* Fix autocompletion for multi-word commands.Greg Clayton2013-12-101-7/+14
| | | | | | <rdar://problem/14183288> llvm-svn: 196949
* Fixed Makefile-based install to place python packages in the LLDB install tree.Sylvestre Ledru2013-12-061-1/+1
| | | | | | | | | Failure to install python packages now fails the make install. This patch properly handles the optional DESTDIR variable. Patch by Todd Fiala llvm-svn: 196624
* Revert: "Patch from Todd Fiala that install the lldb.py module in the prefix ↵Sylvestre Ledru2013-12-051-1/+1
| | | | | | | | directory and also makes install fail if the prefix directory can't be accessed" Does not respect the prefix llvm-svn: 196499
OpenPOWER on IntegriCloud