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/SBBreakpoint.cpp b/source/API/SBBreakpoint.cpp
index 70a7045..8f05453 100644
--- a/source/API/SBBreakpoint.cpp
+++ b/source/API/SBBreakpoint.cpp
@@ -323,28 +323,19 @@
 }
 
 bool
-SBBreakpoint::GetDescription (const char *description_level, SBStream &description)
+SBBreakpoint::GetDescription (SBStream &s)
 {
     if (m_opaque_sp)
     {
-        DescriptionLevel level;
-        if (strcmp (description_level, "brief") == 0)
-            level = eDescriptionLevelBrief;
-        else if (strcmp (description_level, "full") == 0)
-            level = eDescriptionLevelFull;
-        else if (strcmp (description_level, "verbose") == 0)
-            level = eDescriptionLevelVerbose;
-        else
-            level = eDescriptionLevelBrief;
-
-        description.ref();
-        m_opaque_sp->GetDescription (description.get(), level);
-        description.get()->EOL();
+        s.Printf("SBBreakpoint: id = %i, ", m_opaque_sp->GetID());
+        m_opaque_sp->GetResolverDescription (s.get());
+        m_opaque_sp->GetFilterDescription (s.get());
+        const size_t num_locations = m_opaque_sp->GetNumLocations ();
+        s.Printf(", locations = %zu", num_locations);
+        return true;
     }
-    else
-        description.Printf ("No value");
-
-    return true;
+    s.Printf ("No value");
+    return false;
 }
 
 bool
diff --git a/source/API/SBFrame.cpp b/source/API/SBFrame.cpp
index 9ca92fc..f4dfb33 100644
--- a/source/API/SBFrame.cpp
+++ b/source/API/SBFrame.cpp
@@ -402,8 +402,7 @@
 {
     if (m_opaque_sp)
     {
-        description.ref();
-        m_opaque_sp->DumpUsingSettingsFormat (description.get());
+        description.Printf("SBFrame: idx = %u", m_opaque_sp->GetFrameIndex());
     }
     else
         description.Printf ("No value");
diff --git a/source/API/SBFunction.cpp b/source/API/SBFunction.cpp
index f1426e7..de56a2e 100644
--- a/source/API/SBFunction.cpp
+++ b/source/API/SBFunction.cpp
@@ -14,6 +14,7 @@
 #include "lldb/Core/Module.h"
 #include "lldb/Symbol/CompileUnit.h"
 #include "lldb/Symbol/Function.h"
+#include "lldb/Symbol/Type.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Target.h"
 
@@ -70,17 +71,20 @@
 }
 
 bool
-SBFunction::GetDescription (SBStream &description)
+SBFunction::GetDescription (SBStream &s)
 {
     if (m_opaque_ptr)
     {
-        description.ref();
-        m_opaque_ptr->Dump (description.get(), false);
+        s.Printf ("SBFunction: id = 0x%8.8x, name = %s", 
+                            m_opaque_ptr->GetID(),
+                            m_opaque_ptr->GetName().AsCString());
+        Type *func_type = m_opaque_ptr->GetType();
+        if (func_type)
+            s.Printf(", type = %s", func_type->GetName().AsCString());
+        return true;
     }
-    else
-        description.Printf ("No value");
-
-    return true;
+    s.Printf ("No value");
+    return false;
 }
 
 SBInstructionList
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp
index a288833..53d6ad2 100644
--- a/source/API/SBProcess.cpp
+++ b/source/API/SBProcess.cpp
@@ -488,11 +488,11 @@
         if (exe_module)
             exe_name = exe_module->GetFileSpec().GetFilename().AsCString();
 
-        description.Printf ("Process {pid: %d, state: %s, threads: %d%s%s}", 
+        description.Printf ("SBProcess: pid = %d, state = %s, threads = %d%s%s", 
                             m_opaque_sp->GetID(),
                             SBDebugger::StateAsCString (GetState()), 
                             GetNumThreads(),
-                            exe_name ? ", executable: " : "",
+                            exe_name ? ", executable = " : "",
                             exe_name ? exe_name : "");
     }
     else
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
diff --git a/source/API/SBThread.cpp b/source/API/SBThread.cpp
index 0489dc5..006efc7 100644
--- a/source/API/SBThread.cpp
+++ b/source/API/SBThread.cpp
@@ -452,7 +452,10 @@
 SBThread::GetDescription (SBStream &description)
 {
     if (m_opaque_sp)
-        m_opaque_sp->DumpUsingSettingsFormat (description.ref(), 0);
+    {
+        StreamString strm;
+        description.Printf("SBThread: tid = 0x%4.4x", m_opaque_sp->GetID());
+    }
     else
         description.Printf ("No value");