[Lldb-commits] [lldb] r126885 - in /lldb/trunk: include/lldb/API/SBSymbolContext.h include/lldb/API/SBTarget.h source/API/SBTarget.cpp source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Greg Clayton gclayton at apple.com
Wed Mar 2 13:34:46 PST 2011


Author: gclayton
Date: Wed Mar  2 15:34:46 2011
New Revision: 126885

URL: http://llvm.org/viewvc/llvm-project?rev=126885&view=rev
Log:
Added a missing API call in SBTarget that enables one to get
anything in a SBSymbolContext filled in given an SBAddress:

SBSymbolContext
SBTarget::ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolve_scope);

Also did a little cleanup on the ProcessGDBRemote stdio file handle
code.


Modified:
    lldb/trunk/include/lldb/API/SBSymbolContext.h
    lldb/trunk/include/lldb/API/SBTarget.h
    lldb/trunk/source/API/SBTarget.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/include/lldb/API/SBSymbolContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBSymbolContext.h?rev=126885&r1=126884&r2=126885&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBSymbolContext.h (original)
+++ lldb/trunk/include/lldb/API/SBSymbolContext.h Wed Mar  2 15:34:46 2011
@@ -51,6 +51,7 @@
     friend class SBFrame;
     friend class SBModule;
     friend class SBThread;
+    friend class SBTarget;
     friend class SBSymbolContextList;
 
 #ifndef SWIG

Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=126885&r1=126884&r2=126885&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Wed Mar  2 15:34:46 2011
@@ -204,6 +204,10 @@
     ResolveLoadAddress (lldb::addr_t vm_addr, 
                         lldb::SBAddress& addr);
 
+    SBSymbolContext
+    ResolveSymbolContextForAddress (const SBAddress& addr, 
+                                    uint32_t resolve_scope);
+
     lldb::SBBreakpoint
     BreakpointCreateByLocation (const char *file, uint32_t line);
 

Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=126885&r1=126884&r2=126885&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Wed Mar  2 15:34:46 2011
@@ -442,6 +442,16 @@
     return false;    
 }
 
+SBSymbolContext
+SBTarget::ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolve_scope)
+{
+    SBSymbolContext sc;
+    if (m_opaque_sp)
+        m_opaque_sp->GetImages().ResolveSymbolContextForAddress (*addr, resolve_scope, sc.ref());
+    return sc;
+}
+
+
 SBBreakpoint
 SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line)
 {

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=126885&r1=126884&r2=126885&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Wed Mar  2 15:34:46 2011
@@ -460,13 +460,12 @@
         {
             lldb_utility::PseudoTerminal pty;
             const bool disable_stdio = (launch_flags & eLaunchFlagDisableSTDIO) != 0;
-            if (disable_stdio)
-            {
-                stdin_path = "/dev/null";
-                stdout_path = "/dev/null";
-                stderr_path = "/dev/null";
-            }
-            else
+
+            // If the debugserver is local and we aren't disabling STDIO, lets use
+            // a pseudo terminal to instead of relying on the 'O' packets for stdio
+            // since 'O' packets can really slow down debugging if the inferior 
+            // does a lot of output.
+            if (m_local_debugserver && !disable_stdio)
             {
                 const char *slave_name = NULL;
                 if (stdin_path == NULL || stdout_path == NULL || stderr_path == NULL)
@@ -484,13 +483,19 @@
                     stderr_path = slave_name;
             }
 
-            if (stdin_path == NULL && (stdout_path || stderr_path))
+            // Set STDIN to /dev/null if we want STDIO disabled or if either
+            // STDOUT or STDERR have been set to something and STDIN hasn't
+            if (disable_stdio || (stdin_path == NULL && (stdout_path || stderr_path)))
                 stdin_path = "/dev/null";
             
-            if (stdout_path == NULL && (stdin_path || stderr_path))
+            // Set STDOUT to /dev/null if we want STDIO disabled or if either
+            // STDIN or STDERR have been set to something and STDOUT hasn't
+            if (disable_stdio || (stdout_path == NULL && (stdin_path || stderr_path)))
                 stdout_path = "/dev/null";
             
-            if (stderr_path == NULL && (stdin_path || stdout_path))
+            // Set STDERR to /dev/null if we want STDIO disabled or if either
+            // STDIN or STDOUT have been set to something and STDERR hasn't
+            if (disable_stdio || (stderr_path == NULL && (stdin_path || stdout_path)))
                 stderr_path = "/dev/null";
 
             if (stdin_path) 





More information about the lldb-commits mailing list