[Lldb-commits] [PATCH] D24251: LLDB: API for Permission of object file's sections

Abhishek via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 7 02:51:50 PDT 2016


abhishek.aggarwal updated this revision to Diff 70513.
abhishek.aggarwal added a comment.

Changes based on review

- Added header doc and ran clang-format on code


https://reviews.llvm.org/D24251

Files:
  include/lldb/API/SBSection.h
  scripts/interface/SBSection.i
  source/API/SBSection.cpp

Index: source/API/SBSection.cpp
===================================================================
--- source/API/SBSection.cpp
+++ source/API/SBSection.cpp
@@ -251,6 +251,15 @@
 }
 
 uint32_t
+SBSection::GetPermissions() const
+{
+    SectionSP section_sp(GetSP());
+    if (section_sp.get())
+        return section_sp->GetPermissions();
+    return 0;
+}
+
+uint32_t
 SBSection::GetTargetByteSize ()
 {
     SectionSP section_sp (GetSP());
Index: scripts/interface/SBSection.i
===================================================================
--- scripts/interface/SBSection.i
+++ scripts/interface/SBSection.i
@@ -90,6 +90,9 @@
     SectionType
     GetSectionType ();
 
+    uint32_t
+    GetPermissions() const;
+
     %feature("docstring", "
     //------------------------------------------------------------------
     /// Return the size of a target's byte represented by this section
Index: include/lldb/API/SBSection.h
===================================================================
--- include/lldb/API/SBSection.h
+++ include/lldb/API/SBSection.h
@@ -72,6 +72,21 @@
     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
     /// varying minimum addressable unit (i.e. byte) size for their 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24251.70513.patch
Type: text/x-patch
Size: 2096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160907/db42e35f/attachment.bin>


More information about the lldb-commits mailing list