[llvm] [llvm-objdump] Implement decoding auxiliary header for xcoff with llvm-objdump --private-headers (PR #105682)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 11 02:39:01 PDT 2024
================
@@ -67,6 +75,182 @@ void XCOFFDumper::printStrHex(StringRef Name, StringRef Str, uint64_t Value) {
<< ")\n";
}
+void XCOFFDumper::printBinary(StringRef Name, ArrayRef<uint8_t> B) {
+ unsigned OrgWidth = getWidth();
+ setWidth(0);
+ outs() << formatName(Name) << " (" << format_bytes(B) << ")\n";
+ setWidth(OrgWidth);
+}
+
+void XCOFFDumper::printAuxiliaryHeader() {
+ setWidth(36);
+ if (Obj.is64Bit())
+ printAuxiliaryHeader(Obj.auxiliaryHeader64());
+ else
+ printAuxiliaryHeader(Obj.auxiliaryHeader32());
+}
+
+enum PrintStyle { Hex, Number };
+template <typename T, typename V>
----------------
jh7370 wrote:
I'd suggest naming these template parameters to more clearly indicate what the type is supposed to be.
I'm also wondering whether this and `checkAndPrintAuxHeaderParseError` should be private members of the XCOFFDumper class, so that you don't need to make methods like `printHex` public.
https://github.com/llvm/llvm-project/pull/105682
More information about the llvm-commits
mailing list