[Lldb-commits] [lldb] r149191 - in /lldb/trunk: include/lldb/API/ scripts/Python/interface/ source/API/

Greg Clayton gclayton at apple.com
Sat Jan 28 22:07:39 PST 2012


Author: gclayton
Date: Sun Jan 29 00:07:39 2012
New Revision: 149191

URL: http://llvm.org/viewvc/llvm-project?rev=149191&view=rev
Log:
Added the ability to get the target triple, byte order and address byte size
from the SBTarget and SBModule interfaces. Also added many python properties
for easier access to many things from many SB objects.


Modified:
    lldb/trunk/include/lldb/API/SBAddress.h
    lldb/trunk/include/lldb/API/SBModule.h
    lldb/trunk/include/lldb/API/SBTarget.h
    lldb/trunk/scripts/Python/interface/SBAddress.i
    lldb/trunk/scripts/Python/interface/SBCompileUnit.i
    lldb/trunk/scripts/Python/interface/SBData.i
    lldb/trunk/scripts/Python/interface/SBError.i
    lldb/trunk/scripts/Python/interface/SBFileSpec.i
    lldb/trunk/scripts/Python/interface/SBFrame.i
    lldb/trunk/scripts/Python/interface/SBFunction.i
    lldb/trunk/scripts/Python/interface/SBInstruction.i
    lldb/trunk/scripts/Python/interface/SBLineEntry.i
    lldb/trunk/scripts/Python/interface/SBModule.i
    lldb/trunk/scripts/Python/interface/SBProcess.i
    lldb/trunk/scripts/Python/interface/SBSection.i
    lldb/trunk/scripts/Python/interface/SBTarget.i
    lldb/trunk/scripts/Python/interface/SBThread.i
    lldb/trunk/scripts/Python/interface/SBType.i
    lldb/trunk/scripts/Python/interface/SBValue.i
    lldb/trunk/source/API/SBAddress.cpp
    lldb/trunk/source/API/SBModule.cpp
    lldb/trunk/source/API/SBTarget.cpp

Modified: lldb/trunk/include/lldb/API/SBAddress.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBAddress.h?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBAddress.h (original)
+++ lldb/trunk/include/lldb/API/SBAddress.h Sun Jan 29 00:07:39 2012
@@ -76,6 +76,9 @@
     lldb::SBSection
     GetSection ();
 
+    lldb::addr_t
+    GetOffset ();
+
     lldb::SBModule
     GetModule ();
     

Modified: lldb/trunk/include/lldb/API/SBModule.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBModule.h?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBModule.h (original)
+++ lldb/trunk/include/lldb/API/SBModule.h Sun Jan 29 00:07:39 2012
@@ -73,6 +73,15 @@
     bool
     SetPlatformFileSpec (const lldb::SBFileSpec &platform_file);
 
+    lldb::ByteOrder
+    GetByteOrder ();
+    
+    uint32_t
+    GetAddressByteSize();
+    
+    const char *
+    GetTriple ();
+
 #ifndef SWIG
     const uint8_t *
     GetUUIDBytes () const;

Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Sun Jan 29 00:07:39 2012
@@ -269,6 +269,15 @@
     lldb::SBModule
     FindModule (const lldb::SBFileSpec &file_spec);
 
+    lldb::ByteOrder
+    GetByteOrder ();
+
+    uint32_t
+    GetAddressByteSize();
+
+    const char *
+    GetTriple ();
+
     //------------------------------------------------------------------
     /// Set the base load address for a module section.
     ///

Modified: lldb/trunk/scripts/Python/interface/SBAddress.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBAddress.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBAddress.i (original)
+++ lldb/trunk/scripts/Python/interface/SBAddress.i Sun Jan 29 00:07:39 2012
@@ -82,6 +82,9 @@
     lldb::SBSection
     GetSection ();
 
