History log of /external/lldb/source/API/SBProcess.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
151416f6288315ef6d6061f60154db21798180a9 29-Jun-2013 Greg Clayton <gclayton@apple.com> Fixed SBProcess::RemoteLaunch() to use the platform executable path. Patch from Sebastien Metrot.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
0e191607adcb0ea8ebd06c278be648a7f5c0097f 10-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13854277>
<rdar://problem/13594769>

Main changes in this patch include:
- cleanup plug-in interface and use ConstStrings for plug-in names
- Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp
- Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging

The plug-in interface changes:

Modified the lldb_private::PluginInterface class that all plug-ins inherit from:

Changed:

virtual const char * GetPluginName() = 0;

To:

virtual ConstString GetPluginName() = 0;

Removed:

virtual const char * GetShortPluginName() = 0;

- Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names.
- Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc.






git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
761afb822b18c46b2ad84be03f372e90ac1e6143 02-May-2013 Jim Ingham <jingham@apple.com> Recommitting r180831 with trivial fix - remember to return errors if you compute.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
411ab47806a478d932926ef7a309ea37edf1f7e7 01-May-2013 Daniel Malea <daniel.malea@intel.com> Reverting 180831 as it crashes TestDefaultConstructorForAPIObjects.py



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
b4e08abf4972befc8412bc83a0205fbdc547290e 01-May-2013 Jim Ingham <jingham@apple.com> Added an option to "process detach" to keep the process stopped, if the process plugin (or in the
case of ProcessGDBRemote the stub we are talking to) know how to do that.

rdar://problem/13680832


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
952e9dc874944fcdbbb224f3ec4fc2c859376f64 28-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13521159>

LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.

All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
89e248f04ecb87d0df4a4b96158c3fac0a3e43c7 09-Feb-2013 Jim Ingham <jingham@apple.com> Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction interoperate to fix problems where
hitting auto-continue signals while running a thread plan would cause us to lose control of the debug
session.

<rdar://problem/12993641>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
52ebc0aab1fdecb634801deceeddd71a14c2148c 19-Jan-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13010007>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
64742744396c966e8de770e765130629b0c78335 16-Jan-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13009943>

Added a unique integer identifier to processes. Some systems, like JTAG or other simulators, might always assign the same process ID (pid) to the processes that are being debugged. In order for scripts and the APIs to uniquely identify the processes, there needs to be another ID. Now the SBProcess class has:

uint32_t SBProcess::GetUniqueID();

This integer ID will help to truly uniquely identify a process and help with appropriate caching that can be associated with a SBProcess object.





git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
0e3b98e7de6d69613a9729bac9d4b965c0635698 09-Jan-2013 Jim Ingham <jingham@apple.com> Add an SBProcess API to get the current StopID, either considering or ignoring stops caused by expression
evaluation.

<rdar://problem/12968562>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@171914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
d891f9b872103235cfd2ed452c6f14a4394d9b3a 05-Dec-2012 Daniel Malea <daniel.malea@intel.com> Fix Linux build warnings due to redefinition of macros:
- 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!




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
5f35a4be95aed0e5b2cb36f7d785bcbfc67284ae 29-Nov-2012 Daniel Malea <daniel.malea@intel.com> Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types

Patch from Matt Kopec!



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
fb9cee64303d36d6fe5d87e63dd8701d1ddb70a9 17-Nov-2012 Han Ming Ong <hanming@apple.com> <rdar://problem/12720514> Sub-TLF: Provide service to profile the inferior

This allows client to query profiling states on the inferior.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
1e4d8f06d77559e13844d116515412520b4713cc 31-Oct-2012 Sean Callanan <scallanan@apple.com> Rmoved a duplicate version of SetSelectedThreadByID
that confused external clients.

<rdar://problem/12599528>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
fee26ee9a5db37e71f5d5aed279c634bbdab7c8c 26-Oct-2012 Jim Ingham <jingham@apple.com> Add API to get the process plugin name & short name.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@166799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
82560f25ae1b4a55c927df9ccf1bd1becc01b1c1 13-Oct-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12490558>

SBProcess::SetSelectedThreadByID() had a "uint32_t tid" parameter which would truncate 64 bit thread IDs (lldb::tid_t is 64 bit).


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
bf41e19c78f0c84671d21eadec3954ab6db550c1 05-Oct-2012 Jason Molenda <jmolenda@apple.com> Ran the sources through the compiler with -Wshadow warnings
enabled after we'd found a few bugs that were caused by shadowed
local variables; the most important issue this turned up was
a common mistake of trying to obtain a mutex lock for the scope
of a code block by doing

