summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
Commit message (Collapse)AuthorAgeFilesLines
* <rdar://problem/13010007>Greg Clayton2013-01-181-61/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | Added the ability for OS plug-ins to lazily populate the thread this. The python OS plug-in classes can now implement the following method: class OperatingSystemPlugin: def create_thread(self, tid, context): # Return a dictionary for a new thread to create it on demand This will add a new thread to the thread list if it doesn't already exist. The example code in lldb/examples/python/operating_system.py has been updated to show how this call us used. Cleaned up the code in PythonDataObjects.cpp/h: - renamed all classes that started with PythonData* to be Python*. - renamed PythonArray to PythonList. Cleaned up the code to use inheritance where - Centralized the code that does ref counting in the PythonObject class to a single function. - Made the "bool PythonObject::Reset(PyObject *)" function be virtual so each subclass can correctly check to ensure a PyObject is of the right type before adopting the object. - Cleaned up all APIs and added new constructors for the Python* classes to they can all construct form: - PyObject * - const PythonObject & - const lldb::ScriptInterpreterObjectSP & Cleaned up code in ScriptInterpreterPython: - Made calling python functions safer by templatizing the production of value formats. Python specifies the value formats based on built in C types (long, long long, etc), and code often uses typedefs for uint32_t, uint64_t, etc when passing arguments down to python. We will now always produce correct value formats as the templatized code will "do the right thing" all the time. - Fixed issues with the ScriptInterpreterPython::Locker where entering the session and leaving the session had a bunch of issues that could cause the "lldb" module globals lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame to not be initialized. llvm-svn: 172873
* Fix a few more clang (3.2) warnings on Linux:Daniel Malea2012-12-071-2/+2
| | | | | | | | | | | | | | | | | - 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
* Take the Target API lock before letting the Python code start to work ↵Jim Ingham2012-12-071-0/+12
| | | | | | | | constructing threads, otherwise we will risk a lock-inversion deadlock between the thread list and the API mutex. <rdar://problem/12554049> llvm-svn: 169612
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+3
| | | | | | | | | - 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
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-291-4/+4
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Allow operating system plug-ins to specify the address for registers so we ↵Greg Clayton2012-10-251-21/+37
| | | | | | don't have to create data up front. llvm-svn: 166701
* Added process and thread logging the python OperatingSystem plug-in.Greg Clayton2012-10-241-1/+17
| | | | llvm-svn: 166608
* <rdar://problem/12491420>Greg Clayton2012-10-181-13/+32
| | | | | | | | | | 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
* Change the Thread constructor over to take a Process& rather than a ↵Jim Ingham2012-10-101-1/+1
| | | | | | | | | | | | | ProcessSP. We can't create Threads with a NULL ProcessSP, so it makes no sense to use the SP. Then make the Thread a Broadcaster, and get it to broadcast when the selected frame is changed (but only from the Command Line) and when Thread::ReturnFromFrame changes the stack. Made the Driver use this notification to print the new thread status rather than doing it in the command. Fixed a few places where people were setting their broadcaster class by hand rather than using the static broadcaster class call. <rdar://problem/12383087> llvm-svn: 165640
* Fixes by Daniel Malea.Filipe Cabecinhas2012-08-281-2/+2
| | | | llvm-svn: 162756
* Remove printf that go left in the code.Greg Clayton2012-08-241-1/+0
| | | | llvm-svn: 162542
* The OS plug-in can now get data from a python script that implements the ↵Greg Clayton2012-08-241-36/+66
| | | | | | protocol. llvm-svn: 162540
* We have a partially working OS plug-in through python!Greg Clayton2012-08-241-4/+4
| | | | llvm-svn: 162532
* Added Args::StringForEncoding(), Args::StringToGenericRegister() and ↵Greg Clayton2012-08-241-69/+20
| | | | | | | | centralized the parsing of the string to encoding and string to generic register. Added code the initialize the register context in the OperatingSystemPython plug-in with the new PythonData classes, and added a test OperatingSystemPython module in lldb/examples/python/operating_system.py that we can use for testing. llvm-svn: 162530
* Fixing a bunch of issues with the OS plugin codeEnrico Granata2012-08-241-1/+1
| | | | llvm-svn: 162527
* Hooking up two more calls for the PythonOSPlugin stuff. The part of code to ↵Enrico Granata2012-08-241-4/+24
| | | | | | fetch the data and convert it to C++ objects is still missing, but will come llvm-svn: 162522
* Was forcing everyone on ToT to use the PythonOSPlugin.. my badEnrico Granata2012-08-241-1/+1
| | | | llvm-svn: 162519
* Adding bindings to the Script Interpreter for some basic Python OS plugin ↵Enrico Granata2012-08-241-11/+30
| | | | | | functionality (still WIP) llvm-svn: 162513
* Added a hollowed out version of an OperatingSystem plugin that will use a ↵Greg Clayton2012-08-231-0/+234
class in python to get thread information for threads stored in memory. llvm-svn: 162472
OpenPOWER on IntegriCloud