+    lldb::addr_t
+    SBAddress::GetOffset ();
+
     %feature("docstring", "
     //------------------------------------------------------------------
     /// GetSymbolContext() and the following can lookup symbol information for a given address.
@@ -124,6 +127,37 @@
 
     lldb::SBLineEntry
     GetLineEntry ();
+    
+    %pythoncode %{
+        __swig_getmethods__["module"] = GetModule
+        if _newclass: x = property(GetModule, None)
+
+        __swig_getmethods__["compile_unit"] = GetCompileUnit
+        if _newclass: x = property(GetCompileUnit, None)
+
+        __swig_getmethods__["line_entry"] = GetLineEntry
+        if _newclass: x = property(GetLineEntry, None)
+
+        __swig_getmethods__["function"] = GetFunction
+        if _newclass: x = property(GetFunction, None)
+
+        __swig_getmethods__["block"] = GetBlock
+        if _newclass: x = property(GetBlock, None)
+
+        __swig_getmethods__["symbol"] = GetSymbol
+        if _newclass: x = property(GetSymbol, None)
+
+        __swig_getmethods__["offset"] = GetOffset
+        if _newclass: x = property(GetOffset, None)
+
+        __swig_getmethods__["section"] = GetSection
+        if _newclass: x = property(GetSection, None)
+
+        __swig_getmethods__["file_addr"] = GetFileAddress
+        if _newclass: x = property(GetFileAddress, None)
+
+    %}
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBCompileUnit.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBCompileUnit.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBCompileUnit.i (original)
+++ lldb/trunk/scripts/Python/interface/SBCompileUnit.i Sun Jan 29 00:07:39 2012
@@ -79,6 +79,14 @@
 
     bool
     GetDescription (lldb::SBStream &description);
+    
+    %pythoncode %{
+        __swig_getmethods__["file"] = GetFileSpec
+        if _newclass: x = property(GetFileSpec, None)
+        
+        __swig_getmethods__["num_line_entries"] = GetNumLineEntries
+        if _newclass: x = property(GetNumLineEntries, None)
+    %}
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBData.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBData.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBData.i (original)
+++ lldb/trunk/scripts/Python/interface/SBData.i Sun Jan 29 00:07:39 2012
@@ -133,6 +133,16 @@
     bool
     SetDataFromDoubleArray (double* array, size_t array_len);
 
+    %pythoncode %{
+        __swig_getmethods__["byte_order"] = GetByteOrder
+        __swig_setmethods__["byte_order"] = SetByteOrder
+        if _newclass: x = property(GetByteOrder, SetByteOrder)
+        
+        __swig_getmethods__["size"] = GetByteSize
+        if _newclass: x = property(GetByteSize, None)
+        
+    %}
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBError.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBError.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBError.i (original)
+++ lldb/trunk/scripts/Python/interface/SBError.i Sun Jan 29 00:07:39 2012
@@ -102,6 +102,25 @@
 
     bool
     GetDescription (lldb::SBStream &description);
+    
+    %pythoncode %{
+        __swig_getmethods__["value"] = GetError
+        if _newclass: x = property(GetError, None)
+        
+        __swig_getmethods__["fail"] = Fail
+        if _newclass: x = property(Fail, None)
+        
+        __swig_getmethods__["success"] = Success
+        if _newclass: x = property(Success, None)
+        
+        __swig_getmethods__["description"] = GetCString
+        if _newclass: x = property(GetCString, None)
+        
+        __swig_getmethods__["type"] = GetType
+        if _newclass: x = property(GetType, None)
+        
+    %}
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBFileSpec.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBFileSpec.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBFileSpec.i (original)
+++ lldb/trunk/scripts/Python/interface/SBFileSpec.i Sun Jan 29 00:07:39 2012
@@ -66,6 +66,18 @@
 
     bool
     GetDescription (lldb::SBStream &description) const;
+    
+    %pythoncode %{
+        __swig_getmethods__["basename"] = GetFilename
+        if _newclass: x = property(GetFilename, None)
+        
+        __swig_getmethods__["dirname"] = GetDirectory
+        if _newclass: x = property(GetDirectory, None)
+        
+        __swig_getmethods__["exists"] = Exists
+        if _newclass: x = property(Exists, None)
+    %}
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBFrame.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBFrame.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBFrame.i (original)
+++ lldb/trunk/scripts/Python/interface/SBFrame.i Sun Jan 29 00:07:39 2012
@@ -217,7 +217,52 @@
 
     bool
     GetDescription (lldb::SBStream &description);
+    
+    %pythoncode %{
+        __swig_getmethods__["pc"] = GetPC
+        __swig_setmethods__["pc"] = SetPC
+        if _newclass: x = property(GetPC, SetPC)
 
+        __swig_getmethods__["fp"] = GetFP
+        if _newclass: x = property(GetFP, None)
+
+        __swig_getmethods__["sp"] = GetSP
+        if _newclass: x = property(GetSP, None)
+
+        __swig_getmethods__["module"] = GetModule
+        if _newclass: x = property(GetModule, None)
+
+        __swig_getmethods__["compile_unit"] = GetCompileUnit
+        if _newclass: x = property(GetCompileUnit, None)
+
+        __swig_getmethods__["function"] = GetFunction
+        if _newclass: x = property(GetFunction, None)
+
+        __swig_getmethods__["symbol"] = GetSymbol
+        if _newclass: x = property(GetSymbol, None)
+
+        __swig_getmethods__["block"] = GetBlock
+        if _newclass: x = property(GetBlock, None)
+
+        __swig_getmethods__["is_inlined"] = IsInlined
+        if _newclass: x = property(IsInlined, None)
+
+        __swig_getmethods__["name"] = GetFunctionName
+        if _newclass: x = property(GetFunctionName, None)
+
+        __swig_getmethods__["line_entry"] = GetLineEntry
+        if _newclass: x = property(GetLineEntry, None)
+
+        __swig_getmethods__["thread"] = GetThread
+        if _newclass: x = property(GetThread, None)
+
+        __swig_getmethods__["disassembly"] = Disassemble
+        if _newclass: x = property(Disassemble, None)
+
+        __swig_getmethods__["idx"] = GetFrameID
+        if _newclass: x = property(GetFrameID, None)
+
+    %}
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBFunction.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBFunction.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBFunction.i (original)
+++ lldb/trunk/scripts/Python/interface/SBFunction.i Sun Jan 29 00:07:39 2012
@@ -76,6 +76,25 @@
 
     bool
     GetDescription (lldb::SBStream &description);
+    
+    %pythoncode %{
+        __swig_getmethods__["name"] = GetName
+        if _newclass: x = property(GetName, None)
+        
+        __swig_getmethods__["mangled"] = GetMangledName
+        if _newclass: x = property(GetMangledName, None)
+        
+        __swig_getmethods__["start_addr"] = GetStartAddress
+        if _newclass: x = property(GetStartAddress, None)
+        
+        __swig_getmethods__["end_addr"] = GetEndAddress
+        if _newclass: x = property(GetEndAddress, None)
+        
+        __swig_getmethods__["prologue_size"] = GetPrologueByteSize
+        if _newclass: x = property(GetPrologueByteSize, None)
+        
+    %}
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBInstruction.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBInstruction.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBInstruction.i (original)
+++ lldb/trunk/scripts/Python/interface/SBInstruction.i Sun Jan 29 00:07:39 2012
@@ -62,6 +62,19 @@
     
     bool
     TestEmulation (lldb::SBStream &output_stream, const char *test_file);
+    
+    %pythoncode %{
+        __swig_getmethods__["addr"] = GetAddress
+        if _newclass: x = property(GetAddress, None)
+        
+        __swig_getmethods__["size"] = GetByteSize
+        if _newclass: x = property(GetByteSize, None)
+
+        __swig_getmethods__["is_branch"] = DoesBranch
+        if _newclass: x = property(DoesBranch, None)
+    %}
+    
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBLineEntry.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBLineEntry.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBLineEntry.i (original)
+++ lldb/trunk/scripts/Python/interface/SBLineEntry.i Sun Jan 29 00:07:39 2012
@@ -77,6 +77,24 @@
     void
     SetColumn (uint32_t column);
 
+    %pythoncode %{
+        __swig_getmethods__["file"] = GetFileSpec
+        if _newclass: x = property(GetFileSpec, None)
+        
+        __swig_getmethods__["line"] = GetLine
+        if _newclass: x = property(GetLine, None)
+        
+        __swig_getmethods__["column"] = GetColumn
+        if _newclass: x = property(GetColumn, None)
+        
+        __swig_getmethods__["start_addr"] = GetStartAddress
+        if _newclass: x = property(GetStartAddress, None)
+        
+        __swig_getmethods__["end_addr"] = GetEndAddress
+        if _newclass: x = property(GetEndAddress, None)
+        
+    %}
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBModule.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBModule.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBModule.i (original)
+++ lldb/trunk/scripts/Python/interface/SBModule.i Sun Jan 29 00:07:39 2012
@@ -236,6 +236,43 @@
     FindGlobalVariables (lldb::SBTarget &target, 
                          const char *name, 
                          uint32_t max_matches);
+    
+    lldb::ByteOrder
+    GetByteOrder ();
+    
+    uint32_t
+    GetAddressByteSize();
+    
+    const char *
+    GetTriple ();
+
+    %pythoncode %{
+        __swig_getmethods__["file"] = GetFileSpec
+        if _newclass: x = property(GetFileSpec, None)
+        
+        __swig_getmethods__["platform_file"] = GetPlatformFileSpec
+        if _newclass: x = property(GetPlatformFileSpec, None)
+        
+        __swig_getmethods__["uuid"] = GetUUIDString
+        if _newclass: x = property(GetUUIDString, None)
+        
+        __swig_getmethods__["byte_order"] = GetByteOrder
+        if _newclass: x = property(GetByteOrder, None)
+        
+        __swig_getmethods__["addr_size"] = GetAddressByteSize
+        if _newclass: x = property(GetAddressByteSize, None)
+        
+        __swig_getmethods__["triple"] = GetTriple
+        if _newclass: x = property(GetTriple, None)
+
+        __swig_getmethods__["num_symbols"] = GetNumSymbols
+        if _newclass: x = property(GetNumSymbols, None)
+        
+        __swig_getmethods__["num_sections"] = GetNumSections
+        if _newclass: x = property(GetNumSections, None)
+        
+    %}
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBProcess.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBProcess.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBProcess.i (original)
+++ lldb/trunk/scripts/Python/interface/SBProcess.i Sun Jan 29 00:07:39 2012
@@ -281,6 +281,33 @@
     lldb::SBError
     UnloadImage (uint32_t image_token);
 
+    %pythoncode %{
+        __swig_getmethods__["id"] = GetProcessID
+        if _newclass: x = property(GetProcessID, None)
+        
+        __swig_getmethods__["target"] = GetTarget
+        if _newclass: x = property(GetTarget, None)
+        
+        __swig_getmethods__["num_threads"] = GetNumThreads
+        if _newclass: x = property(GetNumThreads, None)
+        
+        __swig_getmethods__["selected_thread"] = GetSelectedThread
+        __swig_setmethods__["selected_thread"] = SetSelectedThread
+        if _newclass: x = property(GetSelectedThread, SetSelectedThread)
+        
+        __swig_getmethods__["state"] = GetState
+        if _newclass: x = property(GetState, None)
+        
+        __swig_getmethods__["exit_state"] = GetExitStatus
+        if _newclass: x = property(GetExitStatus, None)
+        
+        __swig_getmethods__["exit_description"] = GetExitDescription
+        if _newclass: x = property(GetExitDescription, None)
+        
+        __swig_getmethods__["broadcaster"] = GetBroadcaster
+        if _newclass: x = property(GetBroadcaster, None)
+    %}
+
 };
 
 }  // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBSection.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBSection.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBSection.i (original)
