Implement output similar to:
readelf -rW
readelf -SW
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
A few inline comments to separate out some seemingly inconsequential changes. Otherwise the general idea seems fine, I haven't looked deeply at it, but a quick glance seemed like it was ok.
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
523 | Can you do this separately? | |
572 | Can you do this separately? | |
tools/llvm-readobj/StreamWriter.h | ||
62 | Can you make this change separately? |
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
47 | Got it. Will do this. | |
272 | Will do. | |
523 | This change was needed due to series of const functions that compiler figured out when I make the pointer to ELFDumper in the DumpStyle class a const pointer. ELFDumper.cpp:521:11: note: no known conversion for implicit 'this' parameter from 'const {anonymous}::ELFDumper<llvm::object::ELFType<(llvm::support::endianness)0u, true> >* const' to '{anonymous}::ELFDumper<llvm::object::ELFType<(llvm::support::endianness)0u, true> >*' | |
572 | Same as above. | |
tools/llvm-readobj/StreamWriter.h | ||
62 | Will do. |
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
523 | Sure, it just seems like that part of the change could be separable. Including the pointer? If not, that's fine too. |
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
523 | This is the patch that introduced the pointer. I would like to have it const from beginning instead of retrofitting in future as it will cause larger unneeded churn. |
Still LGTM. Thanks!
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
523 | Oh sure. Never that. First maybe, but not after. |
Thanks for implementing this. I do find the readelf output more human friendly. It is nice to have both in the same tool.!
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
271 | The usage of this looks pretty weird in code. I'd prefer we not use operator overloads that don't "do what the ints do". | |
2231 | We only use the ELF spec names for types and variables that _directly_ map to the ELF file. Please use the llvm naming convention for these. | |
2236 | Bias | |
2262 | format cannot directly take a packed_endian_specific_integral as it is not implemented in a type safe way. It directly passes everything to snprintf, which skips the byte swapping conversion operator. | |
2266 | 80 colums. | |
2406 | llvm style: Number, Type, Size, ... |
Removed unneeded typedefs in base class and any to_string that was operand to << operator of raw_ostream.
I would prefer this as:
#define TYPEDEF_ELF_TYPES(ELFT) ...
So that it's clear that it's a typedef and what it depends on.