diff options
-rw-r--r-- | lldb/lldb.xcodeproj/project.pbxproj | 12 | ||||
-rw-r--r-- | lldb/scripts/Python/python-extensions.swig | 16 | ||||
-rw-r--r-- | lldb/scripts/interface/SBMemoryRegionInfo.i | 55 | ||||
-rw-r--r-- | lldb/scripts/interface/SBMemoryRegionInfoList.i | 38 | ||||
-rw-r--r-- | lldb/scripts/interface/SBProcess.i | 6 | ||||
-rw-r--r-- | lldb/scripts/lldb.swig | 4 |
6 files changed, 131 insertions, 0 deletions
diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index 7522ab79e51..4e63c2a3e40 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -150,6 +150,8 @@ 263E949F13661AEA00E7D1CE /* UnwindAssembly-x86.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263E949D13661AE400E7D1CE /* UnwindAssembly-x86.cpp */; }; 263FDE601A79A01500E68013 /* FormatEntity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263FDE5F1A79A01500E68013 /* FormatEntity.cpp */; }; 2640E19F15DC78FD00F23B50 /* Property.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2640E19E15DC78FD00F23B50 /* Property.cpp */; }; + 264297571D1DF247003F2BF4 /* SBMemoryRegionInfoList.h in Headers */ = {isa = PBXBuildFile; fileRef = 264297541D1DF209003F2BF4 /* SBMemoryRegionInfoList.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 264297581D1DF250003F2BF4 /* SBMemoryRegionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 264297531D1DF209003F2BF4 /* SBMemoryRegionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2642FBAE13D003B400ED6808 /* CommunicationKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBA813D003B400ED6808 /* CommunicationKDP.cpp */; }; 2642FBB013D003B400ED6808 /* ProcessKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBAA13D003B400ED6808 /* ProcessKDP.cpp */; }; 2642FBB213D003B400ED6808 /* ProcessKDPLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBAC13D003B400ED6808 /* ProcessKDPLog.cpp */; }; @@ -1461,6 +1463,10 @@ 2640E19E15DC78FD00F23B50 /* Property.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Property.cpp; path = source/Interpreter/Property.cpp; sourceTree = "<group>"; }; 26424E3C125986CB0016D82C /* ValueObjectConstResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResult.cpp; path = source/Core/ValueObjectConstResult.cpp; sourceTree = "<group>"; }; 26424E3E125986D30016D82C /* ValueObjectConstResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResult.h; path = include/lldb/Core/ValueObjectConstResult.h; sourceTree = "<group>"; }; + 264297531D1DF209003F2BF4 /* SBMemoryRegionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBMemoryRegionInfo.h; path = include/lldb/API/SBMemoryRegionInfo.h; sourceTree = "<group>"; }; + 264297541D1DF209003F2BF4 /* SBMemoryRegionInfoList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBMemoryRegionInfoList.h; path = include/lldb/API/SBMemoryRegionInfoList.h; sourceTree = "<group>"; }; + 264297591D1DF2AA003F2BF4 /* SBMemoryRegionInfo.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBMemoryRegionInfo.i; sourceTree = "<group>"; }; + 2642975A1D1DF2AA003F2BF4 /* SBMemoryRegionInfoList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBMemoryRegionInfoList.i; sourceTree = "<group>"; }; 2642FBA813D003B400ED6808 /* CommunicationKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommunicationKDP.cpp; sourceTree = "<group>"; }; 2642FBA913D003B400ED6808 /* CommunicationKDP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommunicationKDP.h; sourceTree = "<group>"; }; 2642FBAA13D003B400ED6808 /* ProcessKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessKDP.cpp; sourceTree = "<group>"; }; @@ -3492,6 +3498,8 @@ 2611FF03142D83060017FEA3 /* SBInstructionList.i */, 2611FF04142D83060017FEA3 /* SBLineEntry.i */, 2611FF05142D83060017FEA3 /* SBListener.i */, + 264297591D1DF2AA003F2BF4 /* SBMemoryRegionInfo.i */, + 2642975A1D1DF2AA003F2BF4 /* SBMemoryRegionInfoList.i */, 2611FF06142D83060017FEA3 /* SBModule.i */, 263C493B178B61CC0070F12D /* SBModuleSpec.i */, 262F12B8183546C900AEB384 /* SBPlatform.i */, @@ -3602,7 +3610,9 @@ 26DE20621161904200A093E2 /* SBLineEntry.cpp */, 9A9831021125FC5800A56CB0 /* SBListener.h */, 9A9831011125FC5800A56CB0 /* SBListener.cpp */, + 264297531D1DF209003F2BF4 /* SBMemoryRegionInfo.h */, 23DCEA421D1C4C6900A602B4 /* SBMemoryRegionInfo.cpp */, + 264297541D1DF209003F2BF4 /* SBMemoryRegionInfoList.h */, 23DCEA431D1C4C6900A602B4 /* SBMemoryRegionInfoList.cpp */, 26DE204E11618E9800A093E2 /* SBModule.h */, 26DE204C11618E7A00A093E2 /* SBModule.cpp */, @@ -6000,8 +6010,10 @@ 26680225115FD13D008E1FE4 /* SBFrame.h in Headers */, 26DE205311618FAC00A093E2 /* SBFunction.h in Headers */, 9A3576A8116E9AB700E8ED2F /* SBHostOS.h in Headers */, + 264297571D1DF247003F2BF4 /* SBMemoryRegionInfoList.h in Headers */, 9AC7038E117674FB0086C050 /* SBInstruction.h in Headers */, 9AC70390117675270086C050 /* SBInstructionList.h in Headers */, + 264297581D1DF250003F2BF4 /* SBMemoryRegionInfo.h in Headers */, 26DE205911618FE700A093E2 /* SBLineEntry.h in Headers */, 254FBB971A81B03100BD6378 /* SBLaunchInfo.h in Headers */, AF0EBBED185941360059E52F /* SBQueueItem.h in Headers */, diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 487bf1e3599..693b06b9aab 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -325,6 +325,22 @@ return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } + +%extend lldb::SBMemoryRegionInfo { + PyObject *lldb::SBMemoryRegionInfo::__str__ (){ + lldb::SBStream description; + $self->GetDescription (description); + const char *desc = description.GetData(); + size_t desc_len = description.GetSize(); + if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) + --desc_len; + if (desc_len > 0) + return lldb_private::PythonString(llvm::StringRef(desc, desc_len)).release(); + else + return lldb_private::PythonString("").release(); + } +} + %extend lldb::SBModule { PyObject *lldb::SBModule::__str__ (){ lldb::SBStream description; diff --git a/lldb/scripts/interface/SBMemoryRegionInfo.i b/lldb/scripts/interface/SBMemoryRegionInfo.i new file mode 100644 index 00000000000..b38a290b940 --- /dev/null +++ b/lldb/scripts/interface/SBMemoryRegionInfo.i @@ -0,0 +1,55 @@ +//===-- SWIG Interface for SBMemoryRegionInfo -------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +namespace lldb { + +%feature("docstring", +"API clients can get information about memory regions in processes." +) SBMemoryRegionInfo; + +class SBMemoryRegionInfo +{ +public: + + SBMemoryRegionInfo (); + + SBMemoryRegionInfo (const lldb::SBMemoryRegionInfo &rhs); + + ~SBMemoryRegionInfo (); + + void + Clear(); + + lldb::addr_t + GetRegionBase (); + + lldb::addr_t + GetRegionEnd (); + + bool + IsReadable (); + + bool + IsWritable (); + + bool + IsExecutable (); + + bool + operator == (const lldb::SBMemoryRegionInfo &rhs) const; + + bool + operator != (const lldb::SBMemoryRegionInfo &rhs) const; + + bool + GetDescription (lldb::SBStream &description); + +}; + +} // namespace lldb diff --git a/lldb/scripts/interface/SBMemoryRegionInfoList.i b/lldb/scripts/interface/SBMemoryRegionInfoList.i new file mode 100644 index 00000000000..f4624114554 --- /dev/null +++ b/lldb/scripts/interface/SBMemoryRegionInfoList.i @@ -0,0 +1,38 @@ +//===-- SBMemoryRegionInfoList.h --------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +namespace lldb { + +class SBMemoryRegionInfoList +{ +public: + + SBMemoryRegionInfoList (); + + SBMemoryRegionInfoList (const lldb::SBMemoryRegionInfoList &rhs); + + ~SBMemoryRegionInfoList (); + + uint32_t + GetSize () const; + + bool + GetMemoryRegionAtIndex (uint32_t idx, SBMemoryRegionInfo ®ion_info); + + void + Append (lldb::SBMemoryRegionInfo ®ion); + + void + Append (lldb::SBMemoryRegionInfoList ®ion_list); + + void + Clear (); +}; + +} // namespace lldb diff --git a/lldb/scripts/interface/SBProcess.i b/lldb/scripts/interface/SBProcess.i index 0ce45f7d7be..2ed3e99c90b 100644 --- a/lldb/scripts/interface/SBProcess.i +++ b/lldb/scripts/interface/SBProcess.i @@ -401,6 +401,12 @@ public: lldb::SBError SaveCore(const char *file_name); + lldb::SBError + GetMemoryRegionInfo(lldb::addr_t load_addr, lldb::SBMemoryRegionInfo ®ion_info); + + lldb::SBMemoryRegionInfoList + GetMemoryRegions(); + %pythoncode %{ def __get_is_alive__(self): '''Returns "True" if the process is currently alive, "False" otherwise''' diff --git a/lldb/scripts/lldb.swig b/lldb/scripts/lldb.swig index 1d333540728..ee34da30fc1 100644 --- a/lldb/scripts/lldb.swig +++ b/lldb/scripts/lldb.swig @@ -83,6 +83,8 @@ import six #include "lldb/API/SBLaunchInfo.h" #include "lldb/API/SBLineEntry.h" #include "lldb/API/SBListener.h" +#include "lldb/API/SBMemoryRegionInfo.h" +#include "lldb/API/SBMemoryRegionInfoList.h" #include "lldb/API/SBModule.h" #include "lldb/API/SBModuleSpec.h" #include "lldb/API/SBPlatform.h" @@ -163,6 +165,8 @@ import six %include "./interface/SBLaunchInfo.i" %include "./interface/SBLineEntry.i" %include "./interface/SBListener.i" +%include "./interface/SBMemoryRegionInfo.i" +%include "./interface/SBMemoryRegionInfoList.i" %include "./interface/SBModule.i" %include "./interface/SBModuleSpec.i" %include "./interface/SBPlatform.i" |