+++ lldb/trunk/scripts/Python/interface/SBSection.i Sun Jan 29 00:07:39 2012
@@ -87,6 +87,30 @@
     bool
     GetDescription (lldb::SBStream &description);
     
+    %pythoncode %{
+        __swig_getmethods__["name"] = GetName
+        if _newclass: x = property(GetName, None)
+
+        __swig_getmethods__["file_addr"] = GetFileAddress
+        if _newclass: x = property(GetFileAddress, None)
+
+        __swig_getmethods__["size"] = GetByteSize
+        if _newclass: x = property(GetByteSize, None)
+
+        __swig_getmethods__["file_offset"] = GetFileOffset
+        if _newclass: x = property(GetFileOffset, None)
+
+        __swig_getmethods__["file_size"] = GetFileByteSize
+        if _newclass: x = property(GetFileByteSize, None)
+
+        __swig_getmethods__["data"] = GetSectionData
+        if _newclass: x = property(GetSectionData, None)
+
+        __swig_getmethods__["type"] = GetSectionType
+        if _newclass: x = property(GetSectionType, None)
+
+    %}
+
 private:
 
     std::auto_ptr<lldb_private::SectionImpl> m_opaque_ap;

Modified: lldb/trunk/scripts/Python/interface/SBTarget.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTarget.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBTarget.i (original)
+++ lldb/trunk/scripts/Python/interface/SBTarget.i Sun Jan 29 00:07:39 2012
@@ -311,6 +311,15 @@
     lldb::SBModule
     FindModule (const lldb::SBFileSpec &file_spec);
 
