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
diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index 860dae7..9aac03e 100644
--- a/source/API/SBTarget.cpp
+++ b/source/API/SBTarget.cpp
@@ -119,21 +119,6 @@
}
-// SBProcess
-// SBTarget::LaunchProcess
-// (
-// char const **argv,
-// char const **envp,
-// const char *tty,
-// uint32_t launch_flags,
-// bool stop_at_entry
-// )
-// {
-// SBError sb_error;
-// return LaunchProcess (argv, envp, tty, launch_flags, stop_at_entry, sb_error);
-// }
-
-
SBProcess
SBTarget::LaunchProcess
(
@@ -141,6 +126,20 @@
char const **envp,
const char *tty,
uint32_t launch_flags,
+ bool stop_at_entry
+)
+{
+ SBError sb_error;
+ return Launch (argv, envp, tty, launch_flags, stop_at_entry, sb_error);
+}
+
+SBProcess
+SBTarget::Launch
+(
+ char const **argv,
+ char const **envp,
+ const char *tty,
+ uint32_t launch_flags,
bool stop_at_entry,
SBError &error
)
@@ -165,14 +164,14 @@
error.SetError (sb_process->Launch (argv, envp, launch_flags, tty, tty, tty));
if (error.Success())
{
- // We we are stopping at the entry point, we can return now!
- if (stop_at_entry)
- return sb_process;
-
// Make sure we are stopped at the entry
StateType state = sb_process->WaitForProcessToStop (NULL);
if (state == eStateStopped)
{
+ // We we are stopping at the entry point, we can return now!
+ if (stop_at_entry)
+ return sb_process;
+
// resume the process to skip the entry point
error.SetError (sb_process->Resume());
if (error.Success())
@@ -199,7 +198,7 @@
lldb::SBProcess
-SBTarget::AttachToProcess
+SBTarget::AttachToProcessWithID
(
lldb::pid_t pid,// The process ID to attach to
SBError& error // An error explaining what went wrong if attach fails
@@ -238,7 +237,7 @@
}
lldb::SBProcess
-SBTarget::AttachToProcess
+SBTarget::AttachToProcessWithName
(
const char *name, // basename of process to attach to
bool wait_for, // if true wait for a new instance of "name" to be launched