[Lldb-commits] [PATCH] D128069: [lldb] add SBSection.alignment to python bindings

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 23 00:14:57 PDT 2022


labath added a comment.

In D128069#3602256 <https://reviews.llvm.org/D128069#3602256>, @dmlary wrote:

>> We should test any APIs we add in a python test IMHO.  Also testing that the ".alignment" property works
>
> Ok, I'll add tests for the added python function and property.
>
> Now for the hard part, what's the recommended way to access elf section details within python without using the function added in this commit?  I do not think it is safe to hard code the expected alignment in the test case as the default alignment may vary across architectures.  Shelling out to `readelf` and parsing is possible, but feels clunky; is there an existing function to get this data?

You can use yaml2obj to create sections with known alignments. You should be able to find examples of that in the existing tests (just grep for yaml2obj).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128069/new/

https://reviews.llvm.org/D128069



More information about the lldb-commits mailing list