[Lldb-commits] [lldb] r112308 - in /lldb/trunk: include/lldb/API/SBFileSpec.h scripts/Python/build-swig-Python.sh scripts/lldb.swig source/API/SBFileSpec.cpp tools/driver/IOChannel.cpp

Johnny Chen johnny.chen at apple.com
Fri Aug 27 15:35:26 PDT 2010


Author: johnny
Date: Fri Aug 27 17:35:26 2010
New Revision: 112308

URL: http://llvm.org/viewvc/llvm-project?rev=112308&view=rev
Log:
o Exposed SBFileSpec to the Python APIs in lldb.py.

o Fixed a crasher when getting it via SBTarget.GetExecutable().

>>> filespec = target.GetExecutable()
Segmentation fault

o And renamed SBFileSpec::GetFileName() to GetFilename() to be consistent with FileSpec::GetFilename().


Modified:
    lldb/trunk/include/lldb/API/SBFileSpec.h
    lldb/trunk/scripts/Python/build-swig-Python.sh
    lldb/trunk/scripts/lldb.swig
    lldb/trunk/source/API/SBFileSpec.cpp
    lldb/trunk/tools/driver/IOChannel.cpp

Modified: lldb/trunk/include/lldb/API/SBFileSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFileSpec.h?rev=112308&r1=112307&r2=112308&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBFileSpec.h (original)
+++ lldb/trunk/include/lldb/API/SBFileSpec.h Fri Aug 27 17:35:26 2010
@@ -37,7 +37,7 @@
     Exists () const;
 
     const char *
-    GetFileName() const;
+    GetFilename() const;
 
     const char *
     GetDirectory() const;

Modified: lldb/trunk/scripts/Python/build-swig-Python.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/build-swig-Python.sh?rev=112308&r1=112307&r2=112308&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/build-swig-Python.sh (original)
+++ lldb/trunk/scripts/Python/build-swig-Python.sh Fri Aug 27 17:35:26 2010
@@ -42,6 +42,7 @@
 " ${SRC_ROOT}/include/lldb/API/SBDebugger.h"\
 " ${SRC_ROOT}/include/lldb/API/SBError.h"\
 " ${SRC_ROOT}/include/lldb/API/SBEvent.h"\
+" ${SRC_ROOT}/include/lldb/API/SBFileSpec.h"\
 " ${SRC_ROOT}/include/lldb/API/SBFrame.h"\
 " ${SRC_ROOT}/include/lldb/API/SBFunction.h"\
 " ${SRC_ROOT}/include/lldb/API/SBLineEntry.h"\

Modified: lldb/trunk/scripts/lldb.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/lldb.swig?rev=112308&r1=112307&r2=112308&view=diff
==============================================================================
--- lldb/trunk/scripts/lldb.swig (original)
+++ lldb/trunk/scripts/lldb.swig Fri Aug 27 17:35:26 2010
@@ -83,6 +83,7 @@
 #include "lldb/API/SBDebugger.h"
 #include "lldb/API/SBError.h"
 #include "lldb/API/SBEvent.h"
+#include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBFrame.h"
 #include "lldb/API/SBFunction.h"
 #include "lldb/API/SBLineEntry.h"
@@ -136,6 +137,7 @@
 %include "lldb/API/SBDebugger.h"
 %include "lldb/API/SBError.h"
 %include "lldb/API/SBEvent.h"
+%include "lldb/API/SBFileSpec.h"
 %include "lldb/API/SBFrame.h"
 %include "lldb/API/SBFunction.h"
 %include "lldb/API/SBLineEntry.h"

Modified: lldb/trunk/source/API/SBFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpec.cpp?rev=112308&r1=112307&r2=112308&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFileSpec.cpp (original)
+++ lldb/trunk/source/API/SBFileSpec.cpp Fri Aug 27 17:35:26 2010
@@ -24,7 +24,7 @@
     m_opaque_ap()
 {
     if (rhs.m_opaque_ap.get())
-        m_opaque_ap.reset (new FileSpec (*m_opaque_ap));
+        m_opaque_ap.reset (new FileSpec (rhs.get()));
 }
 
 SBFileSpec::SBFileSpec (const char *path) :
@@ -69,7 +69,7 @@
 }
 
 const char *
-SBFileSpec::GetFileName() const
+SBFileSpec::GetFilename() const
 {
     if (m_opaque_ap.get())
         return m_opaque_ap->GetFilename().AsCString();

Modified: lldb/trunk/tools/driver/IOChannel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/IOChannel.cpp?rev=112308&r1=112307&r2=112308&view=diff
==============================================================================
--- lldb/trunk/tools/driver/IOChannel.cpp (original)
+++ lldb/trunk/tools/driver/IOChannel.cpp Fri Aug 27 17:35:26 2010
@@ -163,7 +163,7 @@
     m_err_file (err),
     m_command_queue (),
     m_completion_key ("\t"),
-    m_edit_line (::el_init (SBHostOS::GetProgramFileSpec().GetFileName(), in, out, err)),
+    m_edit_line (::el_init (SBHostOS::GetProgramFileSpec().GetFilename(), in, out, err)),
     m_history (history_init()),
     m_history_event(),
     m_getting_command (false)
@@ -213,7 +213,7 @@
     if (m_history != NULL)
     {
         char history_path[PATH_MAX];
-        ::snprintf (history_path, sizeof(history_path), "~/.%s-history", SBHostOS::GetProgramFileSpec().GetFileName());
+        ::snprintf (history_path, sizeof(history_path), "~/.%s-history", SBHostOS::GetProgramFileSpec().GetFilename());
         if ((size_t)SBFileSpec::ResolvePath (history_path, history_path, sizeof(history_path)) < sizeof(history_path) - 1)
         {
             const char *path_ptr = history_path;





More information about the lldb-commits mailing list