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 ↗ | (On Diff #48735) | Can you do this separately? | 
| 572 ↗ | (On Diff #48735) | Can you do this separately? | 
| tools/llvm-readobj/StreamWriter.h | ||
| 62 ↗ | (On Diff #48735) | Can you make this change separately? | 
| tools/llvm-readobj/ELFDumper.cpp | ||
|---|---|---|
| 47 ↗ | (On Diff #48735) | Got it. Will do this. | 
| 272 ↗ | (On Diff #48735) | Will do. | 
| 523 ↗ | (On Diff #48735) | 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 ↗ | (On Diff #48735) | Same as above. | 
| tools/llvm-readobj/StreamWriter.h | ||
| 62 ↗ | (On Diff #48735) | Will do. | 
| tools/llvm-readobj/ELFDumper.cpp | ||
|---|---|---|
| 523 ↗ | (On Diff #48735) | 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 ↗ | (On Diff #48853) | 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 ↗ | (On Diff #48853) | 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 ↗ | (On Diff #48853) | 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 ↗ | (On Diff #48853) | 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 ↗ | (On Diff #48853) | Bias | 
| 2262 ↗ | (On Diff #48853) | 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 ↗ | (On Diff #48853) | 80 colums. | 
| 2406 ↗ | (On Diff #48853) | llvm style: Number, Type, Size, ... | 
Removed unneeded typedefs in base class and any to_string that was operand to << operator of raw_ostream.