summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/ScriptInterpreterPython.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* This commit:Enrico Granata2012-02-291-45/+141
| | | | | | | | | | | | | a) adds a Python summary provider for NSDate b) changes the initialization for ScriptInterpreter so that we are not passing a bulk of Python-specific function pointers around c) provides a new ScriptInterpreterObject class that allows for ref-count safe wrapping of scripting objects on the C++ side d) contains much needed performance improvements: 1) the pointer to the Python function generating a scripted summary is now cached instead of looked up every time 2) redundant memory reads in the Python ObjC runtime wrapper are eliminated 3) summaries now use the m_summary_str in ValueObject to store their data instead of passing around ( == copying) an std::string object e) contains other minor fixes, such as adding descriptive error messages for some cases of summary generation failure llvm-svn: 151703
* Patch from Filipe Cabecinhas!Johnny Chen2012-02-291-3/+14
| | | | | | Attached is a small python fix to save the current stout and std err when starting a python session, then diverting them (as it was before), and restoring the previous values afterwards. Otherwise, a python script could suddenly find itself without output. llvm-svn: 151693
* This patch provides a set of formatters for most of the commonly used Cocoa ↵Enrico Granata2012-02-231-0/+5
| | | | | | | | | | classes. The formatter for NSString is an improved version of the one previously shipped as an example, the others are new in design and implementation. A more robust and OO-compliant Objective-C runtime wrapper is provided for runtime versions 1 and 2 on 32 and 64 bit. The formatters are contained in a category named "AppKit", which is not enabled at startup. llvm-svn: 151299
* Thread hardening part 3. Now lldb_private::Thread objects have std::weak_ptrGreg Clayton2012-02-211-2/+3
| | | | | | | | | | | | | | | | | objects for the backlink to the lldb_private::Process. The issues we were running into before was someone was holding onto a shared pointer to a lldb_private::Thread for too long, and the lldb_private::Process parent object would get destroyed and the lldb_private::Thread had a "Process &m_process" member which would just treat whatever memory that used to be a Process as a valid Process. This was mostly happening for lldb_private::StackFrame objects that had a member like "Thread &m_thread". So this completes the internal strong/weak changes. Documented the ExecutionContext and ExecutionContextRef classes so that our LLDB developers can understand when and where to use ExecutionContext and ExecutionContextRef objects. llvm-svn: 151009
* This checking is part one of trying to add some threading safety to ourGreg Clayton2012-02-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | internals. The first part of this is to use a new class: lldb_private::ExecutionContextRef This class holds onto weak pointers to the target, process, thread and frame and it also contains the thread ID and frame Stack ID in case the thread and frame objects go away and come back as new objects that represent the same logical thread/frame. ExecutionContextRef objcets have accessors to access shared pointers for the target, process, thread and frame which might return NULL if the backing object is no longer available. This allows for references to persistent program state without needing to hold a shared pointer to each object and potentially keeping that object around for longer than it needs to be. You can also "Lock" and ExecutionContextRef (which contains weak pointers) object into an ExecutionContext (which contains strong, or shared pointers) with code like ExecutionContext exe_ctx (my_obj->GetExectionContextRef().Lock()); llvm-svn: 150801
* <rdar://problem/10062621>Enrico Granata2012-02-151-9/+25
| | | | | | | | | | | | | | | | | | New public API for handling formatters: creating, deleting, modifying categories, and formatters, and managing type/formatter association. This provides SB classes for each of the main object types involved in providing formatter support: SBTypeCategory SBTypeFilter SBTypeFormat SBTypeSummary SBTypeSynthetic plus, an SBTypeNameSpecifier class that is used on the public API layer to abstract the notion that formatters can be applied to plain type-names as well as to regular expressions For naming consistency, this patch also renames a lot of formatters-related classes. Plus, the changes in how flags are handled that started with summaries is now extended to other classes as well. A new enum (lldb::eTypeOption) is meant to support this on the public side. The patch also adds several new calls to the formatter infrastructure that are used to implement by-index accessing and several other design changes required to accommodate the new API layer. An architectural change is introduced in that backing objects for formatters now become writable. On the public API layer, CoW is implemented to prevent unwanted propagation of changes. Lastly, there are some modifications in how the "default" category is constructed and managed in relation to other categories. llvm-svn: 150558
* Added support to SBType for getting template arguments from a SBType:Greg Clayton2012-02-031-1/+1
| | | | | | | | | | | | | | | | | | uint32_t SBType::GetNumberOfTemplateArguments (); lldb::SBType SBType::GetTemplateArgumentType (uint32_t idx); lldb::TemplateArgumentKind SBType::GetTemplateArgumentKind (uint32_t idx); Some lldb::TemplateArgumentKind values don't have a corresponding SBType that will be returned from SBType::GetTemplateArgumentType(). This will help our data formatters do their job by being able to find out the type of template params and do smart things with those. llvm-svn: 149658
* Added many more python convenience accessors:Greg Clayton2012-02-011-20/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now access a frame in a thread using: lldb.SBThread.frame[int] -> lldb.SBFrame object for a frame in a thread Where "int" is an integer index. You can also access a list object with all of the frames using: lldb.SBThread.frames => list() of lldb.SBFrame objects All SB objects that give out SBAddress objects have properties named "addr" lldb.SBInstructionList now has the following convenience accessors for len() and instruction access using an index: insts = lldb.frame.function.instructions for idx in range(len(insts)): print insts[idx] Instruction lists can also lookup an isntruction using a lldb.SBAddress as the key: pc_inst = lldb.frame.function.instructions[lldb.frame.addr] lldb.SBProcess now exposes: lldb.SBProcess.is_alive => BOOL Check if a process is exists and is alive lldb.SBProcess.is_running => BOOL check if a process is running (or stepping): lldb.SBProcess.is_running => BOOL check if a process is currently stopped or crashed: lldb.SBProcess.thread[int] => lldb.SBThreads for a given "int" zero based index lldb.SBProcess.threads => list() containing all lldb.SBThread objects in a process SBInstruction now exposes: lldb.SBInstruction.mnemonic => python string for instruction mnemonic lldb.SBInstruction.operands => python string for instruction operands lldb.SBInstruction.command => python string for instruction comment SBModule now exposes: lldb.SBModule.uuid => uuid.UUID(), an UUID object from the "uuid" python module lldb.SBModule.symbol[int] => lldb.Symbol, lookup symbol by zero based index lldb.SBModule.symbol[str] => list() of lldb.Symbol objects that match "str" lldb.SBModule.symbol[re] => list() of lldb.Symbol objecxts that match the regex lldb.SBModule.symbols => list() of all symbols in a module SBAddress objects can now access the current load address with the "lldb.SBAddress.load_addr" property. The current "lldb.target" will be used to try and resolve the load address. Load addresses can also be set using this accessor: addr = lldb.SBAddress() addd.load_addr = 0x123023 Then you can check the section and offset to see if the address got resolved. SBTarget now exposes: lldb.SBTarget.module[int] => lldb.SBModule from zero based module index lldb.SBTarget.module[str] => lldb.SBModule by basename or fullpath or uuid string lldb.SBTarget.module[uuid.UUID()] => lldb.SBModule whose UUID matches lldb.SBTarget.module[re] => list() of lldb.SBModule objects that match the regex lldb.SBTarget.modules => list() of all lldb.SBModule objects in the target SBSymbol now exposes: lldb.SBSymbol.name => python string for demangled symbol name lldb.SBSymbol.mangled => python string for mangled symbol name or None if there is none lldb.SBSymbol.type => lldb.eSymbolType enum value lldb.SBSymbol.addr => SBAddress object that represents the start address for this symbol (if there is one) lldb.SBSymbol.end_addr => SBAddress for the end address of the symbol (if there is one) lldb.SBSymbol.prologue_size => pythin int containing The size of the prologue in bytes lldb.SBSymbol.instructions => SBInstructionList containing all instructions for this symbol SBFunction now also has these new properties in addition to what is already has: lldb.SBFunction.addr => SBAddress object that represents the start address for this function lldb.SBFunction.end_addr => SBAddress for the end address of the function lldb.SBFunction.instructions => SBInstructionList containing all instructions for this function SBFrame now exposes the SBAddress for the frame: lldb.SBFrame.addr => SBAddress which is the section offset address for the current frame PC These are all in addition to what was already added. Documentation and website updates coming soon. llvm-svn: 149489
* This commit provides a new default summary for Objective-C boolean ↵Enrico Granata2012-01-311-0/+4
| | | | | | variables, which shows YES or NO instead of the character value. A new category named objc is added to contain this summary provider. Any future Objective-C related formatters would probably fit here llvm-svn: 149388
* Switching back to using std::tr1::shared_ptr. We originally switched awayGreg Clayton2012-01-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | due to RTTI worries since llvm and clang don't use RTTI, but I was able to switch back with no issues as far as I can tell. Once the RTTI issue wasn't an issue, we were looking for a way to properly track weak pointers to objects to solve some of the threading issues we have been running into which naturally led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared pointer from just a pointer, which is also easily solved using the std::tr1::enable_shared_from_this class. The main reason for this move back is so we can start properly having weak references to objects. Currently a lldb_private::Thread class has a refrence to its parent lldb_private::Process. This doesn't work well when we now hand out a SBThread object that contains a shared pointer to a lldb_private::Thread as this SBThread can be held onto by external clients and if they end up using one of these objects we can easily crash. So the next task is to start adopting std::tr1::weak_ptr where ever it makes sense which we can do with lldb_private::Debugger, lldb_private::Target, lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and many more objects now that they are no longer using intrusive ref counted pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive pointers). llvm-svn: 149207
* Stop running so many individual commands when going into the script interpreter.Greg Clayton2012-01-281-48/+20
| | | | | | | | | | All of the commands now get globbed into a single line. lldb.target, lldb.process, lldb.thread and lldb.frame now get initialized with empty SBTarget, SBProcess, SBThread and SBFrame objects when they don't contain anything. llvm-svn: 149166
* <rdar://problem/10750012>Greg Clayton2012-01-271-21/+4
| | | | | | | | Remove a pseudo terminal master open and slave file descriptor that was being used for pythong stdin. It was not hooked up correctly and was causing file descriptor leaks. llvm-svn: 149098
* <rdar://problem/10649734>Greg Clayton2012-01-061-4/+16
| | | | | | Fixed an issue where the python interpreter could deadlock LLDB. llvm-svn: 147640
* this patch addresses several issues with "command script" subcommands:Enrico Granata2011-11-071-9/+35
| | | | | | | | | | | | a) adds a new --synchronicity (-s) setting for "command script add" that allows the user to decide if scripted commands should run synchronously or asynchronously (which can make a difference in how events are handled) b) clears up several error messages c) adds a new --allow-reload (-r) setting for "command script import" that allows the user to reload a module even if it has already been imported before d) allows filename completion for "command script import" (much like what happens for "target create") e) prevents "command script add" from replacing built-in commands with scripted commands f) changes AddUserCommand() to take an std::string instead of a const char* (for performance reasons) plus, it fixes an issue in "type summary add" command handling which caused several test suite errors llvm-svn: 144035
* Fixed the Xcode project building of LLVM to be a bit more user friendly:Greg Clayton2011-11-041-0/+7
| | | | | | | | | | | | | | | | | | | - If you download and build the sources in the Xcode project, x86_64 builds by default using the "llvm.zip" checkpointed LLVM. - If you delete the "lldb/llvm.zip" and the "lldb/llvm" folder, and build the Xcode project will download the right LLVM sources and build them from scratch - If you have a "lldb/llvm" folder already that contains a "lldb/llvm/lib" directory, we will use the sources you have placed in the LLDB directory. Python can now be disabled for platforms that don't support it. Changed the way the libllvmclang.a files get used. They now all get built into arch specific directories and never get merged into universal binaries as this was causing issues where you would have to go and delete the file if you wanted to build an extra architecture slice. llvm-svn: 143678
* 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
* 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
* this patch introduces a new command script import command which takes as ↵Enrico Granata2011-10-171-17/+116
| | | | | | 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
* Converted the lldb_private::Process over to use the intrusiveGreg Clayton2011-09-221-8/+7
| | | | | | | | | | | | | | | | | | | | 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
* 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-201-4/+3
| | | | | | | | 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-171-0/+1
| | | | | | | | | | | | lldb_private::Breakpoint lldb_private::BreakpointLocations lldb_private::BreakpointSite lldb_private::Debugger lldb_private::StackFrame lldb_private::Thread lldb_private::Target llvm-svn: 139985
* 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-061-174/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Don't let Python write its .pyc files, that's not really polite...Jim Ingham2011-08-221-0/+1
| | | | llvm-svn: 138262
* - Support for Python namespaces:Enrico Granata2011-08-221-1/+1
| | | | | | | | | | | If you have a Python module foo, in order to use its contained objects in LLDB you do not need to use 'from foo import *'. You can use 'import foo', and then refer to items in foo as 'foo.bar', and LLDB will know how to resolve bar as a member of foo. Accordingly, GNU libstdc++ formatters have been moved from the global namespace to gnu_libstdcpp and a few test cases are also updated to reflect the new convention. Python docs suggest using a plain 'import' en lieu of 'from-import'. llvm-svn: 138244
* Fixed some SWIG interoperability issuesEnrico Granata2011-08-191-4/+5
| | | | llvm-svn: 138154
* Taking care of an issue with using lldb_private types in ↵Enrico Granata2011-08-191-2/+2
| | | | | | SBCommandInterpreter.cpp ; Making NSString test case work on Snow Leopard ; Removing an unused variable warning llvm-svn: 138105
* First round of code cleanups:Enrico Granata2011-08-171-1/+1
| | | | | | | | | | | | | | | | | | - all instances of "vobj" have been renamed to "valobj" - class Debugger::Formatting has been renamed to DataVisualization (defined in FormatManager.h/cpp) The interface to this class has not changed - FormatCategory now uses ConstString's as keys to the navigators instead of repeatedly casting from ConstString to const char* and back all the time Next step is making the same happen for categories themselves - category gnu-libstdc++ is defined in the constructor for a FormatManager The source code for it is defined in gnu_libstdcpp.py, drawn from examples/synthetic at compile time All references to previous 'osxcpp' name have been removed from both code and file names Functional changes: - the name of the option to use a summary string for 'type summary add' has changed from the previous --format-string to the new --summary-string. It is expected that the short option will change from -f to -s, and -s for --python-script will become -o llvm-svn: 137886
* New category "gnu-libstdc++" provides summary for std::string and synthetic ↵Enrico Granata2011-08-171-0/+5
| | | | | | | | | | children for types std::map, std::list and std::vector The category is enabled by default. If you run into issues with it, disable it and the previous behavior of LLDB is restored ** This is a temporary solution. The general solution to having formatters pulled in at startup should involve going through the Platform. Fixed an issue in type synthetic list where a category with synthetic providers in it was not shown if all the providers were regex-based llvm-svn: 137850
* When defining a scripted command, it is possible to provide a docstring and ↵Enrico Granata2011-08-171-2/+22
| | | | | | | | | | that will be used as the help text for the command If no docstring is provided, a default help text is created LLDB will refuse to create scripted commands if the scripting language is anything but Python Some additional comments in AppleObjCRuntimeV2.cpp to describe the memory layout expected by the dynamic type lookup code llvm-svn: 137801
* Changes to Python commands:Enrico Granata2011-08-161-3/+3
| | | | | | | | | | | | - They now have an SBCommandReturnObject instead of an SBStream as third argument - The class CommandObjectPythonFunction has been merged into CommandObjectCommands.cpp - The command to manage them is now: command script with subcommands add, list, delete, clear command alias is returned to its previous functionality - Python commands are now part of an user dictionary, instead of being seen as aliases llvm-svn: 137785
* Python commands:Enrico Granata2011-08-161-1/+140
| | | | | | | | | | | | | It is now possible to use 'command alias --python' to define a command name that actually triggers execution of a Python function (e.g. command alias --python foo foo_impl makes a command named 'foo' that runs Python function 'foo_impl') The Python function foo_impl should have as signature: def foo_impl(debugger, args, stream, dict): where debugger is an object wrapping an LLDB SBDebugger args is the command line arguments, as an unparsed Python string stream is an SBStream that represents the standard output dict is an internal utility parameter and should be left untouched The function should return None on no error, or an error string to describe any problems llvm-svn: 137722
* To silence the static analyzer.Johnny Chen2011-08-111-1/+1
| | | | llvm-svn: 137329
* Public API changes:Enrico Granata2011-07-291-3/+38
| | | | | | | | | | | | | | | | | | | | | - Completely new implementation of SBType - Various enhancements in several other classes Python synthetic children providers for std::vector<T>, std::list<T> and std::map<K,V>: - these return the actual elements into the container as the children of the container - basic template name parsing that works (hopefully) on both Clang and GCC - find them in examples/synthetic and in the test suite in functionalities/data-formatter/data-formatter-python-synth New summary string token ${svar : - the syntax is just the same as in ${var but this new token lets you read the values coming from the synthetic children provider instead of the actual children - Python providers above provide a synthetic child len that returns the number of elements into the container Full bug fix for the issue in which getting byte size for a non-complete type would crash LLDB Several other fixes, including: - inverted the order of arguments in the ClangASTType constructor - EvaluationPoint now only returns SharedPointer's to Target and Process - the help text for several type subcommands now correctly indicates argument-less options as such llvm-svn: 136504
* new flag -P to type synth add lets you type a Python class interactivelyEnrico Granata2011-07-251-0/+48
| | | | | | | | added a final newline to fooSynthProvider.py new option to automatically save user input in InputReaderEZ checking for NULL pointers in several new places llvm-svn: 135916
* Python synthetic children:Enrico Granata2011-07-241-2/+201
| | | | | | | | | | | | | | - 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
* Python summary strings:Enrico Granata2011-07-151-2/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Add 'batch_mode' to CommandInterpreter. Modify InputReaders toCaroline Tice2011-06-161-21/+35
| | | | | | | | | | 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
* 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-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Abtracted the innards of lldb-core away from the SB interface. There was someGreg Clayton2011-03-221-63/+64
| | | | | | | | | | | | | | | | overlap in the SWIG integration which has now been fixed by introducing callbacks for initializing SWIG for each language (python only right now). There was also a breakpoint command callback that called into SWIG which has been abtracted into a callback to avoid cross over as well. Added a new binary: lldb-platform This will be the start of the remote platform that will use as much of the Host functionality to do its job so it should just work on all platforms. It is pretty hollowed out for now, but soon it will implement a platform using the GDB remote packets as the transport. llvm-svn: 128053
* Minor typo fix and TAB removals.Johnny Chen2011-03-111-4/+4
| | | | llvm-svn: 127439
* Add some explanatory comments.Caroline Tice2011-03-111-0/+11
| | | | llvm-svn: 127438
* Add thread state initialization to the thread where the interactiveCaroline Tice2011-03-071-0/+7
| | | | | | | interpreter is run (which is separate from the thread where Py_Initialize is called, where this normally gets set up). llvm-svn: 127191
OpenPOWER on IntegriCloud