Mutex::Locker(m_map_mutex);

This doesn't assign the lock object to a local variable; it is
a temporary that has its dtor called immediately. Instead,

Mutex::Locker locker(m_map_mutex);

does what is intended. For some reason -Wshadow happened to
highlight these as shadowed variables.

I also fixed a few obivous and easy shadowed variable issues
across the code base but there are a couple dozen more that
should be fixed when someone has a free minute.
<rdar://problem/12437585>




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
851e30ec6a1b1d2c154bb7d69ed0d05b5fd14705 18-Sep-2012 Greg Clayton <gclayton@apple.com> Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. Some platforms don't support this modification.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@164148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
49ce8969d3154e1560106cfe530444c09410f217 29-Aug-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11757916>

Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file".
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()

Cleaned up header includes a bit as well.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
d0bdddff8bc6dd5f71492452ce2bbd72fdaa147b 22-Aug-2012 Jim Ingham <jingham@apple.com> Rework how the API mutex is acquired when filling out an ExecutionContext from an ExecutionContextRef,
particularly in the SBThread & SBFrame interfaces. Instead of filling the whole context & then getting
the API mutex, we now get only the target, acquire the API mutex from it, then fill out the rest of the
context. This removes a race condition where you get a ThreadSP, then wait on the API mutex while another
command Destroy's the Thread you've just gotten.
Also fixed the ExecutionContextRef::Get*SP calls so they don't return invalid objects.
Also fixed the ExecutionContext::Has*Scope calls so they don't claim to have a scope if the object representing
that scope has been destroyed.
Also fixed a think-o in Thread::IsValid which was causing it to return the opposite of the desired value.

<rdar://problem/11995490>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
5d90ade8e8e0d776fe8e1b9e88fc1c86d02e8e4e 28-Jul-2012 Jim Ingham <jingham@apple.com> Added an lldb_private & equivalent SB API to send an AsyncInterrupt to the event loop.
Convert from calling Halt in the lldb Driver.cpp's input reader's sigint handler to sending this AsyncInterrupt so it can be handled in the
event loop.
If you are attaching and get an async interrupt, abort the attach attempt.
Also remember to destroy the process if get interrupted while attaching.
Getting this to work also required handing the eBroadcastBitInterrupt in a few more places in Process WaitForEvent & friends.

