Eric Christopher | 3680f88 | 2012-10-16 23:46:21 +0000 | [diff] [blame] | 1 | //===-- llvm-dwarfdump.cpp - Debug info dumping utility for llvm ----------===// |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This program is a utility that works like "dwarfdump". |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 14 | #include "llvm/ADT/STLExtras.h" |
Chandler Carruth | 4d88a1c | 2012-12-04 10:44:52 +0000 | [diff] [blame] | 15 | #include "llvm/ADT/Triple.h" |
Zachary Turner | 6489d7b | 2015-04-23 17:37:47 +0000 | [diff] [blame] | 16 | #include "llvm/DebugInfo/DIContext.h" |
| 17 | #include "llvm/DebugInfo/DWARF/DWARFContext.h" |
Adrian Prantl | 5fd3d49 | 2017-09-14 17:01:53 +0000 | [diff] [blame] | 18 | #include "llvm/Object/Archive.h" |
Frederic Riss | 4c5d357 | 2015-08-03 00:10:31 +0000 | [diff] [blame] | 19 | #include "llvm/Object/MachOUniversal.h" |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 20 | #include "llvm/Object/ObjectFile.h" |
Eric Christopher | 7c678de | 2012-11-07 23:22:07 +0000 | [diff] [blame] | 21 | #include "llvm/Object/RelocVisitor.h" |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 22 | #include "llvm/Support/CommandLine.h" |
| 23 | #include "llvm/Support/Debug.h" |
| 24 | #include "llvm/Support/Format.h" |
| 25 | #include "llvm/Support/ManagedStatic.h" |
| 26 | #include "llvm/Support/MemoryBuffer.h" |
Adrian Prantl | 8e7d3b9 | 2015-12-23 21:51:13 +0000 | [diff] [blame] | 27 | #include "llvm/Support/Path.h" |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 28 | #include "llvm/Support/PrettyStackTrace.h" |
| 29 | #include "llvm/Support/Signals.h" |
Reid Kleckner | a058736 | 2017-08-29 21:41:21 +0000 | [diff] [blame] | 30 | #include "llvm/Support/TargetSelect.h" |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 31 | #include "llvm/Support/raw_ostream.h" |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 32 | #include <algorithm> |
| 33 | #include <cstring> |
Eric Christopher | 7c678de | 2012-11-07 23:22:07 +0000 | [diff] [blame] | 34 | #include <string> |
Rafael Espindola | a6e9c3e | 2014-06-12 17:38:55 +0000 | [diff] [blame] | 35 | #include <system_error> |
Eric Christopher | 7c678de | 2012-11-07 23:22:07 +0000 | [diff] [blame] | 36 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 37 | using namespace llvm; |
| 38 | using namespace object; |
| 39 | |
Adrian Prantl | 7c5b45d | 2017-09-12 22:32:53 +0000 | [diff] [blame] | 40 | namespace { |
Adrian Prantl | b5abcc5 | 2017-09-15 22:47:16 +0000 | [diff] [blame] | 41 | using namespace llvm::cl; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 42 | |
Adrian Prantl | 7c5b45d | 2017-09-12 22:32:53 +0000 | [diff] [blame] | 43 | OptionCategory DwarfDumpCategory("Specific Options"); |
| 44 | static opt<bool> Help("h", desc("Alias for -help"), Hidden, |
| 45 | cat(DwarfDumpCategory)); |
| 46 | static list<std::string> |
| 47 | InputFilenames(Positional, desc("<input object files or .dSYM bundles>"), |
| 48 | ZeroOrMore, cat(DwarfDumpCategory)); |
| 49 | |
Adrian Prantl | b5abcc5 | 2017-09-15 22:47:16 +0000 | [diff] [blame] | 50 | cl::OptionCategory |
| 51 | SectionCategory("Section-specific Dump Options", |
| 52 | "These control which sections are dumped."); |
Adrian Prantl | 7c5b45d | 2017-09-12 22:32:53 +0000 | [diff] [blame] | 53 | static opt<bool> DumpAll("all", desc("Dump all debug info sections"), |
| 54 | cat(SectionCategory)); |
| 55 | static alias DumpAllAlias("a", desc("Alias for -all"), aliasopt(DumpAll)); |
Adrian Prantl | 7bc1b28 | 2017-09-11 22:59:45 +0000 | [diff] [blame] | 56 | |
Adrian Prantl | 3ae35eb | 2017-09-13 22:09:01 +0000 | [diff] [blame] | 57 | static unsigned DumpType = DIDT_Null; |
Adrian Prantl | 7bc1b28 | 2017-09-11 22:59:45 +0000 | [diff] [blame] | 58 | #define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME) \ |
Adrian Prantl | b5abcc5 | 2017-09-15 22:47:16 +0000 | [diff] [blame] | 59 | static opt<bool> Dump##ENUM_NAME(CMDLINE_NAME, \ |
| 60 | desc("Dump the " ELF_NAME " section"), \ |
| 61 | cat(SectionCategory)); |
Adrian Prantl | 7bc1b28 | 2017-09-11 22:59:45 +0000 | [diff] [blame] | 62 | #include "llvm/BinaryFormat/Dwarf.def" |
| 63 | #undef HANDLE_DWARF_SECTION |
Adrian Prantl | 3dcd122 | 2017-09-13 18:22:59 +0000 | [diff] [blame] | 64 | static opt<bool> DumpUUID("uuid", desc("Show the UUID for each architecture"), |
| 65 | cat(DwarfDumpCategory)); |
| 66 | static alias DumpUUIDAlias("u", desc("Alias for -uuid"), aliasopt(DumpUUID)); |
Eli Bendersky | 7a94daa | 2013-01-25 20:26:43 +0000 | [diff] [blame] | 67 | |
Adrian Prantl | 7c5b45d | 2017-09-12 22:32:53 +0000 | [diff] [blame] | 68 | static opt<bool> |
David Blaikie | 50cc27e | 2016-10-18 21:09:48 +0000 | [diff] [blame] | 69 | SummarizeTypes("summarize-types", |
Adrian Prantl | 7c5b45d | 2017-09-12 22:32:53 +0000 | [diff] [blame] | 70 | desc("Abbreviate the description of type unit entries")); |
| 71 | static opt<bool> Verify("verify", desc("Verify the DWARF debug info"), |
| 72 | cat(DwarfDumpCategory)); |
| 73 | static opt<bool> Quiet("quiet", desc("Use with -verify to not emit to STDOUT."), |
| 74 | cat(DwarfDumpCategory)); |
| 75 | static opt<bool> Verbose("verbose", |
| 76 | desc("Print more low-level encoding details"), |
| 77 | cat(DwarfDumpCategory)); |
| 78 | static alias VerboseAlias("v", desc("Alias for -verbose"), aliasopt(Verbose), |
| 79 | cat(DwarfDumpCategory)); |
| 80 | } // namespace |
Adrian Prantl | 318d119 | 2017-06-06 23:28:45 +0000 | [diff] [blame] | 81 | |
Davide Italiano | 4376ddb | 2015-07-26 05:35:59 +0000 | [diff] [blame] | 82 | static void error(StringRef Filename, std::error_code EC) { |
Alexey Samsonov | 85c7d66 | 2015-06-25 23:40:15 +0000 | [diff] [blame] | 83 | if (!EC) |
Davide Italiano | 4376ddb | 2015-07-26 05:35:59 +0000 | [diff] [blame] | 84 | return; |
Alexey Samsonov | 85c7d66 | 2015-06-25 23:40:15 +0000 | [diff] [blame] | 85 | errs() << Filename << ": " << EC.message() << "\n"; |
Davide Italiano | 4376ddb | 2015-07-26 05:35:59 +0000 | [diff] [blame] | 86 | exit(1); |
Alexey Samsonov | 85c7d66 | 2015-06-25 23:40:15 +0000 | [diff] [blame] | 87 | } |
| 88 | |
Adrian Prantl | 2611ffe | 2017-09-13 23:07:24 +0000 | [diff] [blame] | 89 | static DIDumpOptions getDumpOpts() { |
Jonas Devlieghere | 27476ce | 2017-09-13 09:43:05 +0000 | [diff] [blame] | 90 | DIDumpOptions DumpOpts; |
| 91 | DumpOpts.DumpType = DumpType; |
| 92 | DumpOpts.SummarizeTypes = SummarizeTypes; |
| 93 | DumpOpts.Verbose = Verbose; |
| 94 | return DumpOpts; |
| 95 | } |
| 96 | |
Adrian Prantl | 2611ffe | 2017-09-13 23:07:24 +0000 | [diff] [blame] | 97 | static bool dumpObjectFile(ObjectFile &Obj, Twine Filename) { |
Reid Kleckner | a058736 | 2017-08-29 21:41:21 +0000 | [diff] [blame] | 98 | std::unique_ptr<DWARFContext> DICtx = DWARFContext::create(Obj); |
| 99 | logAllUnhandledErrors(DICtx->loadRegisterInfo(Obj), errs(), |
| 100 | Filename.str() + ": "); |
Adrian Prantl | 3dcd122 | 2017-09-13 18:22:59 +0000 | [diff] [blame] | 101 | // The UUID dump already contains all the same information. |
| 102 | if (!(DumpType & DIDT_UUID) || DumpType == DIDT_All) |
Adrian Prantl | 3ae35eb | 2017-09-13 22:09:01 +0000 | [diff] [blame] | 103 | outs() << Filename << ":\tfile format " << Obj.getFileFormatName() << '\n'; |
Spyridoula Gravani | cc0d13a | 2017-06-12 19:04:28 +0000 | [diff] [blame] | 104 | |
Frederic Riss | 40c01793 | 2015-08-03 00:10:25 +0000 | [diff] [blame] | 105 | // Dump the complete DWARF structure. |
Adrian Prantl | b5abcc5 | 2017-09-15 22:47:16 +0000 | [diff] [blame] | 106 | DICtx->dump(outs(), getDumpOpts()); |
Adrian Prantl | 2611ffe | 2017-09-13 23:07:24 +0000 | [diff] [blame] | 107 | return true; |
Frederic Riss | 40c01793 | 2015-08-03 00:10:25 +0000 | [diff] [blame] | 108 | } |
| 109 | |
Adrian Prantl | 2611ffe | 2017-09-13 23:07:24 +0000 | [diff] [blame] | 110 | static bool verifyObjectFile(ObjectFile &Obj, Twine Filename) { |
Rafael Espindola | c398e67 | 2017-07-19 22:27:28 +0000 | [diff] [blame] | 111 | std::unique_ptr<DIContext> DICtx = DWARFContext::create(Obj); |
| 112 | |
Greg Clayton | 48432cf | 2017-05-01 22:07:02 +0000 | [diff] [blame] | 113 | // Verify the DWARF and exit with non-zero exit status if verification |
| 114 | // fails. |
| 115 | raw_ostream &stream = Quiet ? nulls() : outs(); |
| 116 | stream << "Verifying " << Filename.str() << ":\tfile format " |
| 117 | << Obj.getFileFormatName() << "\n"; |
Adrian Prantl | 2611ffe | 2017-09-13 23:07:24 +0000 | [diff] [blame] | 118 | bool Result = DICtx->verify(stream, DumpType, getDumpOpts()); |
Greg Clayton | 48432cf | 2017-05-01 22:07:02 +0000 | [diff] [blame] | 119 | if (Result) |
| 120 | stream << "No errors.\n"; |
| 121 | else |
| 122 | stream << "Errors detected.\n"; |
| 123 | return Result; |
| 124 | } |
| 125 | |
Adrian Prantl | d866b47 | 2017-09-13 23:16:13 +0000 | [diff] [blame] | 126 | static bool handleBuffer(StringRef Filename, MemoryBufferRef Buffer, |
Adrian Prantl | 5fd3d49 | 2017-09-14 17:01:53 +0000 | [diff] [blame] | 127 | std::function<bool(ObjectFile &, Twine)> HandleObj); |
| 128 | |
| 129 | static bool handleArchive(StringRef Filename, Archive &Arch, |
| 130 | std::function<bool(ObjectFile &, Twine)> HandleObj) { |
| 131 | bool Result = true; |
| 132 | Error Err = Error::success(); |
| 133 | for (auto Child : Arch.children(Err)) { |
| 134 | auto BuffOrErr = Child.getMemoryBufferRef(); |
| 135 | error(Filename, errorToErrorCode(BuffOrErr.takeError())); |
| 136 | auto NameOrErr = Child.getName(); |
| 137 | error(Filename, errorToErrorCode(NameOrErr.takeError())); |
| 138 | std::string Name = (Filename + "(" + NameOrErr.get() + ")").str(); |
| 139 | Result &= handleBuffer(Name, BuffOrErr.get(), HandleObj); |
| 140 | } |
| 141 | error(Filename, errorToErrorCode(std::move(Err))); |
| 142 | |
| 143 | return Result; |
| 144 | } |
| 145 | |
| 146 | static bool handleBuffer(StringRef Filename, MemoryBufferRef Buffer, |
Adrian Prantl | 2611ffe | 2017-09-13 23:07:24 +0000 | [diff] [blame] | 147 | std::function<bool(ObjectFile &, Twine)> HandleObj) { |
Adrian Prantl | d866b47 | 2017-09-13 23:16:13 +0000 | [diff] [blame] | 148 | Expected<std::unique_ptr<Binary>> BinOrErr = object::createBinary(Buffer); |
Adrian Prantl | 5fd3d49 | 2017-09-14 17:01:53 +0000 | [diff] [blame] | 149 | error(Filename, errorToErrorCode(BinOrErr.takeError())); |
Jonas Devlieghere | 8ac8df0 | 2017-08-31 16:44:47 +0000 | [diff] [blame] | 150 | |
Greg Clayton | 48432cf | 2017-05-01 22:07:02 +0000 | [diff] [blame] | 151 | bool Result = true; |
| 152 | if (auto *Obj = dyn_cast<ObjectFile>(BinOrErr->get())) |
Adrian Prantl | 2611ffe | 2017-09-13 23:07:24 +0000 | [diff] [blame] | 153 | Result = HandleObj(*Obj, Filename); |
Greg Clayton | 48432cf | 2017-05-01 22:07:02 +0000 | [diff] [blame] | 154 | else if (auto *Fat = dyn_cast<MachOUniversalBinary>(BinOrErr->get())) |
| 155 | for (auto &ObjForArch : Fat->objects()) { |
Adrian Prantl | 5fd3d49 | 2017-09-14 17:01:53 +0000 | [diff] [blame] | 156 | std::string ObjName = |
| 157 | (Filename + "(" + ObjForArch.getArchFlagName() + ")").str(); |
| 158 | if (auto MachOOrErr = ObjForArch.getAsObjectFile()) { |
| 159 | Result &= HandleObj(**MachOOrErr, ObjName); |
| 160 | continue; |
| 161 | } else |
| 162 | consumeError(MachOOrErr.takeError()); |
| 163 | if (auto ArchiveOrErr = ObjForArch.getAsArchive()) { |
| 164 | error(ObjName, errorToErrorCode(ArchiveOrErr.takeError())); |
| 165 | Result &= handleArchive(ObjName, *ArchiveOrErr.get(), HandleObj); |
| 166 | continue; |
| 167 | } else |
| 168 | consumeError(ArchiveOrErr.takeError()); |
Greg Clayton | 48432cf | 2017-05-01 22:07:02 +0000 | [diff] [blame] | 169 | } |
Adrian Prantl | 5fd3d49 | 2017-09-14 17:01:53 +0000 | [diff] [blame] | 170 | else if (auto *Arch = dyn_cast<Archive>(BinOrErr->get())) |
| 171 | Result = handleArchive(Filename, *Arch, HandleObj); |
Greg Clayton | 48432cf | 2017-05-01 22:07:02 +0000 | [diff] [blame] | 172 | return Result; |
| 173 | } |
| 174 | |
Adrian Prantl | 2611ffe | 2017-09-13 23:07:24 +0000 | [diff] [blame] | 175 | static bool handleFile(StringRef Filename, |
| 176 | std::function<bool(ObjectFile &, Twine)> HandleObj) { |
| 177 | ErrorOr<std::unique_ptr<MemoryBuffer>> BuffOrErr = |
| 178 | MemoryBuffer::getFileOrSTDIN(Filename); |
| 179 | error(Filename, BuffOrErr.getError()); |
| 180 | std::unique_ptr<MemoryBuffer> Buffer = std::move(BuffOrErr.get()); |
| 181 | return handleBuffer(Filename, *Buffer, HandleObj); |
| 182 | } |
| 183 | |
Adrian Prantl | 8e7d3b9 | 2015-12-23 21:51:13 +0000 | [diff] [blame] | 184 | /// If the input path is a .dSYM bundle (as created by the dsymutil tool), |
| 185 | /// replace it with individual entries for each of the object files inside the |
| 186 | /// bundle otherwise return the input path. |
Benjamin Kramer | c321e53 | 2016-06-08 19:09:22 +0000 | [diff] [blame] | 187 | static std::vector<std::string> expandBundle(const std::string &InputPath) { |
Adrian Prantl | 8e7d3b9 | 2015-12-23 21:51:13 +0000 | [diff] [blame] | 188 | std::vector<std::string> BundlePaths; |
| 189 | SmallString<256> BundlePath(InputPath); |
| 190 | // Manually open up the bundle to avoid introducing additional dependencies. |
| 191 | if (sys::fs::is_directory(BundlePath) && |
| 192 | sys::path::extension(BundlePath) == ".dSYM") { |
| 193 | std::error_code EC; |
| 194 | sys::path::append(BundlePath, "Contents", "Resources", "DWARF"); |
| 195 | for (sys::fs::directory_iterator Dir(BundlePath, EC), DirEnd; |
| 196 | Dir != DirEnd && !EC; Dir.increment(EC)) { |
| 197 | const std::string &Path = Dir->path(); |
| 198 | sys::fs::file_status Status; |
| 199 | EC = sys::fs::status(Path, Status); |
| 200 | error(Path, EC); |
| 201 | switch (Status.type()) { |
| 202 | case sys::fs::file_type::regular_file: |
| 203 | case sys::fs::file_type::symlink_file: |
| 204 | case sys::fs::file_type::type_unknown: |
| 205 | BundlePaths.push_back(Path); |
| 206 | break; |
| 207 | default: /*ignore*/; |
| 208 | } |
| 209 | } |
| 210 | error(BundlePath, EC); |
| 211 | } |
| 212 | if (!BundlePaths.size()) |
| 213 | BundlePaths.push_back(InputPath); |
| 214 | return BundlePaths; |
| 215 | } |
| 216 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 217 | int main(int argc, char **argv) { |
| 218 | // Print a stack trace if we signal out. |
Richard Smith | 2ad6d48 | 2016-06-09 00:53:21 +0000 | [diff] [blame] | 219 | sys::PrintStackTraceOnErrorSignal(argv[0]); |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 220 | PrettyStackTraceProgram X(argc, argv); |
| 221 | llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. |
| 222 | |
Reid Kleckner | a058736 | 2017-08-29 21:41:21 +0000 | [diff] [blame] | 223 | llvm::InitializeAllTargetInfos(); |
| 224 | llvm::InitializeAllTargetMCs(); |
| 225 | |
Adrian Prantl | 7c5b45d | 2017-09-12 22:32:53 +0000 | [diff] [blame] | 226 | HideUnrelatedOptions({&DwarfDumpCategory, &SectionCategory}); |
| 227 | cl::ParseCommandLineOptions( |
| 228 | argc, argv, |
| 229 | "pretty-print DWARF debug information in object files" |
| 230 | " and debug info archives.\n"); |
| 231 | |
| 232 | if (Help) { |
| 233 | PrintHelpMessage(/*Hidden =*/false, /*Categorized =*/true); |
| 234 | return 0; |
| 235 | } |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 236 | |
Jonas Devlieghere | 8ac8df0 | 2017-08-31 16:44:47 +0000 | [diff] [blame] | 237 | // Defaults to dumping all sections, unless brief mode is specified in which |
| 238 | // case only the .debug_info section in dumped. |
Adrian Prantl | 7bc1b28 | 2017-09-11 22:59:45 +0000 | [diff] [blame] | 239 | #define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME) \ |
Adrian Prantl | b5abcc5 | 2017-09-15 22:47:16 +0000 | [diff] [blame] | 240 | if (Dump##ENUM_NAME) \ |
| 241 | DumpType |= DIDT_##ENUM_NAME; |
Adrian Prantl | 7bc1b28 | 2017-09-11 22:59:45 +0000 | [diff] [blame] | 242 | #include "llvm/BinaryFormat/Dwarf.def" |
| 243 | #undef HANDLE_DWARF_SECTION |
Adrian Prantl | 3dcd122 | 2017-09-13 18:22:59 +0000 | [diff] [blame] | 244 | if (DumpUUID) |
| 245 | DumpType |= DIDT_UUID; |
Adrian Prantl | 7bc1b28 | 2017-09-11 22:59:45 +0000 | [diff] [blame] | 246 | if (DumpAll) |
| 247 | DumpType = DIDT_All; |
Jonas Devlieghere | 8ac8df0 | 2017-08-31 16:44:47 +0000 | [diff] [blame] | 248 | if (DumpType == DIDT_Null) { |
Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 249 | if (Verbose) |
Jonas Devlieghere | 8ac8df0 | 2017-08-31 16:44:47 +0000 | [diff] [blame] | 250 | DumpType = DIDT_All; |
Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 251 | else |
| 252 | DumpType = DIDT_DebugInfo; |
Jonas Devlieghere | 8ac8df0 | 2017-08-31 16:44:47 +0000 | [diff] [blame] | 253 | } |
| 254 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 255 | // Defaults to a.out if no filenames specified. |
| 256 | if (InputFilenames.size() == 0) |
| 257 | InputFilenames.push_back("a.out"); |
| 258 | |
Adrian Prantl | 8e7d3b9 | 2015-12-23 21:51:13 +0000 | [diff] [blame] | 259 | // Expand any .dSYM bundles to the individual object files contained therein. |
| 260 | std::vector<std::string> Objects; |
Benjamin Kramer | 4fed928 | 2016-05-27 12:30:51 +0000 | [diff] [blame] | 261 | for (const auto &F : InputFilenames) { |
Adrian Prantl | 8e7d3b9 | 2015-12-23 21:51:13 +0000 | [diff] [blame] | 262 | auto Objs = expandBundle(F); |
| 263 | Objects.insert(Objects.end(), Objs.begin(), Objs.end()); |
| 264 | } |
| 265 | |
Greg Clayton | 48432cf | 2017-05-01 22:07:02 +0000 | [diff] [blame] | 266 | if (Verify) { |
| 267 | // If we encountered errors during verify, exit with a non-zero exit status. |
Adrian Prantl | 2611ffe | 2017-09-13 23:07:24 +0000 | [diff] [blame] | 268 | if (!std::all_of(Objects.begin(), Objects.end(), [](std::string Object) { |
| 269 | return handleFile(Object, verifyObjectFile); |
| 270 | })) |
Greg Clayton | 48432cf | 2017-05-01 22:07:02 +0000 | [diff] [blame] | 271 | exit(1); |
| 272 | } else { |
Adrian Prantl | 2611ffe | 2017-09-13 23:07:24 +0000 | [diff] [blame] | 273 | std::for_each(Objects.begin(), Objects.end(), [](std::string Object) { |
| 274 | handleFile(Object, dumpObjectFile); |
| 275 | }); |
Greg Clayton | 48432cf | 2017-05-01 22:07:02 +0000 | [diff] [blame] | 276 | } |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 277 | |
Davide Italiano | 4376ddb | 2015-07-26 05:35:59 +0000 | [diff] [blame] | 278 | return EXIT_SUCCESS; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 279 | } |