llvm-project/llvm/test/tools/llvm-objdump
Kevin Enderby 7a96942a6a Reapply r250906 with many suggested updates from Rafael Espindola.
The needed lld matching changes to be submitted immediately next,
but this revision will cause lld failures with this alone which is expected.

This removes the eating of the error in Archive::Child::getSize() when the characters
in the size field in the archive header for the member is not a number.  To do this we
have all of the needed methods return ErrorOr to push them up until we get out of lib.
Then the tools and can handle the error in whatever way is appropriate for that tool.

So the solution is to plumb all the ErrorOr stuff through everything that touches archives.
This include its iterators as one can create an Archive object but the first or any other
Child object may fail to be created due to a bad size field in its header.

Thanks to Lang Hames on the changes making child_iterator contain an
ErrorOr<Child> instead of a Child and the needed changes to ErrorOr.h to add
operator overloading for * and -> .

We don’t want to use llvm_unreachable() as it calls abort() and is produces a “crash”
and using report_fatal_error() to move the error checking will cause the program to
stop, neither of which are really correct in library code. There are still some uses of
these that should be cleaned up in this library code for other than the size field.

The test cases use archives with text files so one can see the non-digit character,
in this case a ‘%’, in the size field.

These changes will require corresponding changes to the lld project.  That will be
committed immediately after this change.  But this revision will cause lld failures
with this alone which is expected.

llvm-svn: 252192
2015-11-05 19:24:56 +00:00
..
AArch64 [PATCH] D13360: [llvm-objdump] Teach -d about AArch64 mapping symbols 2015-10-01 21:57:09 +00:00
ARM Have MachOObjectFile::isValidArch() accept armv7 2015-06-16 17:37:03 +00:00
Inputs Reapply r250906 with many suggested updates from Rafael Espindola. 2015-11-05 19:24:56 +00:00
X86 Tweak to r250117 and change to use ErrorOr and drop isSizeValid for 2015-10-13 20:48:04 +00:00
coff-file.test
coff-large-bss.test llvm-objdump: Skip empty sections when dumping contents 2014-11-11 09:58:25 +00:00
coff-many-relocs.test
coff-non-null-terminated-file.test
coff-private-headers.test
common-symbol-elf.test [Objdump] Output information about common symbols in a way closer to GNU objdump. 2015-01-23 20:06:24 +00:00
hex-relocation-addr.test
invalid-input.test Fix buildbot failure on Windows by relaxing test expectations. 2015-06-04 19:22:00 +00:00
macho-bad-ordinal.test [llvm-objdump] Update error message and add test case for mach-o file with bad library ordinals 2014-10-14 23:29:38 +00:00
macho-bind.test [llvm-objdump] clean up test cases now that build bots are green 2014-09-17 21:53:07 +00:00
macho-bind2.test [llvm-objdump] Fix mach-o binding decompression error 2014-10-18 01:21:02 +00:00
macho-compact-unwind-i386.test
macho-compact-unwind-x86_64.test
macho-exports-trie.test Fix test case to match correct llvm-objdump output 2014-09-03 01:34:58 +00:00
macho-lazy-bind.test [llvm-objdump] clean up test cases now that build bots are green 2014-09-17 21:53:07 +00:00
macho-rebase.test Stop suppress error messages in test case to see why one buildbot is failing 2014-09-12 22:46:01 +00:00
macho-sections.test llvm-objdump: Replace the -macho -raw option with a generic -raw-clang-ast 2015-07-08 02:04:15 +00:00
macho-unwind-info-arm64.test llvm-objdump: print contents of MachO __unwind_info sections 2014-08-12 11:52:59 +00:00
macho-unwind-info-no-relocs.test llvm-objdump: don't crash when __compact_unwind has no relocs. 2014-09-09 10:45:06 +00:00
macho-unwind-info-x86_64.test llvm-objdump: print contents of MachO __unwind_info sections 2014-08-12 11:52:59 +00:00
macho-weak-bind.test [llvm-objdump] clean up test cases now that build bots are green 2014-09-17 21:53:07 +00:00
malformed-archives.test Reapply r250906 with many suggested updates from Rafael Espindola. 2015-11-05 19:24:56 +00:00
proc-specific-section-elf.test [Objdump] Fixing crash when printing symbols in ELF sections with special types. 2015-02-18 23:00:22 +00:00
section-filter.test [llvm-objdump] Merging MachO DumpSections in to FilterSections. Simplifying some predicate logic. 2015-07-29 19:08:10 +00:00
win64-unwind-data.test