summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/OperatingSystem
Commit message (Collapse)AuthorAgeFilesLines
* <rdar://problem/13010007>Greg Clayton2013-01-182-63/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-254-24/+42
| | | | | | don't have to create data up front. llvm-svn: 166701
* Changed the V1 and V2 runtimes to be able to detect when the ISA hash table ↵Greg Clayton2012-10-251-4/+0
| | | | | | has changed, and auto update as needed. llvm-svn: 166693
* Added process and thread logging the python OperatingSystem plug-in.Greg Clayton2012-10-241-1/+17
| | | | llvm-svn: 166608
* <rdar://problem/12491387>Greg Clayton2012-10-191-1/+1
| | | | | | | | | | Added commands to the KDP plug-in that allow sending raw commands through the KDP protocol. You specify a command byte and a payload as ASCII hex bytes, and the packet is created with a valid header/sequenceID/length and sent. The command responds with a raw ASCII hex string that contains all bytes in the reply including the header. An example of sending a read register packet for the GPR on x86_64: (lldb) process plugin packet send --command 0x07 --payload 0100000004000000 llvm-svn: 166346
* Rename "macosx-kernel" to "darwin-kernel" to match the filenames before ↵Greg Clayton2012-10-191-1/+1
| | | | | | anyone starts using the settings for this plug-in. llvm-svn: 166295
* <rdar://problem/12491420>Greg Clayton2012-10-182-14/+38
| | | | | | | | | | 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-102-2/+2
| | | | | | | | | | | | | 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-242-11/+33
| | | | | | functionality (still WIP) llvm-svn: 162513
* Fix a typo.Johnny Chen2012-08-241-1/+1
| | | | llvm-svn: 162510
* Added a hollowed out version of an OperatingSystem plugin that will use a ↵Greg Clayton2012-08-233-0/+337
| | | | | | class in python to get thread information for threads stored in memory. llvm-svn: 162472
* Fix comment typeo.Jason Molenda2012-05-161-1/+1
| | | | llvm-svn: 156884
* <rdar://problem/11358639>Greg Clayton2012-05-081-1/+1
| | | | | | | | Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples. Also make the selection process for auto selecting platforms based off of an arch much better. llvm-svn: 156354
* Trying to solve our disappearing thread issues by making thread list updates ↵Greg Clayton2012-04-102-3/+3
| | | | | | | | | | | | | | | | safer. The current ProcessGDBRemote function that updates the threads could end up with an empty list if any other thread had the sequence mutex. We now don't clear the thread list when we can't access it, and we also have changed how lldb_private::Process handles the return code from the: virtual bool Process::UpdateThreadList (lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list) = 0; A bool is now returned to indicate if the list was actually updated or not and the lldb_private::Process class will only update the stop ID of the validity of the thread list if "true" is returned. The ProcessGDBRemote also got an extra assertion that will hopefully assert when running debug builds so we can find the source of this issue. llvm-svn: 154365
* Thread hardening part 3. Now lldb_private::Thread objects have std::weak_ptrGreg Clayton2012-02-211-1/+1
| | | | | | | | | | | | | | | | | 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
* Improved detection of object file types, movingSean Callanan2012-02-101-7/+2
| | | | | | | | | | detection of kernels into the object file and adding a new category for raw binary images. Fixed all clients who previously searched for sections manually, making them use the object file's facilities instead. llvm-svn: 150272
* build: Add the Darwin-Kernel Makefile.Daniel Dunbar2011-10-311-0/+14
| | | | llvm-svn: 143398
* Added ClangNamespaceDecl * parameters to severalSean Callanan2011-10-121-1/+3
| | | | | | | core Module functions that the expression parser will soon be using. llvm-svn: 141766
* Fix preprocessor warnings for no newline at the end of the source files.Greg Clayton2011-10-121-1/+1
| | | | llvm-svn: 141755
* Redesign of the interaction between Python and frozen objects:Enrico Granata2011-09-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Finishing the renaming from "MacOSX-Kernel" to "Darwin-Kernel".Greg Clayton2011-08-222-27/+27
| | | | llvm-svn: 138283
* Renaming "MacOSX-Kernel" to "Darwin-Kernel". The file contents and projectGreg Clayton2011-08-222-0/+0
| | | | | | commit will come shortly after this commit. llvm-svn: 138282
* Added a new plug-in type: lldb_private::OperatingSystem. The operating system Greg Clayton2011-08-222-0/+399
plug-ins are add on plug-ins for the lldb_private::Process class that can add thread contexts that are read from memory. It is common in kernels to have a lot of threads that are not currently executing on any cores (JTAG debugging also follows this sort of thing) and are context switched out whose state is stored in memory data structures. Clients can now subclass the OperatingSystem plug-ins and then make sure their Create functions correcltly only enable themselves when the right binary/target triple are being debugged. The operating system plug-ins get a chance to attach themselves to processes just after launching or attaching and are given a lldb_private::Process object pointer which can be inspected to see if the main executable, target triple, or any shared libraries match a case where the OS plug-in should be used. Currently the OS plug-ins can create new threads, define the register contexts for these threads (which can all be different if desired), and populate and manage the thread info (stop reason, registers in the register context) as the debug session goes on. llvm-svn: 138228
OpenPOWER on IntegriCloud