<rdar://problem/10792425>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
efbdd2280873cc87634bf4f4a37ab8b99662522a 13-Jul-2012 Jim Ingham <jingham@apple.com> Add accessors on process to get & set the selected thread by IndexID (useful since that's the one that "thread list" shows and it won't get reused even if the underlying system thread ID gets reused.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
bcaf99a74367d464dd38011e26b9b4be56b503ba 12-Jul-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11791234>

Fixed a case where the python interpreter could end up holding onto a previous lldb::SBProcess (probably in lldb.process) when run under Xcode. Prior to this fix, the lldb::SBProcess held onto a shared pointer to a lldb_private::Process. This in turn could cause the process to still have a thread list with stack frames. The stack frames would have module shared pointers in the lldb_private::SymbolContext objects.

We also had issues with things staying in the shared module list too long when we found things by UUID (we didn't remove the out of date ModuleSP from the global module cache).

Now all of this is fixed and everything goes away between runs.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
191343e7213d3d717327319352d086f981fa8e58 24-May-2012 Johnny Chen <johnny.chen@apple.com> Add SBProcess::GetNumSupportedHardwareWatchpoints() API and export it through the Python scripting bridge.
Add/modify some test cases.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
9f3c98e1cfdb463848cb13d03312fab8a5ec7f0d 06-Apr-2012 Greg Clayton <gclayton@apple.com> Added logging when API calls try to do something that shouldn't be done when the process is stopped by having logging calls that end with "error: process is running".

Also test for the process to be stopped when many SBValue API calls are made to make sure it is safe to evaluate values, children of values and much more.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
a894fe78bc15344a0025c1154e414c554ab31dd9 05-Apr-2012 Greg Clayton <gclayton@apple.com> Added a new Host class: ReadWriteLock

This abstracts read/write locks on the current host system. It is currently backed by pthread_rwlock_t objects so it should work on all unix systems.

We also need a way to control multi-threaded access to the process through the public API when it is running. For example it isn't a good idea to try and get stack frames while the process is running. To implement this, the lldb_private::Process class now contains a ReadWriteLock member variable named m_run_lock which is used to control the public process state. The public process state represents the state of the process as the client knows it. The private is used to control the actual current process state. So the public state of the process can be stopped, yet the private state can be running when evaluating an expression for example.

Adding the read/write lock where readers are clients that want the process to stay stopped, and writers are clients that run the process, allows us to accurately control multi-threaded access to the process.

Switched the SBThread and SBFrame over to us shared pointers to the ExecutionContextRef class instead of making their own class to track this. This fixed an issue with assigning on SBFrame to another and will also centralize the code that tracks weak references to execution context objects into one location.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
0a8dcacde404c520f1131c641041dceb9f68b6fa 24-Feb-2012 Greg Clayton <gclayton@apple.com> Added the new way we will eventually do all attaches and launches. First clients
will fill out either a SBLaunchInfo or SBAttachInfo class, then call:

SBProcess SBTarget::Launch (SBLaunchInfo &, SBError &);
SBProcess SBTarget::Attach (SBAttachInfo &, SBError &);

The attach is working right now and allows the ability to set many filters such
as the parent process ID, the user/group ID, the effective user/group ID, and much
more.

The launch is not yet working, but I will get this working soon. By changing our
launch and attach calls to take an object, it allows us to add more capabilities to
launching and attaching without having to have launch and attach functions that
take more and more arguments.

Once this is all working we will deprecated the older launch and attach fucntions
and eventually remove them.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
5a15e6927b5b3234fb3e688717297ba6b5dd6ad7 16-Feb-2012 Jim Ingham <jingham@apple.com> Add a general mechanism to wait on the debugger for Broadcasters of a given class/event bit set.
Use this to allow the lldb Driver to emit notifications for breakpoint modifications.
<rdar://problem/10619974>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
28e23861bedbeb5e46be7d2af4c33bf5132422c6 08-Feb-2012 Jim Ingham <jingham@apple.com> Send Breakpoint Changed events for all the relevant changes to breakpoints.
Also, provide and use accessors for the thread options on breakpoints so we
can control sending the appropriate events.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
0416bdf783a7dc2544b9ab034e225391f8f47343 30-Jan-2012 Greg Clayton <gclayton@apple.com> lldb::SBTarget and lldb::SBProcess are now thread hardened. They both still
contain shared pointers to the lldb_private::Target and lldb_private::Process
objects respectively as we won't want the target or process just going away.

Also cleaned up the lldb::SBModule to remove dangerous pointer accessors.

For any code the public API files, we should always be grabbing shared
pointers to any objects for the current class, and any other classes prior
to running code with them.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
334d33a19fd28cf41cba74cc61cf149e7101a603 30-Jan-2012 Greg Clayton <gclayton@apple.com> SBFrame is now threadsafe using some extra tricks. One issue is that stack
frames might go away (the object itself, not the actual logical frame) when
we are single stepping due to the way we currently sometimes end up flushing
frames when stepping in/out/over. They later will come back to life
represented by another object yet they have the same StackID. Now when you get
a lldb::SBFrame object, it will track the frame it is initialized with until
the thread goes away or the StackID no longer exists in the stack for the
thread it was created on. It uses a weak_ptr to both the frame and thread and
also stores the StackID. These three items allow us to determine when the
stack frame object has gone away (the weak_ptr will be NULL) and allows us to
find the correct frame again. In our test suite we had such cases where we
were just getting lucky when something like this happened:

1 - stop at breakpoint
2 - get first frame in thread where we stopped
3 - run an expression that causes the program to JIT and run code
4 - run more expressions on the frame from step 2 which was very very luckily
still around inside a shared pointer, yet, not part of the current
thread (a new stack frame object had appeared with the same stack ID and
depth).

We now avoid all such issues and properly keep up to date, or we start
returning errors when the frame doesn't exist and always responds with
invalid answers.

Also fixed the UserSettingsController (not going to rewrite this just yet)
so that it doesn't crash on shutdown. Using weak_ptr's came in real handy to
track when the master controller has already gone away and this allowed me to
pull out the previous NotifyOwnerIsShuttingDown() patch as it is no longer
needed.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
90c5214bc61ee2cdf68236b36d9746ecd275302e 30-Jan-2012 Greg Clayton <gclayton@apple.com> Removed the "lldb-forward-rtti.h" header file as it was designed to contain
all RTTI types, and since we don't use RTTI anymore since clang and llvm don't
we don't really need this header file. All shared pointer definitions have
been moved into "lldb-forward.h".

Defined std::tr1::weak_ptr definitions for all of the types that inherit from
enable_shared_from_this() in "lldb-forward.h" in preparation for thread
hardening our public API.

The first in the thread hardening check-ins. First we start with SBThread.
We have issues in our lldb::SB API right now where if you have one object
that is being used by two threads we have a race condition. Consider the
following code:

1 int
2 SBThread::SomeFunction()
3 {
4 int result = -1;
5 if (m_opaque_sp)
6 {
7 result = m_opaque_sp->DoSomething();
8 }
9 return result;
10 }

And now this happens:

Thread 1 enters any SBThread function and checks its m_opaque_sp and is about
to execute the code on line 7 but hasn't yet
Thread 2 gets to run and class sb_thread.Clear() which calls m_opaque_sp.clear()
and clears the contents of the shared pointer member
Thread 1 now crashes when it resumes.

The solution is to use std::tr1::weak_ptr. Now the SBThread class contains a
lldb::ThreadWP (weak pointer to our lldb_private::Thread class) and this
function would look like:

1 int
2 SBThread::SomeFunction()
3 {
4 int result = -1;
5 ThreadSP thread_sp(m_opaque_wp.lock());
6 if (thread_sp)
7 {
8 result = m_opaque_sp->DoSomething();
9 }
10 return result;
11 }

Now we have a solid thread safe API where we get a local copy of our thread
shared pointer from our weak_ptr and then we are guaranteed it can't go away
during our function.

So lldb::SBThread has been thread hardened, more checkins to follow shortly.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
13d24fb1817faa7ccc4cfd799113ba1a2b8968eb 29-Jan-2012 Greg Clayton <gclayton@apple.com> Switching back to using std::tr1::shared_ptr. We originally switched away
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).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
a6b7e323caa2bbd1b2835dcce775340b27c13bf3 07-Jan-2012 Greg Clayton <gclayton@apple.com> Patch from Enrico Granata that moves SBData related functions into the SBData
class instead of requiring a live process in order to be able to create useful
SBData objects.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
9f074f0e030a74a3efd716a476b436f2d32bdf74 06-Jan-2012 Johnny Chen <johnny.chen@apple.com> http://llvm.org/bugs/show_bug.cgi?id=11619
Allow creating SBData values from arrays or primitives in Python

Patch submitted by Enrico Granata.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
4a2e33769873d68d5703da5742c0e248f46e3a72 15-Dec-2011 Greg Clayton <gclayton@apple.com> Expose new read memory fucntion through python in SBProcess:

size_t
SBProcess::ReadCStringFromMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error);

