[llvm] [llvm-objdump] Implement decoding auxiliary header for xcoff with llvm-objdump --private-headers (PR #105682)

zhijian lin via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 11:50:42 PDT 2024


================
@@ -67,6 +75,179 @@ 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);
----------------
diggerlin wrote:

> There's a lot of `setWidth` etc calls going on here, but I don't see any testing of the formatting for this case? I.e. if you removed one or other of these, I'm not sure you'd get a test failure?

I think following test it.

`# RUN: llvm-objdump --private-headers %t1_extra 2>&1 | FileCheck %s --check-prefix=EXTRA --match-full-lines --strict-whitespace`


https://github.com/llvm/llvm-project/pull/105682


More information about the llvm-commits mailing list