Details
Diff Detail
Event Timeline
Thanks for working on this!
This needs some test coverage, you need to update test/tools/llvm-readobj/file-headers.test. Other comments inline.
tools/llvm-readobj/MachODumper.cpp | ||
---|---|---|
333–370 | Not sure about the convention of llvm-readobj, but you might want to call that MachHeader instead (The ELF one is called ElfHeader, and moreover this would nicely match name of the structure it is describing) | |
335–354 | I think this would be nicer with a little template helper to use the same code for dumping the common fields. And then just special case the Reserved field that appears only in the 64bits version (given the name, I'm wondering if it should be dumped at all). And most of the fields could be pretty-printed, you can take inspiration from what is done in ELFDumper and use the various enum/helpers in llvm/Support/MachO.h. |
Since llvm-readobj is a low-level inspection tool, the Reserved field should also be printed (even more so than unused fields).
Yeah. As I know, macho-dump does dump the reserved field for 64-bit version of Mach-O format, while otool -h and llvm-objdump don't.
tools/llvm-readobj/MachODumper.cpp | ||
---|---|---|
333–370 | Yeah, MachHeader is better. | |
333–370 | Maybe I am a bit overconcerned about this. Since it (the header) belongs to Mach-O format, is MachOHeader more suitable than MachHeader? | |
335–354 | Thanks for pointing it out. I will work on it soon. |
Hi Frederic,
If you have some free time this weekend, could you land it for me? Btw I don't have a subversion account yet and am not able to do it myself.
Thanks!
No problem, I'll do it before the end of the weekend. Sorry for the delay, I've been busy with other thinks.
Thanks!
Fred
I think this would be nicer with a little template helper to use the same code for dumping the common fields. And then just special case the Reserved field that appears only in the 64bits version (given the name, I'm wondering if it should be dumped at all).
And most of the fields could be pretty-printed, you can take inspiration from what is done in ELFDumper and use the various enum/helpers in llvm/Support/MachO.h.