Details
- Reviewers
echristo jhenderson
Diff Detail
- Repository
- rL LLVM
Event Timeline
tools/llvm-objdump/llvm-objdump.cpp | ||
---|---|---|
2135 | Nit: Is there a need for the trailing whitespace in the output? |
I was going to ask for a documentation update, but it turns out that there is no documentation for llvm-objdump outside the help text...!
It looks to me like GNU objdump also prints some flags when -f is used. Is this something you plan to add later?
lib/Object/COFFObjectFile.cpp | ||
---|---|---|
916 | It looks like GNU objdump prints 0 rather than failing in this case. | |
test/tools/llvm-objdump/file-headers.test | ||
1 ↗ | (On Diff #153732) | I must admit that I'm surprised we're not using yaml2obj to test here. I am not familiar with llvm-objdump, and I see that using pre-canned binaries is normal for its tests, but how do you feel about using yaml2obj instead? Assuming you'd prefer to use pre-canned binaries, is it normal in the tests to use files that aren't specifically for that test? There should also probably be separate elf and coff test cases. |
tools/llvm-objdump/llvm-objdump.cpp | ||
2312 | Assuming this is what clang-format does, I suppose that this is right, but it definitely does make it a lot harder to follow :-( |
About the other informations: I think they are more "format specific" and thus I wanted to add an other patch for it. Do you want me to do it in this patch ?
lib/Object/COFFObjectFile.cpp | ||
---|---|---|
916 | Yes, I figured it out this night.. I really don't know why. Do you think we might follow the behavior ? | |
test/tools/llvm-objdump/file-headers.test | ||
1 ↗ | (On Diff #153732) | Yes, I anyway definitely need to add a COFF test. I can use yaml2obj here, this is not a problem for me, but as a lot of tests in this tool are doing this way, I just didn't want to break the move :) |
tools/llvm-objdump/llvm-objdump.cpp | ||
2135 | Absolutely not, fixing it ! | |
2312 | Woops, shouldn't have pushed this... will go back on this modification no worries :) |
No, I don't think it's that important, and I'm happy for that to be added later, when someone wants to add it.
lib/Object/COFFObjectFile.cpp | ||
---|---|---|
916 | I think it makes sense to. The other information in the file-headers dump is potentially useful, so preventing it being printed is bad (though if there's a clean way of not printing the address at all for COFF object files, I'm all for it not being printed in this case). | |
test/tools/llvm-objdump/file-headers.test | ||
1 ↗ | (On Diff #153732) | I think when we can do better, there's no reason to stick to the same pattern. Somebody needs to break the mould at some point! |
Looks fine to me, apart from a couple of test-related comments.
test/tools/llvm-objdump/file-headers-coff.test | ||
---|---|---|
13 | Does yaml2obj have support for PE-COFF too? If so, could you add a third test case, with a non-zero start address, please. | |
test/tools/llvm-objdump/file-headers-elf.test | ||
13 | Could you provide a non-zero start address, please, to show that the address is correctly read. |
test/tools/llvm-objdump/file-headers-coff.test | ||
---|---|---|
13 | Well, as you will see, I've done what I could about it.. There is a lot of useless flags to set to be able to build the PE file, but I didn't find another way to do it. |
Some inline comment nits, and one thing I noticed regarding the "not implemented" part.
test/tools/llvm-objdump/file-headers-pe.test | ||
---|---|---|
10 | those -> these Also add a full stop at the end of the line. | |
11–12 | All ... picked. They can't interfere ... here. (i.e. remove extra "values", change comma to full stop, fix typo, add trailing full stop). | |
28 | May be worth moving this particular field above the comment, since it is an important part of the test. | |
tools/llvm-objdump/llvm-objdump.cpp | ||
2135 | Hmmm... Should this use report_error? Or is not implemented normally reported on stdout? Also, how easy is to get a test that hits this case? If it's simple, I think it should have one. If not, no need to write a complicated one. |
test/tools/llvm-objdump/file-headers-coff.test | ||
---|---|---|
3 | One more thing: since --file-headers is an alias of -f, I'd like to see both tested, to show they do the same thing. It should just be a case of duplicating this line in each of the tests, but with the other version of the switch (the same goes with other similar changes, such as D48904). |
It looks like GNU objdump prints 0 rather than failing in this case.