+    lldb::ByteOrder
+    GetByteOrder ();
+    
+    uint32_t
+    GetAddressByteSize();
+    
+    const char *
+    GetTriple ();
+
     lldb::SBError
     SetSectionLoadAddress (lldb::SBSection section,
                            lldb::addr_t section_base_addr);
@@ -476,6 +485,39 @@
     
     bool
     GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
+    
+    %pythoncode %{
+        __swig_getmethods__["process"] = GetProcess
+        if _newclass: x = property(GetProcess, None)
+
+        __swig_getmethods__["executable"] = GetExecutable
+        if _newclass: x = property(GetExecutable, None)
+
+        __swig_getmethods__["debugger"] = GetDebugger
+        if _newclass: x = property(GetDebugger, None)
+
+        __swig_getmethods__["file_offset"] = GetFileOffset
+        if _newclass: x = property(GetFileOffset, None)
+
+        __swig_getmethods__["num_breakpoints"] = GetNumBreakpoints
+        if _newclass: x = property(GetNumBreakpoints, None)
+
+        __swig_getmethods__["num_watchpoints"] = GetNumWatchpoints
+        if _newclass: x = property(GetNumWatchpoints, None)
+
+        __swig_getmethods__["broadcaster"] = GetBroadcaster
+        if _newclass: x = property(GetBroadcaster, None)
+        
+        __swig_getmethods__["byte_order"] = GetByteOrder
+        if _newclass: x = property(GetByteOrder, None)
+        
+        __swig_getmethods__["addr_size"] = GetAddressByteSize
+        if _newclass: x = property(GetAddressByteSize, None)
+        
+        __swig_getmethods__["triple"] = GetTriple
+        if _newclass: x = property(GetTriple, None)
+    %}
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBThread.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBThread.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBThread.i (original)
+++ lldb/trunk/scripts/Python/interface/SBThread.i Sun Jan 29 00:07:39 2012
@@ -173,6 +173,36 @@
 
     bool
     GetDescription (lldb::SBStream &description) const;
