[Lldb-commits] [lldb] r167732 - /lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Sean Callanan scallanan at apple.com
Mon Nov 12 10:00:30 PST 2012


Author: spyffe
Date: Mon Nov 12 12:00:29 2012
New Revision: 167732

URL: http://llvm.org/viewvc/llvm-project?rev=167732&view=rev
Log:
Fixed a potential crash in the Darwin platform.

Modified:
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=167732&r1=167731&r2=167732&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Mon Nov 12 12:00:29 2012
@@ -58,6 +58,9 @@
     const char* module_directory = exec_fspec->GetDirectory().GetCString();
     const char* module_basename = exec_fspec->GetFileNameStrippingExtension().GetCString();
     
+    if (!module_directory || !module_basename)
+        return FileSpec();
+    
     Timer scoped_timer (__PRETTY_FUNCTION__,
                         "LocateExecutableScriptingResource (file = %s, arch = %s, uuid = %p)",
                         exec_fspec ? exec_fspec->GetFilename().AsCString ("<NULL>") : "<NULL>",
@@ -75,7 +78,7 @@
     {
         // for OSX we are going to be in .dSYM/Contents/Resources/DWARF/<basename>
         // let us go to .dSYM/Contents/Resources/Python/<basename>.py and see if the file exists
-        path_string.Printf("%s/../Python/%s.py",symbol_fspec.GetDirectory().GetCString(),module_basename);
+        path_string.Printf("%s/../Python/%s.py",symbol_fspec.GetDirectory().AsCString(""),module_basename);
         script_fspec.SetFile(path_string.GetData(), true);
         if (!script_fspec.Exists())
             script_fspec.Clear();





More information about the lldb-commits mailing list