summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python/operating_system.py
Commit message (Collapse)AuthorAgeFilesLines
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-45/+172
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Remove a print statement that was left in accidentally.Greg Clayton2013-04-241-1/+0
| | | | llvm-svn: 180223
* <rdar://problem/13069948>Greg Clayton2013-01-251-1/+2
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* <rdar://problem/13010007>Greg Clayton2013-01-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Updated documentation on the "register_data_addr" key that can be supplied ↵Greg Clayton2013-01-091-0/+5
| | | | | | in the "thread" dictionary return value for the python OS plug-ins. llvm-svn: 171934
* Allow operating system plug-ins to specify the address for registers so we ↵Greg Clayton2012-10-251-1/+1
| | | | | | don't have to create data up front. llvm-svn: 166701
* <rdar://problem/12491420>Greg Clayton2012-10-181-1/+1
| | | | | | | | | | 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
* Added some documentation and an accessor for the target with an explanation ↵Greg Clayton2012-09-121-1/+21
| | | | | | of why to not use "lldb.target". llvm-svn: 163671
* The OS plug-in can now get data from a python script that implements the ↵Greg Clayton2012-08-241-3/+4
| | | | | | protocol. llvm-svn: 162540
* We have a partially working OS plug-in through python!Greg Clayton2012-08-241-6/+8
| | | | llvm-svn: 162532
* Fixing an issue in the OS sampleEnrico Granata2012-08-241-0/+1
| | | | llvm-svn: 162531
* Added Args::StringForEncoding(), Args::StringToGenericRegister() and ↵Greg Clayton2012-08-241-0/+63
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
OpenPOWER on IntegriCloud