+    
+    %pythoncode %{
+        __swig_getmethods__["id"] = GetThreadID
+        if _newclass: x = property(GetThreadID, None)
+
+        __swig_getmethods__["idx"] = GetIndexID
+        if _newclass: x = property(GetIndexID, None)
+
+        __swig_getmethods__["return_value"] = GetStopReturnValue
+        if _newclass: x = property(GetStopReturnValue, None)
+
+        __swig_getmethods__["process"] = GetProcess
+        if _newclass: x = property(GetProcess, None)
+
+        __swig_getmethods__["num_frames"] = GetNumFrames
+        if _newclass: x = property(GetNumFrames, None)
+
+        __swig_getmethods__["name"] = GetName
+        if _newclass: x = property(GetName, None)
+
+        __swig_getmethods__["queue"] = GetQueueName
+        if _newclass: x = property(GetQueueName, None)
+
+        __swig_getmethods__["stop_reason"] = GetStopReason
+        if _newclass: x = property(GetStopReason, None)
+
+        __swig_getmethods__["is_suspended"] = IsSuspended
+        if _newclass: x = property(IsSuspended, None)
+    %}
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBType.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBType.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBType.i (original)
+++ lldb/trunk/scripts/Python/interface/SBType.i Sun Jan 29 00:07:39 2012
@@ -37,6 +37,20 @@
     uint64_t
     GetOffsetInBits();
     
