[PATCH] D14128: Enable readobj to emit readelf like output.

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 14:23:43 PST 2016


echristo added a comment.

Some inline comments.


================
Comment at: tools/llvm-readobj/ELFDumper.cpp:1087-1090
@@ -1046,2 +1086,6 @@
   }
+  if (opts::GNUStyle)
+    ELFDumperStyle.reset(new GNUStyle<ELFT>(Writer.getOStream()));
+  else
+    ELFDumperStyle.reset(new LLVMStyle<ELFT>(Writer));
 }
----------------
Can we get these two things to use the same interface?

================
Comment at: tools/llvm-readobj/ELFDumper.cpp:2296
@@ +2295,3 @@
+  printFields("Entry point address:", Str);
+  Str = std::to_string(e->e_phoff) + " (bytes into file)";
+  printFields("Start of program headers:", Str);
----------------
khemant wrote:
> Some versions of Cygwin apparently have newlib that do not support std::to_string. There needs to be a change to remove these calls.
Is this an issue for any targets we have a bot for?

================
Comment at: tools/llvm-readobj/StreamWriter.cpp:15
@@ -12,1 +14,3 @@
+
+const std::string to_hexString(uint64_t Value, bool UpperCase) {
   // Zero is a special case.
----------------
Just use stringstream here?

================
Comment at: tools/llvm-readobj/StreamWriter.h:29
@@ -28,2 +28,3 @@
   StringRef Name;
+  StringRef AltName;
   T Value;
----------------
More descriptive/comment relating it to the option would be good.


Repository:
  rL LLVM

http://reviews.llvm.org/D14128





More information about the llvm-commits mailing list