uint64_t
SBProcess::ReadUnsignedFromMemory (addr_t addr, uint32_t byte_size, lldb::SBError &error);

lldb::addr_t
SBProcess::ReadPointerFromMemory (addr_t addr, lldb::SBError &error);

These ReadCStringFromMemory() has some SWIG type magic that makes it return the
python string directly and the "buf" is not needed:

error = SBError()
max_cstr_len = 256
cstr = lldb.process.ReadCStringFromMemory (0x1000, max_cstr_len, error)
if error.Success():
....

The other two functions behave as expteced. This will make it easier to get integer values
from the inferior process that are correctly byte swapped. Also for pointers, the correct
pointer byte size will be used.

Also cleaned up a few printf style warnings for the 32 bit lldb build on darwin.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
bae39c554644de9f319f59c25a76ad64bd266f84 03-Dec-2011 Greg Clayton <gclayton@apple.com> Fixed some extra warnings that show up with the new clang.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
d9919d3f46c5069eef065a27f96abc021330d5f3 02-Dec-2011 Greg Clayton <gclayton@apple.com> Process IDs (lldb::pid_t) and thread IDs (lldb::tid_t) are now 64 bit. This
will allow us to represent a process/thread ID using a pointer for the OS
plug-ins where they might want to represent the process or thread ID using
the address of the process or thread structure.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
527154d8e532f27f25af226c9e1dac607c48b5d1 15-Nov-2011 Greg Clayton <gclayton@apple.com> Added a new class to Process.h: ProcessAttachInfo. This class contains enough
info for us to attach by pid, or by name and will also allow us to eventually
do a lot more powerful attaches. If you look at the options for the "platform
process list" command, there are many options which we should be able to
specify. This will allow us to do things like "attach to a process named 'tcsh'
that has a parent process ID of 123", or "attach to a process named 'x' which
has an effective user ID of 345".

