[Lldb-commits] [lldb] r185661 - Avoid crash if we fail to resolve process in attach

Ed Maste emaste at freebsd.org
Thu Jul 4 11:25:34 PDT 2013


Author: emaste
Date: Thu Jul  4 13:25:34 2013
New Revision: 185661

URL: http://llvm.org/viewvc/llvm-project?rev=185661&view=rev
Log:
Avoid crash if we fail to resolve process in attach


Modified:
    lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp

Modified: lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp?rev=185661&r1=185660&r2=185661&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp Thu Jul  4 13:25:34 2013
@@ -135,6 +135,8 @@ ProcessPOSIX::DoAttachToProcessWithID(ll
                                            m_target.GetArchitecture(),
                                            exe_module_sp,
                                            executable_search_paths.GetSize() ? &executable_search_paths : NULL);
+    if (!error.Success())
+        return error;
 
     // Fix the target architecture if necessary
     const ArchSpec &module_arch = exe_module_sp->GetArchitecture();
@@ -144,9 +146,6 @@ ProcessPOSIX::DoAttachToProcessWithID(ll
     // Initialize the target module list
     m_target.SetExecutableModule (exe_module_sp, true);
 
-    if (!error.Success())
-        return error;
-
     SetSTDIOFileDescriptor(m_monitor->GetTerminalFD());
 
     SetID(pid);





More information about the lldb-commits mailing list