This is an archive of the discontinued LLVM Phabricator instance.

LLDB: API for Permission of object file's sections
ClosedPublic

Authored by abhishek.aggarwal on Sep 6 2016, 4:44 AM.

Details

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

Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>

Diff Detail

Event Timeline

abhishek.aggarwal retitled this revision from to LLDB: API for Permission of object file's sections.
abhishek.aggarwal updated this object.
clayborg requested changes to this revision.Sep 6 2016, 9:36 AM
clayborg edited edge metadata.

Just add header doc and this is good to go.

include/lldb/API/SBSection.h
74

I know not everything is documented, but we should document this new call to let users know that the uint32_t will return a mask of bits from lldb::Permissions.

This revision now requires changes to proceed.Sep 6 2016, 9:36 AM

Please rebase code on trunk and run Clang-format.

abhishek.aggarwal edited edge metadata.

Changes based on review

  • Added header doc and ran clang-format on code
clayborg accepted this revision.Sep 7 2016, 8:44 AM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Sep 7 2016, 8:44 AM
Eugene.Zelenko added inline comments.Sep 7 2016, 10:17 AM
source/API/SBSection.cpp
257

You don't need to use get(), because smart pointers have http://en.cppreference.com/w/cpp/memory/shared_ptr/operator_bool. Will be good idea to remove it in other conditions in this file.

abhishek.aggarwal edited edge metadata.

Removed get() for shared_ptr

Already merged it in LLDb repo. So closing this revision.