+    %pythoncode %{
+        __swig_getmethods__["name"] = GetName
+        if _newclass: x = property(GetName, None)
+        
+        __swig_getmethods__["type"] = GetType
+        if _newclass: x = property(GetType, None)
+        
+        __swig_getmethods__["byte_offset"] = GetOffsetInBytes
+        if _newclass: x = property(GetOffsetInBytes, None)
+        
+        __swig_getmethods__["bit_offset"] = GetOffsetInBits
+        if _newclass: x = property(GetOffsetInBits, None)
+    %}    
+
 protected:
     std::auto_ptr<lldb_private::TypeMemberImpl> m_opaque_ap;
 };
@@ -174,6 +188,33 @@
     
     lldb::TypeClass
     GetTypeClass ();
+    
+    %pythoncode %{
+        __swig_getmethods__["name"] = GetName
+        if _newclass: x = property(GetName, None)
+        
+        __swig_getmethods__["size"] = GetByteSize
+        if _newclass: x = property(GetByteSize, None)
+        
+        __swig_getmethods__["is_pointer"] = IsPointerType
+        if _newclass: x = property(IsPointerType, None)
+        
+        __swig_getmethods__["is_reference"] = IsReferenceType
+        if _newclass: x = property(IsReferenceType, None)
+
+        __swig_getmethods__["num_fields"] = GetNumberOfFields
+        if _newclass: x = property(GetNumberOfFields, None)
+        
+        __swig_getmethods__["num_bases"] = GetNumberOfDirectBaseClasses
+        if _newclass: x = property(GetNumberOfDirectBaseClasses, None)
+        
+        __swig_getmethods__["num_vbases"] = GetNumberOfVirtualBaseClasses
+        if _newclass: x = property(GetNumberOfVirtualBaseClasses, None)
+        
+        __swig_getmethods__["class"] = GetTypeClass
+        if _newclass: x = property(GetTypeClass, None)
+    %}
+
 };
 
 %feature("docstring",

Modified: lldb/trunk/scripts/Python/interface/SBValue.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBValue.i?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBValue.i (original)
+++ lldb/trunk/scripts/Python/interface/SBValue.i Sun Jan 29 00:07:39 2012
@@ -362,6 +362,82 @@
     ) GetExpressionPath;
     bool
     GetExpressionPath (lldb::SBStream &description, bool qualify_cxx_base_classes);
+    
+    %pythoncode %{
+
+        __swig_getmethods__["name"] = GetName
+        if _newclass: x = property(GetName, None)
+
+        __swig_getmethods__["type"] = GetType
+        if _newclass: x = property(GetType, None)
+
+        __swig_getmethods__["size"] = GetByteSize
+        if _newclass: x = property(GetByteSize, None)
+
+        __swig_getmethods__["name"] = GetName
+        if _newclass: x = property(GetName, None)
+
+        __swig_getmethods__["is_in_scope"] = IsInScope
+        if _newclass: x = property(IsInScope, None)
+
+        __swig_getmethods__["format"] = GetFormat
+        __swig_setmethods__["format"] = SetFormat
+        if _newclass: x = property(GetName, SetFormat)
+
+        __swig_getmethods__["value"] = GetValue
+        __swig_setmethods__["value"] = SetValueFromCString
+        if _newclass: x = property(GetValue, SetValueFromCString)
+
+        __swig_getmethods__["value_type"] = GetValueType
+        if _newclass: x = property(GetValueType, None)
+
+        __swig_getmethods__["changed"] = GetValueDidChange
+        if _newclass: x = property(GetValueDidChange, None)
+
+        __swig_getmethods__["data"] = GetData
+        if _newclass: x = property(GetData, None)
+
+        __swig_getmethods__["load_addr"] = GetLoadAddress
+        if _newclass: x = property(GetLoadAddress, None)
+
+        __swig_getmethods__["addr"] = GetAddress
+        if _newclass: x = property(GetAddress, None)
+
+        __swig_getmethods__["deref"] = Dereference
+        if _newclass: x = property(Dereference, None)
+
+        __swig_getmethods__["address_of"] = AddressOf
+        if _newclass: x = property(AddressOf, None)
+
+        __swig_getmethods__["error"] = GetError
+        if _newclass: x = property(GetError, None)
+    
+        __swig_getmethods__["summary"] = GetSummary
+        if _newclass: x = property(GetSummary, None)
+
+        __swig_getmethods__["description"] = GetObjectDescription
+        if _newclass: x = property(GetObjectDescription, None)
+
+        __swig_getmethods__["location"] = GetLocation
+        if _newclass: x = property(GetLocation, None)
+
+        __swig_getmethods__["target"] = GetTarget
+        if _newclass: x = property(GetTarget, None)
+
+        __swig_getmethods__["process"] = GetProcess
+        if _newclass: x = property(GetProcess, None)
+
+        __swig_getmethods__["thread"] = GetThread
+        if _newclass: x = property(GetThread, None)
+
+        __swig_getmethods__["frame"] = GetFrame
+        if _newclass: x = property(GetFrame, None)
+
+        __swig_getmethods__["num_children"] = GetNumChildren
+        if _newclass: x = property(GetNumChildren, None)
+
+    %}
+
 };
 
 } // namespace lldb