I finished up the --shell implementation so that it can be used without the
--tty option in "process launch". The "--shell" option now can take an
optional argument which is the path to the shell to use (or a partial name
like "sh" which we will find using the current PATH environment variable).

Modified the Process::Attach to use the new ProcessAttachInfo as the sole
argument and centralized a lot of code that was in the "process attach"
Execute function so that everyone can take advantage of the powerful new
attach functionality.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
96154be69fa240a662419183ed08e1cfc5418164 13-Nov-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10126482>

Fixed an issues with the SBType and SBTypeMember classes:
- Fixed SBType to be able to dump itself from python
- Fixed SBType::GetNumberOfFields() to return the correct value for objective C interfaces
- Fixed SBTypeMember to be able to dump itself from python
- Fixed the SBTypeMember ability to get a field offset in bytes (the value
being returned was wrong)
- Added the SBTypeMember ability to get a field offset in bits


Cleaned up a lot of the Stream usage in the SB API files.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144493 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
2d9adb73af7520bec430e0585ca40467828e6ed1 12-Nov-2011 Greg Clayton <gclayton@apple.com> Added the ability to run a process in a shell on MacOSX currently when using
the --tty option. So you can now get shell expansion and file redirection:

(lldb) process launch --tty --shell -- *.jpg < in.txt > out.txt

