mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 04:14:03 +08:00
LLDB: API for iPermission of object file's sections
Summary:
- Added an API to public interface that provides permissions (RWX) of
individual sections of an object file
- Earlier, there was no way to find out this information through SB
APIs
- A possible use case of this API is:
when a user wants to know the sections that have executable machine
instructions and want to write a tool on top of LLDB based on this
information
- Differential Revision: https://reviews.llvm.org/D24251
llvm-svn: 280924
This commit is contained in:
@@ -53,6 +53,21 @@ public:
|
||||
|
||||
SectionType GetSectionType();
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/// Gets the permissions (RWX) of the section of the object file
|
||||
///
|
||||
/// Returns a mask of bits of enum lldb::Permissions for this section.
|
||||
/// Sections for which permissions are not defined, 0 is returned for
|
||||
/// them. The binary representation of this value corresponds to [XRW]
|
||||
/// i.e. for a section having read and execute permissions, the value
|
||||
/// returned is 6
|
||||
///
|
||||
/// @return
|
||||
/// Returns an unsigned value for Permissions for the section.
|
||||
//------------------------------------------------------------------
|
||||
uint32_t
|
||||
GetPermissions() const;
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/// Return the size of a target's byte represented by this section
|
||||
/// in numbers of host bytes. Note that certain architectures have
|
||||
|
||||
@@ -90,6 +90,9 @@ public:
|
||||
SectionType
|
||||
GetSectionType ();
|
||||
|
||||
uint32_t
|
||||
GetPermissions() const;
|
||||
|
||||
%feature("docstring", "
|
||||
//------------------------------------------------------------------
|
||||
/// Return the size of a target's byte represented by this section
|
||||
|
||||
@@ -188,6 +188,15 @@ SectionType SBSection::GetSectionType() {
|
||||
return eSectionTypeInvalid;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
SBSection::GetPermissions() const
|
||||
{
|
||||
SectionSP section_sp(GetSP());
|
||||
if (section_sp)
|
||||
return section_sp->GetPermissions();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t SBSection::GetTargetByteSize() {
|
||||
SectionSP section_sp(GetSP());
|
||||
if (section_sp.get())
|
||||
|
||||
Reference in New Issue
Block a user