Modified: lldb/trunk/source/API/SBAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBAddress.cpp?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/source/API/SBAddress.cpp (original)
+++ lldb/trunk/source/API/SBAddress.cpp Sun Jan 29 00:07:39 2012
@@ -229,6 +229,13 @@
     return sb_section;
 }
 
+lldb::addr_t
+SBAddress::GetOffset ()
+{
+    if (m_opaque_ap.get())
+        m_opaque_ap->GetAddress().GetOffset();
+    return 0;
+}
 
 Address *
 SBAddress::operator->()

Modified: lldb/trunk/source/API/SBModule.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/source/API/SBModule.cpp (original)
+++ lldb/trunk/source/API/SBModule.cpp Sun Jan 29 00:07:39 2012
@@ -475,3 +475,34 @@
     return sb_section;
 }
 
+lldb::ByteOrder
+SBModule::GetByteOrder ()
+{
+    if (m_opaque_sp)
+        return m_opaque_sp->GetArchitecture().GetByteOrder();
+    return eByteOrderInvalid;
+}
+
+const char *
+SBModule::GetTriple ()
+{
+    if (m_opaque_sp)
+    {
+        std::string triple (m_opaque_sp->GetArchitecture().GetTriple().str());
+        // Unique the string so we don't run into ownership issues since
+        // the const strings put the string into the string pool once and
+        // the strings never comes out
+        ConstString const_triple (triple.c_str());
+        return const_triple.GetCString();
+    }
+    return NULL;
+}
+
+uint32_t
+SBModule::GetAddressByteSize()
+{
+    if (m_opaque_sp)
+        return m_opaque_sp->GetArchitecture().GetAddressByteSize();
+    return sizeof(void*);
+}
+

Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=149191&r1=149190&r2=149191&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Sun Jan 29 00:07:39 2012
@@ -1113,6 +1113,38 @@
     return sb_module;
 }
 
+lldb::ByteOrder
+SBTarget::GetByteOrder ()
+{
+    if (m_opaque_sp)
+        return m_opaque_sp->GetArchitecture().GetByteOrder();
+    return eByteOrderInvalid;
+}
+
+const char *
+SBTarget::GetTriple ()
+{
+    if (m_opaque_sp)
+    {
+        std::string triple (m_opaque_sp->GetArchitecture().GetTriple().str());
+        // Unique the string so we don't run into ownership issues since
+        // the const strings put the string into the string pool once and
+        // the strings never comes out
+        ConstString const_triple (triple.c_str());
+        return const_triple.GetCString();
+    }
+    return NULL;
+}
+
+uint32_t
+SBTarget::GetAddressByteSize()
+{
+    if (m_opaque_sp)
+        return m_opaque_sp->GetArchitecture().GetAddressByteSize();
+    return sizeof(void*);
+}
+
+
 SBModule
 SBTarget::GetModuleAtIndex (uint32_t idx)
 {





More information about the lldb-commits mailing list