Again, the "--tty" is mandatory for now until we hook this up to other
functions. The shell is also currently hard coded to "/bin/bash" and not the
"SHELL" variable. "/bin/tcsh" was causing problems which I need to dig into.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
36bc5ea5a48c19421d44f559e2165c105657b809 03-Nov-2011 Greg Clayton <gclayton@apple.com> Modified all Process::Launch() calls to use a ProcessLaunchInfo structure
on internal only (public API hasn't changed) to simplify the paramter list
to the launch calls down into just one argument. Also all of the argument,
envronment and stdio things are now handled in a much more centralized fashion.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
444e35b5fdf15a25a427285650f06f1390e62c75 19-Oct-2011 Greg Clayton <gclayton@apple.com> Moved lldb::user_id_t values to be 64 bit. This was going to be needed for
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
7e5fa7fc1f8efd24c078e063b2c4b5e13ba5be20 20-Sep-2011 Jason Molenda <jmolenda@apple.com> Update declarations for all functions/methods that accept printf-style
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
5beb99d65c72cd4a4f7529c4ff8cc04a1a40769d 11-Aug-2011 Greg Clayton <gclayton@apple.com> Added the ability to remove orphaned module shared pointers from a ModuleList.
This is helping us track down some extra references to ModuleSP objects that
are causing things to get kept around for too long.

Added a module pointer accessor to target and change a lot of code to use
it where it would be more efficient.

"taret delete" can now specify "--clean=1" which will cleanup the global module
list for any orphaned module in the shared module cache which can save memory
and also help track down module reference leaks like we have now.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
de1dd81e18b0310501f3b76ae41f04a09f4dd474 24-Jun-2011 Greg Clayton <gclayton@apple.com> Fixed SBTarget attach calls to properly deal with being connected to a remotely
connected process connection.

Also added support for more kinds of continue packet when multiple threads
need to continue where some want to continue with signals.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
42da4dae5d7dccf98a57399d4689150b928ab545 05-Mar-2011 Johnny Chen <johnny.chen@apple.com> Add a test case ProcessAPITestCase.test_remote_launch() which tests 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
3809340ce8954dbeaf24907ece29cd6b179143ea 04-Mar-2011 James McIlree <jmcilree@apple.com> Expose ConnectRemote API through SBTarget and SBProcess.
Patch verified by Greg Clayton prior to checkin.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
60a544f23362d4f2fbe1e68b9c5340aa5e11302c 01-Mar-2011 Johnny Chen <johnny.chen@apple.com> Add an API SBProcess::GetByteOrder() and add test cases which utilizes 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
395fc33dc4b06c048ed35047ec461bc092ef2df3 15-Feb-2011 Greg Clayton <gclayton@apple.com> Made lldb_private::ArchSpec contain much more than just an architecture. It
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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
72e1c782ba1e4226da37af4722af608de9f39408 23-Jan-2011 Greg Clayton <gclayton@apple.com> Fixed an issue in "SBError SBProcess::Destroy ()" where it wasn't properly
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
bdcda468276dc9ab6bf648fc8cc07f3faad91526 20-Dec-2010 Greg Clayton <gclayton@apple.com> The LLDB API (lldb::SB*) is now thread safe!



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@122262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
0e0fd1c48fc313ce3fc582fe00c268ea020b73f4 05-Dec-2010 Greg Clayton <gclayton@apple.com> Fixed an issue where SBProcess::LoadImage(...) was not returning the image
token.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120954 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
e005f2ce03c489ebde9110678a29cbfe8488d5b4 06-Nov-2010 Greg Clayton <gclayton@apple.com> Modified all logging calls to hand out shared pointers to make sure we
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
538eb82a89a68dbc57251915080bd5152b333978 06-Nov-2010 Greg Clayton <gclayton@apple.com> Added copy constructors and assignment operators to all lldb::SB* classes
so we don't end up with weak exports with some compilers.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
0baa394cd55c6dfb7a6259d215d0dea2b708067b 04-Nov-2010 Greg Clayton <gclayton@apple.com> Added support for loading and unloading shared libraries. This was done by
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.






git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
49ce682dfa7993d31206cea19ce7006cd3f3077e 31-Oct-2010 Greg Clayton <gclayton@apple.com> Cleaned up the API logging a lot more to reduce redundant information and
keep the file size a bit smaller.

Exposed SBValue::GetExpressionPath() so SBValue users can get an expression
path for their values.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
a66ba46379fe41036d870975c56ccc2319cb6618 30-Oct-2010 Greg Clayton <gclayton@apple.com> Improved API logging.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
926060e198137f8a64face70455324a8cd4362a5 29-Oct-2010 Caroline Tice <ctice@apple.com> Add the ability to disable individual log categories, rather
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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
3f5ee7fd6991891f0892bd71537763d9b59acd12 29-Oct-2010 Greg Clayton <gclayton@apple.com> Modified the lldb_private::TypeList to use a std::multimap for quicker lookup
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
61ba7ec20f616f907473dd501341cef5b47fa3f8 27-Oct-2010 Caroline Tice <ctice@apple.com> Clean up the API logging code:
- 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...



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
7826c8894803dc729f29789ebc038956a94d3e7a 26-Oct-2010 Caroline Tice <ctice@apple.com> First pass at adding logging capabilities for the API functions. At the moment
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).




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
d8c625380b56759fc3fef8b9cf0389ae1a07f44d 07-Oct-2010 Greg Clayton <gclayton@apple.com> Cleaned up the SWIG stuff so all includes happen as they should, no pulling
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
1a3083a04c20cc8e7298e03b731cab5d09aa7bad 06-Oct-2010 Greg Clayton <gclayton@apple.com> Added the first of hopefully many python example scripts that show how to
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).



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
5c4c746a3a83c1aad411c6cdc5f9525a4fc2d17e 06-Oct-2010 Greg Clayton <gclayton@apple.com> Added the ability to get the disassembly instructions from the function and
symbol.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
e49ec18f1868168c8927ae30a379db176ca8cce3 23-Sep-2010 Caroline Tice <ctice@apple.com> Remove all the __repr__ methods from the API/*.h files, and put them
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
98f930f429160f9777f626c3ac6aa609f4e965d2 20-Sep-2010 Caroline Tice <ctice@apple.com> Add GetDescription() and __repr__ () methods to most API classes, to allow
"print" from inside Python to print out the objects in a more useful
manner.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
dfc91c368886f961b5cac95efc9adfe9be05cf73 15-Sep-2010 Caroline Tice <ctice@apple.com> Remove unnecessary/inappropriate output-printing functions from
the API.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
c833295baeec641086f536e78050388af36784f8 26-Aug-2010 Jim Ingham <jingham@apple.com> Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to "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.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
63094e0bb161580564954dee512955c1c79d3476 23-Jun-2010 Greg Clayton <gclayton@apple.com> Very large changes that were needed in order to allow multiple connections
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
84cdc15005983e5244d665fa779e33c2b6fac95f 15-Jun-2010 Jim Ingham <jingham@apple.com> Move Args.{cpp,h} and Options.{cpp,h} to Interpreter where they really belong.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
7a62c8b129b7e1b5e838b7616a794e01df01818b 09-Jun-2010 Eli Friedman <eli.friedman@gmail.com> And some more include line fixes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp
24943d2ee8bfaa7cf5893e4709143924157a5c1e 08-Jun-2010 Chris Lattner <sabre@nondot.org> Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/API/SBProcess.cpp