diff options
author | Greg Clayton <gclayton@apple.com> | 2012-01-29 06:07:39 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-01-29 06:07:39 +0000 |
commit | 13d1950ae6eaf579cbecab1c0515d58f5fa2b648 (patch) | |
tree | 082fa177e8ac54f51cf9cec03db79f892dd39985 /lldb/scripts/Python/interface | |
parent | 6e1c0123855f6eacda37bd2c1bd9b29c8c99c1cb (diff) | |
download | bcm5719-llvm-13d1950ae6eaf579cbecab1c0515d58f5fa2b648.tar.gz bcm5719-llvm-13d1950ae6eaf579cbecab1c0515d58f5fa2b648.zip |
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.
llvm-svn: 149191
Diffstat (limited to 'lldb/scripts/Python/interface')
-rw-r--r-- | lldb/scripts/Python/interface/SBAddress.i | 34 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBCompileUnit.i | 8 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBData.i | 10 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBError.i | 19 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBFileSpec.i | 12 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBFrame.i | 45 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBFunction.i | 19 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBInstruction.i | 13 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBLineEntry.i | 18 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBModule.i | 37 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBProcess.i | 27 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBSection.i | 24 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBTarget.i | 42 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBThread.i | 30 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBType.i | 41 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBValue.i | 76 |
16 files changed, 455 insertions, 0 deletions
diff --git a/lldb/scripts/Python/interface/SBAddress.i b/lldb/scripts/Python/interface/SBAddress.i index 88cf0c453a6..47fa67b70e0 100644 --- a/lldb/scripts/Python/interface/SBAddress.i +++ b/lldb/scripts/Python/interface/SBAddress.i @@ -82,6 +82,9 @@ public: 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 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBCompileUnit.i b/lldb/scripts/Python/interface/SBCompileUnit.i index 6b37d1d2afb..be4f740c12e 100644 --- a/lldb/scripts/Python/interface/SBCompileUnit.i +++ b/lldb/scripts/Python/interface/SBCompileUnit.i @@ -79,6 +79,14 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBData.i b/lldb/scripts/Python/interface/SBData.i index 1d041a3c962..d779cc66325 100644 --- a/lldb/scripts/Python/interface/SBData.i +++ b/lldb/scripts/Python/interface/SBData.i @@ -133,6 +133,16 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBError.i b/lldb/scripts/Python/interface/SBError.i index 61bd4ba8e02..60b051af7c0 100644 --- a/lldb/scripts/Python/interface/SBError.i +++ b/lldb/scripts/Python/interface/SBError.i @@ -102,6 +102,25 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBFileSpec.i b/lldb/scripts/Python/interface/SBFileSpec.i index e2ef74bc93a..d3fae44de8b 100644 --- a/lldb/scripts/Python/interface/SBFileSpec.i +++ b/lldb/scripts/Python/interface/SBFileSpec.i @@ -66,6 +66,18 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBFrame.i b/lldb/scripts/Python/interface/SBFrame.i index 28526ab7478..9c5e0981f13 100644 --- a/lldb/scripts/Python/interface/SBFrame.i +++ b/lldb/scripts/Python/interface/SBFrame.i @@ -217,7 +217,52 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBFunction.i b/lldb/scripts/Python/interface/SBFunction.i index ac3d1231597..76c80661b4f 100644 --- a/lldb/scripts/Python/interface/SBFunction.i +++ b/lldb/scripts/Python/interface/SBFunction.i @@ -76,6 +76,25 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBInstruction.i b/lldb/scripts/Python/interface/SBInstruction.i index 7be6e911ed0..a0595addf1c 100644 --- a/lldb/scripts/Python/interface/SBInstruction.i +++ b/lldb/scripts/Python/interface/SBInstruction.i @@ -62,6 +62,19 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBLineEntry.i b/lldb/scripts/Python/interface/SBLineEntry.i index e1631e91d48..bb613827ba5 100644 --- a/lldb/scripts/Python/interface/SBLineEntry.i +++ b/lldb/scripts/Python/interface/SBLineEntry.i @@ -77,6 +77,24 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBModule.i b/lldb/scripts/Python/interface/SBModule.i index 08e5c184114..547b4a27357 100644 --- a/lldb/scripts/Python/interface/SBModule.i +++ b/lldb/scripts/Python/interface/SBModule.i @@ -236,6 +236,43 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBProcess.i b/lldb/scripts/Python/interface/SBProcess.i index 659966fff73..2087f4683ce 100644 --- a/lldb/scripts/Python/interface/SBProcess.i +++ b/lldb/scripts/Python/interface/SBProcess.i @@ -281,6 +281,33 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBSection.i b/lldb/scripts/Python/interface/SBSection.i index 6c6454617f4..78980b51667 100644 --- a/lldb/scripts/Python/interface/SBSection.i +++ b/lldb/scripts/Python/interface/SBSection.i @@ -87,6 +87,30 @@ public: 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; diff --git a/lldb/scripts/Python/interface/SBTarget.i b/lldb/scripts/Python/interface/SBTarget.i index 676a6c0bab4..e8cac25787c 100644 --- a/lldb/scripts/Python/interface/SBTarget.i +++ b/lldb/scripts/Python/interface/SBTarget.i @@ -311,6 +311,15 @@ public: 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 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBThread.i b/lldb/scripts/Python/interface/SBThread.i index 762626df9ae..c77706a6f4a 100644 --- a/lldb/scripts/Python/interface/SBThread.i +++ b/lldb/scripts/Python/interface/SBThread.i @@ -173,6 +173,36 @@ public: 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 diff --git a/lldb/scripts/Python/interface/SBType.i b/lldb/scripts/Python/interface/SBType.i index 949fae174e3..f072da87183 100644 --- a/lldb/scripts/Python/interface/SBType.i +++ b/lldb/scripts/Python/interface/SBType.i @@ -37,6 +37,20 @@ public: 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 @@ public: 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", diff --git a/lldb/scripts/Python/interface/SBValue.i b/lldb/scripts/Python/interface/SBValue.i index a9878a20b63..1f13a37b97d 100644 --- a/lldb/scripts/Python/interface/SBValue.i +++ b/lldb/scripts/Python/interface/SBValue.i @@ -362,6 +362,82 @@ public: ) 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 |