summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBProcess.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add a test case ProcessAPITestCase.test_remote_launch() which tests ↵Johnny Chen2011-03-051-2/+2
| | | | | | | | | | | SBProcess.RemoteLaunch() API with a process not in eStateConnected, and checks that the remote launch failed. Modify SBProcess::RemoteLaunch()/RemoteAttachToProcessWithID()'s log statements to fix a crasher when logging is turned on. llvm-svn: 127055
* Expose ConnectRemote API through SBTarget and SBProcess.James McIlree2011-03-041-0/+82
| | | | | | Patch verified by Greg Clayton prior to checkin. llvm-svn: 126974
* Add an API SBProcess::GetByteOrder() and add test cases which utilizes ↵Johnny Chen2011-03-011-0/+14
| | | | | | | | | GetByteOrder(), among other SBProcess APIs, to write (int)256 into a memory location of a global variable (int)my_int and reads/checks the variable afterwards. llvm-svn: 126792
* Made lldb_private::ArchSpec contain much more than just an architecture. ItGreg Clayton2011-02-151-1/+1
| | | | | | | | | | now, in addition to cpu type/subtype and architecture flavor, contains: - byte order (big endian, little endian) - address size in bytes - llvm::Triple for true target triple support and for more powerful plug-in selection. llvm-svn: 125602
* Fixed an issue in "SBError SBProcess::Destroy ()" where it wasn't properlyGreg Clayton2011-01-221-3/+7
| | | | | | | | | | | | | | | | | | | | checking the validity of the shared pointer prior to using it. Fixed the GDB remote plug-in to once again watch for a reply from the "k" packet, and fixed the logic to make sure the thread requesting the kill and the async thread play nice (and very quickly) by synchronizing the packet sending and reply. I also tweaked some of the shut down packet ("k" kill, "D" detach, and the halt packet) to make sure they do the right thing. Fixed "StateType Process::WaitForProcessStopPrivate (...)" to correctly pass the timeout along to WaitForStateChangedEventsPrivate() and made the function behave correctly with respect to timing out. Added separate STDIN, STDOUT, and STDERR support to debugserver. Also added the start of being able to set the working directory for the inferior process. llvm-svn: 124049
* The LLDB API (lldb::SB*) is now thread safe!Greg Clayton2010-12-201-44/+60
| | | | llvm-svn: 122262
* Fixed an issue where SBProcess::LoadImage(...) was not returning the image Greg Clayton2010-12-051-1/+1
| | | | | | token. llvm-svn: 120954
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-061-23/+23
| | | | | | | | | | | don't crash if we disable logging when some code already has a copy of the logger. Prior to this fix, logs were handed out as pointers and if they were held onto while a log got disabled, then it could cause a crash. Now all logs are handed out as shared pointers so this problem shouldn't happen anymore. We are also using our new shared pointers that put the shared pointer count and the object into the same allocation for a tad better performance. llvm-svn: 118319
* Added copy constructors and assignment operators to all lldb::SB* classesGreg Clayton2010-11-051-0/+8
| | | | | | so we don't end up with weak exports with some compilers. llvm-svn: 118312
* Added support for loading and unloading shared libraries. This was done byGreg Clayton2010-11-041-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding support into lldb_private::Process: virtual uint32_t lldb_private::Process::LoadImage (const FileSpec &image_spec, Error &error); virtual Error lldb_private::Process::UnloadImage (uint32_t image_token); There is a default implementation that should work for both linux and MacOSX. This ability has also been exported through the SBProcess API: uint32_t lldb::SBProcess::LoadImage (lldb::SBFileSpec &image_spec, lldb::SBError &error); lldb::SBError lldb::SBProcess::UnloadImage (uint32_t image_token); Modified the DynamicLoader plug-in interface to require it to be able to tell us if it is currently possible to load/unload a shared library: virtual lldb_private::Error DynamicLoader::CanLoadImage () = 0; This way the dynamic loader plug-ins are allows to veto whether we can currently load a shared library since the dynamic loader might know if it is currenlty loading/unloading shared libraries. It might also know about the current host system and know where to check to make sure runtime or malloc locks are currently being held. Modified the expression parser to have ClangUserExpression::Evaluate() be the one that causes the dynamic checkers to be loaded instead of other code that shouldn't have to worry about it. llvm-svn: 118227
* Cleaned up the API logging a lot more to reduce redundant information and Greg Clayton2010-10-311-26/+16
| | | | | | | | | keep the file size a bit smaller. Exposed SBValue::GetExpressionPath() so SBValue users can get an expression path for their values. llvm-svn: 117851
* Improved API logging.Greg Clayton2010-10-301-54/+102
| | | | llvm-svn: 117772
* Add the ability to disable individual log categories, ratherCaroline Tice2010-10-291-3/+3
| | | | | | | | | than just the entire log channel. Add checks, where appropriate, to make sure a log channel/category has not been disabled before attempting to write to it. llvm-svn: 117715
* Modified the lldb_private::TypeList to use a std::multimap for quicker lookupGreg Clayton2010-10-291-86/+50
| | | | | | | | | | by type ID (the most common type of type lookup). Changed the API logging a bit to always show the objects in the OBJECT(POINTER) format so it will be easy to locate all instances of an object or references to it when looking at logs. llvm-svn: 117641
* Clean up the API logging code:Caroline Tice2010-10-261-66/+73
| | | | | | | | | | | | | | - Try to reduce logging to one line per function call instead of tw - Put all arguments & their values into log for calls - Add 'this' parameter information to function call logging, making it show the appropriate internal pointer (this.obj, this.sp, this.ap...) - Clean up some return values - Remove logging of constructors that construct empty objects - Change '==>' to '=>' for showing result values... - Fix various minor bugs - Add some protected 'get' functions to help getting the internal pointers for the 'this' arguments... llvm-svn: 117417
* First pass at adding logging capabilities for the API functions. At the momentCaroline Tice2010-10-261-24/+218
| | | | | | | | | | | | | | | | | | it logs the function calls, their arguments and the return values. This is not complete or polished, but I am committing it now, at the request of someone who really wants to use it, even though it's not really done. It currently does not attempt to log all the functions, just the most important ones. I will be making further adjustments to the API logging code over the next few days/weeks. (Suggestions for improvements are welcome). Update the Python build scripts to re-build the swig C++ file whenever the python-extensions.swig file is modified. Correct the help for 'log enable' command (give it the correct number & type of arguments). llvm-svn: 117349
* Cleaned up the SWIG stuff so all includes happen as they should, no pullingGreg Clayton2010-10-071-2/+2
| | | | | | | | | | | | | | | | | | tricks to get types to resolve. I did this by correctly including the correct files: stdint.h and all lldb-*.h files first before including the API files. This allowed me to remove all of the hacks that were in the lldb.swig file and it also allows all of the #defines in lldb-defines.h and enumerations in lldb-enumerations.h to appear in the lldb.py module. This will make the python script code a lot more readable. Cleaned up the "process launch" command to not execute a "process continue" command, it now just does what it should have with the internal API calls instead of executing another command line command. Made the lldb_private::Process set the state to launching and attaching if WillLaunch/WillAttach return no error respectively. llvm-svn: 115902
* Added the first of hopefully many python example scripts that show how toGreg Clayton2010-10-061-1/+10
| | | | | | | | | | use the python API that is exposed through SWIG to do some cool stuff. Also fixed synchronous debugging so that all process control APIs exposed through the python API will now wait for the process to stop if you set the async mode to false (see disasm.py). llvm-svn: 115738
* Added the ability to get the disassembly instructions from the function andGreg Clayton2010-10-061-4/+10
| | | | | | symbol. llvm-svn: 115734
* Remove all the __repr__ methods from the API/*.h files, and put themCaroline Tice2010-09-221-8/+0
| | | | | | | | | | into python-extensions.swig, which gets included into lldb.swig, and adds them back into the classes when swig generates it's C++ file. This keeps the Python stuff out of the general API classes. Also fixed a small bug in the copy constructor for SBSymbolContext. llvm-svn: 114602
* Add GetDescription() and __repr__ () methods to most API classes, to allowCaroline Tice2010-09-201-0/+27
| | | | | | | "print" from inside Python to print out the objects in a more useful manner. llvm-svn: 114321
* Remove unnecessary/inappropriate output-printing functions fromCaroline Tice2010-09-151-2/+2
| | | | | | the API. llvm-svn: 113993
* Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to ↵Jim Ingham2010-08-261-9/+9
| | | | | | "Selected" i.e. GetSelectedThread. Selected makes more sense, since these are set by some user action (a selection). I didn't change "CurrentProcess" since this is always controlled by the target, and a given target can only have one process, so it really can't be selected. llvm-svn: 112221
* Very large changes that were needed in order to allow multiple connectionsGreg Clayton2010-06-231-202/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to the debugger from GUI windows. Previously there was one global debugger instance that could be accessed that had its own command interpreter and current state (current target/process/thread/frame). When a GUI debugger was attached, if it opened more than one window that each had a console window, there were issues where the last one to setup the global debugger object won and got control of the debugger. To avoid this we now create instances of the lldb_private::Debugger that each has its own state: - target list for targets the debugger instance owns - current process/thread/frame - its own command interpreter - its own input, output and error file handles to avoid conflicts - its own input reader stack So now clients should call: SBDebugger::Initialize(); // (static function) SBDebugger debugger (SBDebugger::Create()); // Use which ever file handles you wish debugger.SetErrorFileHandle (stderr, false); debugger.SetOutputFileHandle (stdout, false); debugger.SetInputFileHandle (stdin, true); // main loop SBDebugger::Terminate(); // (static function) SBDebugger::Initialize() and SBDebugger::Terminate() are ref counted to ensure nothing gets destroyed too early when multiple clients might be attached. Cleaned up the command interpreter and the CommandObject and all subclasses to take more appropriate arguments. llvm-svn: 106615
* Move Args.{cpp,h} and Options.{cpp,h} to Interpreter where they really belong.Jim Ingham2010-06-151-1/+1
| | | | llvm-svn: 106034
* And some more include line fixes.Eli Friedman2010-06-091-7/+7
| | | | llvm-svn: 105704
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+604
llvm-svn: 105619
OpenPOWER on IntegriCloud