[PATCH] D149095: [llvm-objdump] Support CHPE code ranges in disassembler.

Jacek Caban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 15:44:04 PDT 2023


jacek added inline comments.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1126
+  if (It == MappingSymbols.begin() ||
+      ((--It)->first < SectionAddress && islower(It->second)))
     return '\x00';
----------------
MaskRay wrote:
> Why is this `islower` change?
CHPE ranges, marked with upper letters, can cross section section boundaries. I will add a comment to clarify that.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1433
+        for (uint32_t i = 0; i < CHPEMetadata->CodeMapCount; ++i) {
+          if ((CodeMap[i].StartOffset & 3) != CHPE_RANGE_AMD64 ||
+              !CodeMap[i].Length)
----------------
jhenderson wrote:
> It might be worth either replacing the "3" literal here and below with a named constant, or at least adding a comment explaining why "3" for those not familiar with the area.
I added a constant and moved that logic to chpe_range_entry itself. If it looks fine to you, I will follow up and use it in llvm-readobj, where we have another instance of it.


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

https://reviews.llvm.org/D149095



More information about the llvm-commits mailing list