diff options
author | Greg Clayton <gclayton@apple.com> | 2011-09-24 05:04:40 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-09-24 05:04:40 +0000 |
commit | d9dc52dc4c081baac2d611f978b9c01f72a625fe (patch) | |
tree | 8536e94a31dc32168ff09ae5deb02fab98dbd649 /lldb | |
parent | 57087f3df3151d170680d4e30234c2a1528bff88 (diff) | |
download | bcm5719-llvm-d9dc52dc4c081baac2d611f978b9c01f72a625fe.tar.gz bcm5719-llvm-d9dc52dc4c081baac2d611f978b9c01f72a625fe.zip |
Added the ability to get all section contents, or the section
contents starting at an offset (2 separate methods). This helps
the scripting interface stay more natural by allowing both from
Python.
Added the ability to dump data with address annotations when
call SBData::GetDescription().
Hooked up the SBSection to the __repr__ so you can print section
objects from within python.
Improved the dumping of symbols from python.
Fixed the .i interface references which were set to "Relative to this Group"
which somehow included Jim's "lldb-clean" root directory in the path. The
interfaces are now in a folder called "interfaces" withing the Xcode API
subfolder.
llvm-svn: 140451
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/include/lldb/API/SBData.h | 2 | ||||
-rw-r--r-- | lldb/include/lldb/API/SBSection.h | 7 | ||||
-rw-r--r-- | lldb/include/lldb/API/SBStream.h | 1 | ||||
-rw-r--r-- | lldb/lldb.xcodeproj/project.pbxproj | 155 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBData.i | 2 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBSection.i | 3 | ||||
-rw-r--r-- | lldb/scripts/Python/python-extensions.swig | 7 | ||||
-rw-r--r-- | lldb/source/API/SBData.cpp | 4 | ||||
-rw-r--r-- | lldb/source/API/SBSection.cpp | 16 | ||||
-rw-r--r-- | lldb/source/Symbol/Symbol.cpp | 15 |
10 files changed, 125 insertions, 87 deletions
diff --git a/lldb/include/lldb/API/SBData.h b/lldb/include/lldb/API/SBData.h index a2006482e92..47d779fb01c 100644 --- a/lldb/include/lldb/API/SBData.h +++ b/lldb/include/lldb/API/SBData.h @@ -90,7 +90,7 @@ public: size_t size); bool - GetDescription (lldb::SBStream &description); + GetDescription (lldb::SBStream &description, lldb::addr_t base_addr = LLDB_INVALID_ADDRESS); // it would be nice to have SetData(SBError, const void*, size_t) when endianness and address size can be // inferred from the existing DataExtractor, but having two SetData() signatures triggers a SWIG bug where diff --git a/lldb/include/lldb/API/SBSection.h b/lldb/include/lldb/API/SBSection.h index 04a3815446c..84bb3b81694 100644 --- a/lldb/include/lldb/API/SBSection.h +++ b/lldb/include/lldb/API/SBSection.h @@ -57,9 +57,12 @@ public: GetFileByteSize (); lldb::SBData - GetSectionData (uint64_t offset = 0, - uint64_t size = UINT64_MAX); + GetSectionData (); + lldb::SBData + GetSectionData (uint64_t offset, + uint64_t size); + SectionType GetSectionType (); diff --git a/lldb/include/lldb/API/SBStream.h b/lldb/include/lldb/API/SBStream.h index 30c4d2724dd..3c133423043 100644 --- a/lldb/include/lldb/API/SBStream.h +++ b/lldb/include/lldb/API/SBStream.h @@ -69,6 +69,7 @@ protected: friend class SBInstruction; friend class SBInstructionList; friend class SBModule; + friend class SBSection; friend class SBSourceManager_impl; friend class SBSymbol; friend class SBSymbolContext; diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index f88d0d20a0b..38f71fb9d71 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -598,6 +598,43 @@ 260E07C9136FABAC00CF21D3 /* OptionGroupFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupFile.h; path = include/lldb/Interpreter/OptionGroupFile.h; sourceTree = "<group>"; }; 26109B3B1155D70100CC3529 /* LogChannelDWARF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogChannelDWARF.cpp; sourceTree = "<group>"; }; 26109B3C1155D70100CC3529 /* LogChannelDWARF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogChannelDWARF.h; sourceTree = "<group>"; }; + 2611FEEF142D83060017FEA3 /* SBAddress.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBAddress.i; sourceTree = "<group>"; }; + 2611FEF0142D83060017FEA3 /* SBBlock.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBlock.i; sourceTree = "<group>"; }; + 2611FEF1142D83060017FEA3 /* SBBreakpoint.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBreakpoint.i; sourceTree = "<group>"; }; + 2611FEF2142D83060017FEA3 /* SBBreakpointLocation.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBreakpointLocation.i; sourceTree = "<group>"; }; + 2611FEF3142D83060017FEA3 /* SBBroadcaster.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBroadcaster.i; sourceTree = "<group>"; }; + 2611FEF4142D83060017FEA3 /* SBCommandInterpreter.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCommandInterpreter.i; sourceTree = "<group>"; }; + 2611FEF5142D83060017FEA3 /* SBCommandReturnObject.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCommandReturnObject.i; sourceTree = "<group>"; }; + 2611FEF6142D83060017FEA3 /* SBCommunication.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCommunication.i; sourceTree = "<group>"; }; + 2611FEF7142D83060017FEA3 /* SBCompileUnit.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCompileUnit.i; sourceTree = "<group>"; }; + 2611FEF8142D83060017FEA3 /* SBData.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBData.i; sourceTree = "<group>"; }; + 2611FEF9142D83060017FEA3 /* SBDebugger.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBDebugger.i; sourceTree = "<group>"; }; + 2611FEFA142D83060017FEA3 /* SBError.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBError.i; sourceTree = "<group>"; }; + 2611FEFB142D83060017FEA3 /* SBEvent.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBEvent.i; sourceTree = "<group>"; }; + 2611FEFC142D83060017FEA3 /* SBFileSpec.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFileSpec.i; sourceTree = "<group>"; }; + 2611FEFD142D83060017FEA3 /* SBFileSpecList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFileSpecList.i; sourceTree = "<group>"; }; + 2611FEFE142D83060017FEA3 /* SBFrame.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFrame.i; sourceTree = "<group>"; }; + 2611FEFF142D83060017FEA3 /* SBFunction.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFunction.i; sourceTree = "<group>"; }; + 2611FF00142D83060017FEA3 /* SBHostOS.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBHostOS.i; sourceTree = "<group>"; }; + 2611FF01142D83060017FEA3 /* SBInputReader.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBInputReader.i; sourceTree = "<group>"; }; + 2611FF02142D83060017FEA3 /* SBInstruction.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBInstruction.i; sourceTree = "<group>"; }; + 2611FF03142D83060017FEA3 /* SBInstructionList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBInstructionList.i; sourceTree = "<group>"; }; + 2611FF04142D83060017FEA3 /* SBLineEntry.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBLineEntry.i; sourceTree = "<group>"; }; + 2611FF05142D83060017FEA3 /* SBListener.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBListener.i; sourceTree = "<group>"; }; + 2611FF06142D83060017FEA3 /* SBModule.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBModule.i; sourceTree = "<group>"; }; + 2611FF07142D83060017FEA3 /* SBProcess.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBProcess.i; sourceTree = "<group>"; }; + 2611FF08142D83060017FEA3 /* SBSection.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSection.i; sourceTree = "<group>"; }; + 2611FF09142D83060017FEA3 /* SBSourceManager.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSourceManager.i; sourceTree = "<group>"; }; + 2611FF0A142D83060017FEA3 /* SBStream.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBStream.i; sourceTree = "<group>"; }; + 2611FF0B142D83060017FEA3 /* SBStringList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBStringList.i; sourceTree = "<group>"; }; + 2611FF0C142D83060017FEA3 /* SBSymbol.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSymbol.i; sourceTree = "<group>"; }; + 2611FF0D142D83060017FEA3 /* SBSymbolContext.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSymbolContext.i; sourceTree = "<group>"; }; + 2611FF0E142D83060017FEA3 /* SBSymbolContextList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSymbolContextList.i; sourceTree = "<group>"; }; + 2611FF0F142D83060017FEA3 /* SBTarget.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTarget.i; sourceTree = "<group>"; }; + 2611FF10142D83060017FEA3 /* SBThread.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBThread.i; sourceTree = "<group>"; }; + 2611FF11142D83060017FEA3 /* SBType.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBType.i; sourceTree = "<group>"; }; + 2611FF12142D83060017FEA3 /* SBValue.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBValue.i; sourceTree = "<group>"; }; + 2611FF13142D83060017FEA3 /* SBValueList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBValueList.i; sourceTree = "<group>"; }; 2615DB841208A9C90021781D /* StopInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StopInfo.h; path = include/lldb/Target/StopInfo.h; sourceTree = "<group>"; }; 2615DB861208A9E40021781D /* StopInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StopInfo.cpp; path = source/Target/StopInfo.cpp; sourceTree = "<group>"; }; 2615DBC81208B5FC0021781D /* StopInfoMachException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StopInfoMachException.cpp; path = Utility/StopInfoMachException.cpp; sourceTree = "<group>"; }; @@ -1194,42 +1231,6 @@ 4CCA644913B40B82003BDF98 /* AppleObjCTrampolineHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleObjCTrampolineHandler.h; sourceTree = "<group>"; }; 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleThreadPlanStepThroughObjCTrampoline.cpp; sourceTree = "<group>"; }; 4CCA644B13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleThreadPlanStepThroughObjCTrampoline.h; sourceTree = "<group>"; }; - 4CCB54F3142D62A40059177B /* SBAddress.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBAddress.i; path = "../lldb-clean/scripts/Python/interface/SBAddress.i"; sourceTree = "<group>"; }; - 4CCB54F4142D62A40059177B /* SBBlock.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBBlock.i; path = "../lldb-clean/scripts/Python/interface/SBBlock.i"; sourceTree = "<group>"; }; - 4CCB54F5142D62A50059177B /* SBBreakpoint.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBBreakpoint.i; path = "../lldb-clean/scripts/Python/interface/SBBreakpoint.i"; sourceTree = "<group>"; }; - 4CCB54F6142D62A50059177B /* SBBreakpointLocation.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBBreakpointLocation.i; path = "../lldb-clean/scripts/Python/interface/SBBreakpointLocation.i"; sourceTree = "<group>"; }; - 4CCB54F7142D62A60059177B /* SBBroadcaster.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBBroadcaster.i; path = "../lldb-clean/scripts/Python/interface/SBBroadcaster.i"; sourceTree = "<group>"; }; - 4CCB54F8142D62A60059177B /* SBCommandInterpreter.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBCommandInterpreter.i; path = "../lldb-clean/scripts/Python/interface/SBCommandInterpreter.i"; sourceTree = "<group>"; }; - 4CCB54F9142D62A60059177B /* SBCommandReturnObject.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBCommandReturnObject.i; path = "../lldb-clean/scripts/Python/interface/SBCommandReturnObject.i"; sourceTree = "<group>"; }; - 4CCB54FA142D62A60059177B /* SBCommunication.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBCommunication.i; path = "../lldb-clean/scripts/Python/interface/SBCommunication.i"; sourceTree = "<group>"; }; - 4CCB54FB142D62A70059177B /* SBCompileUnit.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBCompileUnit.i; path = "../lldb-clean/scripts/Python/interface/SBCompileUnit.i"; sourceTree = "<group>"; }; - 4CCB54FC142D62A80059177B /* SBData.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBData.i; path = "../lldb-clean/scripts/Python/interface/SBData.i"; sourceTree = "<group>"; }; - 4CCB54FD142D62A80059177B /* SBDebugger.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBDebugger.i; path = "../lldb-clean/scripts/Python/interface/SBDebugger.i"; sourceTree = "<group>"; }; - 4CCB54FE142D62A80059177B /* SBError.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBError.i; path = "../lldb-clean/scripts/Python/interface/SBError.i"; sourceTree = "<group>"; }; - 4CCB54FF142D62A80059177B /* SBEvent.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBEvent.i; path = "../lldb-clean/scripts/Python/interface/SBEvent.i"; sourceTree = "<group>"; }; - 4CCB5500142D62A80059177B /* SBFileSpec.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBFileSpec.i; path = "../lldb-clean/scripts/Python/interface/SBFileSpec.i"; sourceTree = "<group>"; }; - 4CCB5501142D62AA0059177B /* SBFileSpecList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBFileSpecList.i; path = "../lldb-clean/scripts/Python/interface/SBFileSpecList.i"; sourceTree = "<group>"; }; - 4CCB5503142D62AB0059177B /* SBFrame.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBFrame.i; path = "../lldb-clean/scripts/Python/interface/SBFrame.i"; sourceTree = "<group>"; }; - 4CCB5504142D62AB0059177B /* SBFunction.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBFunction.i; path = "../lldb-clean/scripts/Python/interface/SBFunction.i"; sourceTree = "<group>"; }; - 4CCB5505142D62AB0059177B /* SBHostOS.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBHostOS.i; path = "../lldb-clean/scripts/Python/interface/SBHostOS.i"; sourceTree = "<group>"; }; - 4CCB5506142D62AB0059177B /* SBInputReader.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBInputReader.i; path = "../lldb-clean/scripts/Python/interface/SBInputReader.i"; sourceTree = "<group>"; }; - 4CCB5507142D62AB0059177B /* SBInstruction.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBInstruction.i; path = "../lldb-clean/scripts/Python/interface/SBInstruction.i"; sourceTree = "<group>"; }; - 4CCB5508142D62AC0059177B /* SBInstructionList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBInstructionList.i; path = "../lldb-clean/scripts/Python/interface/SBInstructionList.i"; sourceTree = "<group>"; }; - 4CCB5509142D62AC0059177B /* SBLineEntry.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBLineEntry.i; path = "../lldb-clean/scripts/Python/interface/SBLineEntry.i"; sourceTree = "<group>"; }; - 4CCB550A142D62AC0059177B /* SBListener.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBListener.i; path = "../lldb-clean/scripts/Python/interface/SBListener.i"; sourceTree = "<group>"; }; - 4CCB550B142D62AC0059177B /* SBModule.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBModule.i; path = "../lldb-clean/scripts/Python/interface/SBModule.i"; sourceTree = "<group>"; }; - 4CCB550C142D62AC0059177B /* SBProcess.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBProcess.i; path = "../lldb-clean/scripts/Python/interface/SBProcess.i"; sourceTree = "<group>"; }; - 4CCB550D142D62AC0059177B /* SBSourceManager.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBSourceManager.i; path = "../lldb-clean/scripts/Python/interface/SBSourceManager.i"; sourceTree = "<group>"; }; - 4CCB550E142D62AD0059177B /* SBStream.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBStream.i; path = "../lldb-clean/scripts/Python/interface/SBStream.i"; sourceTree = "<group>"; }; - 4CCB550F142D62B00059177B /* SBStringList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBStringList.i; path = "../lldb-clean/scripts/Python/interface/SBStringList.i"; sourceTree = "<group>"; }; - 4CCB5510142D62B10059177B /* SBSymbol.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBSymbol.i; path = "../lldb-clean/scripts/Python/interface/SBSymbol.i"; sourceTree = "<group>"; }; - 4CCB5511142D62B10059177B /* SBSymbolContext.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBSymbolContext.i; path = "../lldb-clean/scripts/Python/interface/SBSymbolContext.i"; sourceTree = "<group>"; }; - 4CCB5512142D62B10059177B /* SBSymbolContextList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBSymbolContextList.i; path = "../lldb-clean/scripts/Python/interface/SBSymbolContextList.i"; sourceTree = "<group>"; }; - 4CCB5513142D62B20059177B /* SBTarget.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBTarget.i; path = "../lldb-clean/scripts/Python/interface/SBTarget.i"; sourceTree = "<group>"; }; - 4CCB5514142D62B20059177B /* SBThread.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBThread.i; path = "../lldb-clean/scripts/Python/interface/SBThread.i"; sourceTree = "<group>"; }; - 4CCB5515142D62B20059177B /* SBType.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBType.i; path = "../lldb-clean/scripts/Python/interface/SBType.i"; sourceTree = "<group>"; }; - 4CCB5516142D62B20059177B /* SBValue.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBValue.i; path = "../lldb-clean/scripts/Python/interface/SBValue.i"; sourceTree = "<group>"; }; - 4CCB5517142D62B20059177B /* SBValueList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; name = SBValueList.i; path = "../lldb-clean/scripts/Python/interface/SBValueList.i"; sourceTree = "<group>"; }; 4CD0BD0C134BFAB600CB44D4 /* ValueObjectDynamicValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectDynamicValue.h; path = include/lldb/Core/ValueObjectDynamicValue.h; sourceTree = "<group>"; }; 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectDynamicValue.cpp; path = source/Core/ValueObjectDynamicValue.cpp; sourceTree = "<group>"; }; 4CEDAED311754F5E00E875A6 /* ThreadPlanStepUntil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepUntil.h; path = include/lldb/Target/ThreadPlanStepUntil.h; sourceTree = "<group>"; }; @@ -1679,6 +1680,51 @@ path = MacOSX; sourceTree = "<group>"; }; + 2611FEEE142D83060017FEA3 /* interface */ = { + isa = PBXGroup; + children = ( + 2611FEEF142D83060017FEA3 /* SBAddress.i */, + 2611FEF0142D83060017FEA3 /* SBBlock.i */, + 2611FEF1142D83060017FEA3 /* SBBreakpoint.i */, + 2611FEF2142D83060017FEA3 /* SBBreakpointLocation.i */, + 2611FEF3142D83060017FEA3 /* SBBroadcaster.i */, + 2611FEF4142D83060017FEA3 /* SBCommandInterpreter.i */, + 2611FEF5142D83060017FEA3 /* SBCommandReturnObject.i */, + 2611FEF6142D83060017FEA3 /* SBCommunication.i */, + 2611FEF7142D83060017FEA3 /* SBCompileUnit.i */, + 2611FEF8142D83060017FEA3 /* SBData.i */, + 2611FEF9142D83060017FEA3 /* SBDebugger.i */, + 2611FEFA142D83060017FEA3 /* SBError.i */, + 2611FEFB142D83060017FEA3 /* SBEvent.i */, + 2611FEFC142D83060017FEA3 /* SBFileSpec.i */, + 2611FEFD142D83060017FEA3 /* SBFileSpecList.i */, + 2611FEFE142D83060017FEA3 /* SBFrame.i */, + 2611FEFF142D83060017FEA3 /* SBFunction.i */, + 2611FF00142D83060017FEA3 /* SBHostOS.i */, + 2611FF01142D83060017FEA3 /* SBInputReader.i */, + 2611FF02142D83060017FEA3 /* SBInstruction.i */, + 2611FF03142D83060017FEA3 /* SBInstructionList.i */, + 2611FF04142D83060017FEA3 /* SBLineEntry.i */, + 2611FF05142D83060017FEA3 /* SBListener.i */, + 2611FF06142D83060017FEA3 /* SBModule.i */, + 2611FF07142D83060017FEA3 /* SBProcess.i */, + 2611FF08142D83060017FEA3 /* SBSection.i */, + 2611FF09142D83060017FEA3 /* SBSourceManager.i */, + 2611FF0A142D83060017FEA3 /* SBStream.i */, + 2611FF0B142D83060017FEA3 /* SBStringList.i */, + 2611FF0C142D83060017FEA3 /* SBSymbol.i */, + 2611FF0D142D83060017FEA3 /* SBSymbolContext.i */, + 2611FF0E142D83060017FEA3 /* SBSymbolContextList.i */, + 2611FF0F142D83060017FEA3 /* SBTarget.i */, + 2611FF10142D83060017FEA3 /* SBThread.i */, + 2611FF11142D83060017FEA3 /* SBType.i */, + 2611FF12142D83060017FEA3 /* SBValue.i */, + 2611FF13142D83060017FEA3 /* SBValueList.i */, + ); + name = interface; + path = scripts/Python/interface; + sourceTree = SOURCE_ROOT; + }; 26274F9F14030EEF006BA130 /* Darwin-Kernel */ = { isa = PBXGroup; children = ( @@ -1700,6 +1746,7 @@ 262D3190111B4341004E6F88 /* API */ = { isa = PBXGroup; children = ( + 2611FEEE142D83060017FEA3 /* interface */, 26BC7C2510F1B3BC00F91463 /* lldb-defines.h */, 26BC7C2610F1B3BC00F91463 /* lldb-enumerations.h */, 26DE1E6A11616C2E00A093E2 /* lldb-forward.h */, @@ -1709,115 +1756,79 @@ 26B42C4C1187ABA50079C8C8 /* LLDB.h */, 9A9830FC1125FC5800A56CB0 /* SBDefines.h */, 26DE204211618ACA00A093E2 /* SBAddress.h */, - 4CCB54F3142D62A40059177B /* SBAddress.i */, 26DE204411618ADA00A093E2 /* SBAddress.cpp */, 26DE205611618FC500A093E2 /* SBBlock.h */, 26DE20601161902600A093E2 /* SBBlock.cpp */, - 4CCB54F4142D62A40059177B /* SBBlock.i */, 9AF16A9E11402D69007A7B3F /* SBBreakpoint.h */, 9AF16A9C11402D5B007A7B3F /* SBBreakpoint.cpp */, - 4CCB54F5142D62A50059177B /* SBBreakpoint.i */, 9AF16CC611408686007A7B3F /* SBBreakpointLocation.h */, 9AF16CC7114086A1007A7B3F /* SBBreakpointLocation.cpp */, - 4CCB54F6142D62A50059177B /* SBBreakpointLocation.i */, 9A9830F31125FC5800A56CB0 /* SBBroadcaster.h */, 9A9830F21125FC5800A56CB0 /* SBBroadcaster.cpp */, - 4CCB54F7142D62A60059177B /* SBBroadcaster.i */, 9A9830F71125FC5800A56CB0 /* SBCommandInterpreter.h */, 9A9830F61125FC5800A56CB0 /* SBCommandInterpreter.cpp */, - 4CCB54F8142D62A60059177B /* SBCommandInterpreter.i */, 9A9830F91125FC5800A56CB0 /* SBCommandReturnObject.h */, 9A9830F81125FC5800A56CB0 /* SBCommandReturnObject.cpp */, - 4CCB54F9142D62A60059177B /* SBCommandReturnObject.i */, 260223E7115F06D500A601A2 /* SBCommunication.h */, 260223E8115F06E500A601A2 /* SBCommunication.cpp */, - 4CCB54FA142D62A60059177B /* SBCommunication.i */, 26DE205411618FB800A093E2 /* SBCompileUnit.h */, 26DE205E1161901B00A093E2 /* SBCompileUnit.cpp */, - 4CCB54FB142D62A70059177B /* SBCompileUnit.i */, 9443B120140C18A90013457C /* SBData.h */, 9443B121140C18C10013457C /* SBData.cpp */, - 4CCB54FC142D62A80059177B /* SBData.i */, 9A9830FB1125FC5800A56CB0 /* SBDebugger.h */, 9A9830FA1125FC5800A56CB0 /* SBDebugger.cpp */, - 4CCB54FD142D62A80059177B /* SBDebugger.i */, 2682F286115EF3BD00CCFF99 /* SBError.h */, 2682F284115EF3A700CCFF99 /* SBError.cpp */, - 4CCB54FE142D62A80059177B /* SBError.i */, 9A9830FE1125FC5800A56CB0 /* SBEvent.h */, 9A9830FD1125FC5800A56CB0 /* SBEvent.cpp */, - 4CCB54FF142D62A80059177B /* SBEvent.i */, 26022531115F27FA00A601A2 /* SBFileSpec.h */, 26022532115F281400A601A2 /* SBFileSpec.cpp */, - 4CCB5500142D62A80059177B /* SBFileSpec.i */, 4CF52AF41428291E0051E832 /* SBFileSpecList.h */, 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */, - 4CCB5501142D62AA0059177B /* SBFileSpecList.i */, 9A633FE8112DCE3C001A7E43 /* SBFrame.h */, 9A633FE7112DCE3C001A7E43 /* SBFrame.cpp */, - 4CCB5503142D62AB0059177B /* SBFrame.i */, 26DE205211618FAC00A093E2 /* SBFunction.h */, 26DE205C1161901400A093E2 /* SBFunction.cpp */, - 4CCB5504142D62AB0059177B /* SBFunction.i */, 9A3576A7116E9AB700E8ED2F /* SBHostOS.h */, 9A3576A9116E9AC700E8ED2F /* SBHostOS.cpp */, - 4CCB5505142D62AB0059177B /* SBHostOS.i */, 9AA69DAE118A023300D753A0 /* SBInputReader.h */, 9AA69DB0118A024600D753A0 /* SBInputReader.cpp */, - 4CCB5506142D62AB0059177B /* SBInputReader.i */, 9AC7038D117674EB0086C050 /* SBInstruction.h */, 9AC703AE117675410086C050 /* SBInstruction.cpp */, - 4CCB5507142D62AB0059177B /* SBInstruction.i */, 9AC7038F117675270086C050 /* SBInstructionList.h */, 9AC703B0117675490086C050 /* SBInstructionList.cpp */, - 4CCB5508142D62AC0059177B /* SBInstructionList.i */, 26DE205811618FE700A093E2 /* SBLineEntry.h */, 26DE20621161904200A093E2 /* SBLineEntry.cpp */, - 4CCB5509142D62AC0059177B /* SBLineEntry.i */, 9A9831021125FC5800A56CB0 /* SBListener.h */, 9A9831011125FC5800A56CB0 /* SBListener.cpp */, - 4CCB550A142D62AC0059177B /* SBListener.i */, 26DE204E11618E9800A093E2 /* SBModule.h */, 26DE204C11618E7A00A093E2 /* SBModule.cpp */, - 4CCB550B142D62AC0059177B /* SBModule.i */, 9A9831041125FC5800A56CB0 /* SBProcess.h */, 9A9831031125FC5800A56CB0 /* SBProcess.cpp */, - 4CCB550C142D62AC0059177B /* SBProcess.i */, 26B8283C142D01E9002DBC64 /* SBSection.h */, 26B8283F142D020F002DBC64 /* SBSection.cpp */, 9A9831061125FC5800A56CB0 /* SBSourceManager.h */, 9A9831051125FC5800A56CB0 /* SBSourceManager.cpp */, - 4CCB550D142D62AC0059177B /* SBSourceManager.i */, 26C72C93124322890068DC16 /* SBStream.h */, 26C72C951243229A0068DC16 /* SBStream.cpp */, - 4CCB550E142D62AD0059177B /* SBStream.i */, 9A357670116E7B5200E8ED2F /* SBStringList.h */, 9A357672116E7B6400E8ED2F /* SBStringList.cpp */, - 4CCB550F142D62B00059177B /* SBStringList.i */, 26DE205A11618FF600A093E2 /* SBSymbol.h */, 26DE20641161904E00A093E2 /* SBSymbol.cpp */, - 4CCB5510142D62B10059177B /* SBSymbol.i */, 26DE204011618AB900A093E2 /* SBSymbolContext.h */, 26DE204611618AED00A093E2 /* SBSymbolContext.cpp */, - 4CCB5511142D62B10059177B /* SBSymbolContext.i */, 268F9D52123AA15200B91E9B /* SBSymbolContextList.h */, 268F9D54123AA16600B91E9B /* SBSymbolContextList.cpp */, - 4CCB5512142D62B10059177B /* SBSymbolContextList.i */, 9A9831081125FC5800A56CB0 /* SBTarget.h */, 9A9831071125FC5800A56CB0 /* SBTarget.cpp */, - 4CCB5513142D62B20059177B /* SBTarget.i */, 9A98310A1125FC5800A56CB0 /* SBThread.h */, 9A9831091125FC5800A56CB0 /* SBThread.cpp */, - 4CCB5514142D62B20059177B /* SBThread.i */, 2617447911685869005ADD65 /* SBType.h */, 261744771168585B005ADD65 /* SBType.cpp */, - 4CCB5515142D62B20059177B /* SBType.i */, 9A19A6A51163BB7E00E0D453 /* SBValue.h */, 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */, - 4CCB5516142D62B20059177B /* SBValue.i */, 9A357582116CFDEE00E8ED2F /* SBValueList.h */, 9A35758D116CFE0F00E8ED2F /* SBValueList.cpp */, - 4CCB5517142D62B20059177B /* SBValueList.i */, ); name = API; sourceTree = "<group>"; diff --git a/lldb/scripts/Python/interface/SBData.i b/lldb/scripts/Python/interface/SBData.i index 4e87e6e379f..5ecf2c26e1e 100644 --- a/lldb/scripts/Python/interface/SBData.i +++ b/lldb/scripts/Python/interface/SBData.i @@ -75,7 +75,7 @@ public: GetString (lldb::SBError& error, uint32_t offset); bool - GetDescription (lldb::SBStream &description); + GetDescription (lldb::SBStream &description, lldb::addr_t base_addr); size_t ReadRawData (lldb::SBError& error, diff --git a/lldb/scripts/Python/interface/SBSection.i b/lldb/scripts/Python/interface/SBSection.i index 990a7053f5f..38af7a11a01 100644 --- a/lldb/scripts/Python/interface/SBSection.i +++ b/lldb/scripts/Python/interface/SBSection.i @@ -54,6 +54,9 @@ public: GetFileByteSize (); lldb::SBData + GetSectionData (); + + lldb::SBData GetSectionData (uint64_t offset, uint64_t size); diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 64506994287..246fd97982e 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -118,6 +118,13 @@ return PyString_FromString (description.GetData()); } } +%extend lldb::SBSection { + PyObject *lldb::SBSection::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} %extend lldb::SBSymbol { PyObject *lldb::SBSymbol::__repr__ (){ lldb::SBStream description; diff --git a/lldb/source/API/SBData.cpp b/lldb/source/API/SBData.cpp index 58593416789..e3c1e43f25f 100644 --- a/lldb/source/API/SBData.cpp +++ b/lldb/source/API/SBData.cpp @@ -412,7 +412,7 @@ SBData::GetString (lldb::SBError& error, uint32_t offset) } bool -SBData::GetDescription (lldb::SBStream &description) +SBData::GetDescription (lldb::SBStream &description, lldb::addr_t base_addr) { if (m_opaque_sp) { @@ -423,7 +423,7 @@ SBData::GetDescription (lldb::SBStream &description) 1, m_opaque_sp->GetByteSize(), 16, - LLDB_INVALID_ADDRESS, + base_addr, 0, 0); } diff --git a/lldb/source/API/SBSection.cpp b/lldb/source/API/SBSection.cpp index 2636dd02136..3a6efb4d5f1 100644 --- a/lldb/source/API/SBSection.cpp +++ b/lldb/source/API/SBSection.cpp @@ -12,8 +12,9 @@ #include "lldb/Core/DataBuffer.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Section.h" #include "lldb/Core/Module.h" +#include "lldb/Core/Section.h" +#include "lldb/Core/StreamString.h" namespace lldb_private { @@ -238,6 +239,12 @@ SBSection::GetFileByteSize () } SBData +SBSection::GetSectionData () +{ + return GetSectionData (0, UINT64_MAX); +} + +SBData SBSection::GetSectionData (uint64_t offset, uint64_t size) { SBData sb_data; @@ -319,9 +326,12 @@ SBSection::operator != (const SBSection &rhs) bool SBSection::GetDescription (SBStream &description) { - if (m_opaque_ap.get()) + if (IsValid()) { - description.Printf ("SBSection"); + const Section *section = m_opaque_ap->GetSection(); + const addr_t file_addr = section->GetFileAddress(); + description.Printf ("[0x%16.16llx-0x%16.16llx) ", file_addr, file_addr + section->GetByteSize()); + section->DumpName(description.get()); } else { diff --git a/lldb/source/Symbol/Symbol.cpp b/lldb/source/Symbol/Symbol.cpp index 71caa5e3aa0..27780a939ad 100644 --- a/lldb/source/Symbol/Symbol.cpp +++ b/lldb/source/Symbol/Symbol.cpp @@ -177,6 +177,7 @@ void Symbol::GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) const { *s << "id = " << (const UserID&)*this << ", name = \"" << m_mangled.GetName() << '"'; + const Section *section = m_addr_range.GetBaseAddress().GetSection(); if (section != NULL) { @@ -194,12 +195,14 @@ Symbol::GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) } } else - { - if (m_size_is_sibling) - s->Printf (", sibling = %5llu", m_addr_range.GetBaseAddress().GetOffset()); - else - s->Printf (", value = 0x%16.16llx", m_addr_range.GetBaseAddress().GetOffset()); - } + s->Printf (", value = 0x%16.16llx", m_addr_range.GetBaseAddress().GetOffset()); + } + else + { + if (m_size_is_sibling) + s->Printf (", sibling = %5llu", m_addr_range.GetBaseAddress().GetOffset()); + else + s->Printf (", value = 0x%16.16llx", m_addr_range.GetBaseAddress().GetOffset()); } } |