1 //===-- llvm-dwarfdump.cpp - Debug info dumping utility for llvm ----------===//
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 
14 #include "llvm/ADT/STLExtras.h"
15 #include "llvm/ADT/StringSet.h"
16 #include "llvm/ADT/Triple.h"
17 #include "llvm/DebugInfo/DIContext.h"
18 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
19 #include "llvm/Object/Archive.h"
20 #include "llvm/Object/MachOUniversal.h"
21 #include "llvm/Object/ObjectFile.h"
22 #include "llvm/Object/RelocVisitor.h"
23 #include "llvm/Support/CommandLine.h"
24 #include "llvm/Support/Debug.h"
25 #include "llvm/Support/Format.h"
26 #include "llvm/Support/ManagedStatic.h"
27 #include "llvm/Support/MemoryBuffer.h"
28 #include "llvm/Support/Path.h"
29 #include "llvm/Support/PrettyStackTrace.h"
30 #include "llvm/Support/Regex.h"
31 #include "llvm/Support/Signals.h"
32 #include "llvm/Support/TargetSelect.h"
33 #include "llvm/Support/ToolOutputFile.h"
34 #include "llvm/Support/raw_ostream.h"
35 #include <algorithm>
36 #include <cstring>
37 #include <string>
38 #include <system_error>
39 
40 using namespace llvm;
41 using namespace object;
42 
43 /// Parser for options that take an optional offest argument.
44 /// @{
45 struct OffsetOption {
46   uint64_t Val = 0;
47   bool HasValue = false;
48   bool IsRequested = false;
49 };
50 
51 namespace llvm {
52 namespace cl {
53 template <>
54 class parser<OffsetOption> final : public basic_parser<OffsetOption> {
55 public:
56   parser(Option &O) : basic_parser(O) {}
57 
58   /// Return true on error.
59   bool parse(Option &O, StringRef ArgName, StringRef Arg, OffsetOption &Val) {
60     if (Arg == "") {
61       Val.Val = 0;
62       Val.HasValue = false;
63       Val.IsRequested = true;
64       return false;
65     }
66     if (Arg.getAsInteger(0, Val.Val))
67       return O.error("'" + Arg + "' value invalid for integer argument!");
68     Val.HasValue = true;
69     Val.IsRequested = true;
70     return false;
71   }
72 
73   enum ValueExpected getValueExpectedFlagDefault() const {
74     return ValueOptional;
75   }
76 
77   void printOptionInfo(const Option &O, size_t GlobalWidth) const {
78     outs() << "  -" << O.ArgStr;
79     Option::printHelpStr(O.HelpStr, GlobalWidth, getOptionWidth(O));
80   }
81 
82   void printOptionDiff(const Option &O, OffsetOption V, OptVal Default,
83                        size_t GlobalWidth) const {
84     printOptionName(O, GlobalWidth);
85     outs() << "[=offset]";
86   }
87 
88   // An out-of-line virtual method to provide a 'home' for this class.
89   void anchor() override {};
90 };
91 } // cl
92 } // llvm
93 
94 /// @}
95 /// Command line options.
96 /// @{
97 
98 namespace {
99 using namespace cl;
100 
101 OptionCategory DwarfDumpCategory("Specific Options");
102 static opt<bool> Help("h", desc("Alias for -help"), Hidden,
103                       cat(DwarfDumpCategory));
104 static list<std::string>
105     InputFilenames(Positional, desc("<input object files or .dSYM bundles>"),
106                    ZeroOrMore, cat(DwarfDumpCategory));
107 
108 cl::OptionCategory SectionCategory("Section-specific Dump Options",
109                                    "These control which sections are dumped. "
110                                    "Where applicable these parameters take an "
111                                    "optional =<offset> argument to dump only "
112                                    "the entry at the specified offset.");
113 
114 static opt<bool> DumpAll("all", desc("Dump all debug info sections"),
115                          cat(SectionCategory));
116 static alias DumpAllAlias("a", desc("Alias for -all"), aliasopt(DumpAll));
117 
118 // Options for dumping specific sections.
119 static unsigned DumpType = DIDT_Null;
120 static std::array<llvm::Optional<uint64_t>, (unsigned)DIDT_ID_Count>
121     DumpOffsets;
122 #define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME)                \
123   static opt<OffsetOption> Dump##ENUM_NAME(                                    \
124       CMDLINE_NAME, desc("Dump the " ELF_NAME " section"),                     \
125       cat(SectionCategory));
126 #include "llvm/BinaryFormat/Dwarf.def"
127 #undef HANDLE_DWARF_SECTION
128 
129 static alias DumpDebugFrameAlias("eh-frame", desc("Alias for -debug-frame"),
130                                  NotHidden, cat(SectionCategory),
131                                  aliasopt(DumpDebugFrame));
132 static list<std::string>
133     ArchFilters("arch",
134                 desc("Dump debug information for the specified CPU "
135                      "architecture only. Architectures may be specified by "
136                      "name or by number. This option can be specified "
137                      "multiple times, once for each desired architecture."),
138                 cat(DwarfDumpCategory));
139 static list<std::string>
140     Find("find",
141          desc("Search for the exact match for <name> in the accelerator tables "
142               "and print the matching debug information entries. When no "
143               "accelerator tables are available, the slower but more complete "
144               "-name option can be used instead."),
145          value_desc("name"), cat(DwarfDumpCategory));
146 static alias FindAlias("f", desc("Alias for -find."), aliasopt(Find));
147 static opt<bool>
148     IgnoreCase("ignore-case",
149                desc("Ignore case distinctions in when searching by name."),
150                value_desc("i"), cat(DwarfDumpCategory));
151 static alias IgnoreCaseAlias("i", desc("Alias for -ignore-case."),
152                              aliasopt(IgnoreCase));
153 static list<std::string> Name(
154     "name",
155     desc("Find and print all debug info entries whose name (DW_AT_name "
156          "attribute) matches the exact text in <pattern>.  When used with the "
157          "the -regex option <pattern> is interpreted as a regular expression."),
158     value_desc("pattern"), cat(DwarfDumpCategory));
159 static alias NameAlias("n", desc("Alias for -name"), aliasopt(Name));
160 static opt<unsigned>
161     Lookup("lookup",
162            desc("Lookup <address> in the debug information and print out any"
163                 "available file, function, block and line table details."),
164            value_desc("address"), cat(DwarfDumpCategory));
165 static opt<std::string>
166     OutputFilename("out-file", cl::init(""),
167                    cl::desc("Redirect output to the specified file."),
168                    cl::value_desc("filename"));
169 static alias OutputFilenameAlias("o", desc("Alias for -out-file."),
170                                  aliasopt(OutputFilename),
171                                  cat(DwarfDumpCategory));
172 static opt<bool>
173     UseRegex("regex",
174              desc("Treat any <pattern> strings as regular expressions when "
175                   "searching instead of just as an exact string match."),
176              cat(DwarfDumpCategory));
177 static alias RegexAlias("x", desc("Alias for -regex"), aliasopt(UseRegex));
178 static opt<bool>
179     ShowChildren("show-children",
180                  desc("Show a debug info entry's children when selectively "
181                       "printing with the =<offset> option."),
182                  cat(DwarfDumpCategory));
183 static alias ShowChildrenAlias("c", desc("Alias for -show-children."),
184                                aliasopt(ShowChildren));
185 static opt<bool>
186     ShowParents("show-parents",
187                 desc("Show a debug info entry's parents when selectively "
188                      "printing with the =<offset> option."),
189                 cat(DwarfDumpCategory));
190 static alias ShowParentsAlias("p", desc("Alias for -show-parents."),
191                               aliasopt(ShowParents));
192 static opt<bool>
193     ShowForm("show-form",
194              desc("Show DWARF form types after the DWARF attribute types."),
195              cat(DwarfDumpCategory));
196 static alias ShowFormAlias("F", desc("Alias for -show-form."),
197                            aliasopt(ShowForm), cat(DwarfDumpCategory));
198 static opt<unsigned> RecurseDepth(
199     "recurse-depth",
200     desc("Only recurse to a depth of N when displaying debug info entries."),
201     cat(DwarfDumpCategory), init(-1U), value_desc("N"));
202 static alias RecurseDepthAlias("r", desc("Alias for -recurse-depth."),
203                                aliasopt(RecurseDepth));
204 
205 static opt<bool>
206     SummarizeTypes("summarize-types",
207                    desc("Abbreviate the description of type unit entries."),
208                    cat(DwarfDumpCategory));
209 static cl::opt<bool>
210     Statistics("statistics",
211                cl::desc("Emit JSON-formatted debug info quality metrics."),
212                cat(DwarfDumpCategory));
213 static opt<bool> Verify("verify", desc("Verify the DWARF debug info."),
214                         cat(DwarfDumpCategory));
215 static opt<bool> Quiet("quiet", desc("Use with -verify to not emit to STDOUT."),
216                        cat(DwarfDumpCategory));
217 static opt<bool> DumpUUID("uuid", desc("Show the UUID for each architecture."),
218                           cat(DwarfDumpCategory));
219 static alias DumpUUIDAlias("u", desc("Alias for -uuid."), aliasopt(DumpUUID));
220 static opt<bool> Verbose("verbose",
221                          desc("Print more low-level encoding details."),
222                          cat(DwarfDumpCategory));
223 static alias VerboseAlias("v", desc("Alias for -verbose."), aliasopt(Verbose),
224                           cat(DwarfDumpCategory));
225 } // namespace
226 /// @}
227 //===----------------------------------------------------------------------===//
228 
229 static void error(StringRef Prefix, std::error_code EC) {
230   if (!EC)
231     return;
232   errs() << Prefix << ": " << EC.message() << "\n";
233   exit(1);
234 }
235 
236 static DIDumpOptions getDumpOpts() {
237   DIDumpOptions DumpOpts;
238   DumpOpts.DumpType = DumpType;
239   DumpOpts.RecurseDepth = RecurseDepth;
240   DumpOpts.ShowChildren = ShowChildren;
241   DumpOpts.ShowParents = ShowParents;
242   DumpOpts.ShowForm = ShowForm;
243   DumpOpts.SummarizeTypes = SummarizeTypes;
244   DumpOpts.Verbose = Verbose;
245   // In -verify mode, print DIEs without children in error messages.
246   if (Verify)
247     return DumpOpts.noImplicitRecursion();
248   return DumpOpts;
249 }
250 
251 static uint32_t getCPUType(MachOObjectFile &MachO) {
252   if (MachO.is64Bit())
253     return MachO.getHeader64().cputype;
254   else
255     return MachO.getHeader().cputype;
256 }
257 
258 /// Return true if the object file has not been filtered by an --arch option.
259 static bool filterArch(ObjectFile &Obj) {
260   if (ArchFilters.empty())
261     return true;
262 
263   if (auto *MachO = dyn_cast<MachOObjectFile>(&Obj)) {
264     std::string ObjArch =
265         Triple::getArchTypeName(MachO->getArchTriple().getArch());
266 
267     for (auto Arch : ArchFilters) {
268       // Match name.
269       if (Arch == ObjArch)
270         return true;
271 
272       // Match architecture number.
273       unsigned Value;
274       if (!StringRef(Arch).getAsInteger(0, Value))
275         if (Value == getCPUType(*MachO))
276           return true;
277     }
278   }
279   return false;
280 }
281 
282 using HandlerFn = std::function<bool(ObjectFile &, DWARFContext &DICtx, Twine,
283                                      raw_ostream &)>;
284 
285 /// Print only DIEs that have a certain name.
286 static void filterByName(const StringSet<> &Names,
287                          DWARFContext::cu_iterator_range CUs, raw_ostream &OS) {
288   for (const auto &CU : CUs)
289     for (const auto &Entry : CU->dies()) {
290       DWARFDie Die = {CU.get(), &Entry};
291       if (const char *NamePtr = Die.getName(DINameKind::ShortName)) {
292         std::string Name =
293             (IgnoreCase && !UseRegex) ? StringRef(NamePtr).lower() : NamePtr;
294         // Match regular expression.
295         if (UseRegex)
296           for (auto Pattern : Names.keys()) {
297             Regex RE(Pattern, IgnoreCase ? Regex::IgnoreCase : Regex::NoFlags);
298             std::string Error;
299             if (!RE.isValid(Error)) {
300               errs() << "error in regular expression: " << Error << "\n";
301               exit(1);
302             }
303             if (RE.match(Name))
304               Die.dump(OS, 0, getDumpOpts());
305           }
306         // Match full text.
307         else if (Names.count(Name))
308           Die.dump(OS, 0, getDumpOpts());
309       }
310     }
311 
312 }
313 
314 /// Handle the --lookup option and dump the DIEs and line info for the given
315 /// address.
316 static bool lookup(DWARFContext &DICtx, uint64_t Address, raw_ostream &OS) {
317   auto DIEsForAddr = DICtx.getDIEsForAddress(Lookup);
318 
319   if (!DIEsForAddr)
320     return false;
321 
322   DIDumpOptions DumpOpts = getDumpOpts();
323   DumpOpts.RecurseDepth = 0;
324   DIEsForAddr.CompileUnit->dump(OS, DumpOpts);
325   if (DIEsForAddr.FunctionDIE) {
326     DIEsForAddr.FunctionDIE.dump(OS, 2, DumpOpts);
327     if (DIEsForAddr.BlockDIE)
328       DIEsForAddr.BlockDIE.dump(OS, 4, DumpOpts);
329   }
330 
331   if (DILineInfo LineInfo = DICtx.getLineInfoForAddress(Lookup))
332     LineInfo.dump(OS);
333 
334   return true;
335 }
336 
337 bool collectStatsForObjectFile(ObjectFile &Obj, DWARFContext &DICtx,
338                                Twine Filename, raw_ostream &OS);
339 
340 static bool dumpObjectFile(ObjectFile &Obj, DWARFContext &DICtx, Twine Filename,
341                            raw_ostream &OS) {
342   logAllUnhandledErrors(DICtx.loadRegisterInfo(Obj), errs(),
343                         Filename.str() + ": ");
344   // The UUID dump already contains all the same information.
345   if (!(DumpType & DIDT_UUID) || DumpType == DIDT_All)
346     OS << Filename << ":\tfile format " << Obj.getFileFormatName() << '\n';
347 
348   // Handle the --lookup option.
349   if (Lookup)
350     return lookup(DICtx, Lookup, OS);
351 
352   // Handle the --name option.
353   if (!Name.empty()) {
354     StringSet<> Names;
355     for (auto name : Name)
356       Names.insert((IgnoreCase && !UseRegex) ? StringRef(name).lower() : name);
357 
358     filterByName(Names, DICtx.compile_units(), OS);
359     filterByName(Names, DICtx.dwo_compile_units(), OS);
360     return true;
361   }
362 
363   // Handle the --find option and lower it to --debug-info=<offset>.
364   if (!Find.empty()) {
365     DumpOffsets[DIDT_ID_DebugInfo] = [&]() -> llvm::Optional<uint64_t> {
366       for (auto Name : Find) {
367         auto find = [&](const DWARFAcceleratorTable &Accel)
368             -> llvm::Optional<uint64_t> {
369           for (auto Entry : Accel.equal_range(Name))
370             for (auto Atom : Entry)
371               if (auto Offset = Atom.getAsSectionOffset())
372                 return Offset;
373           return None;
374         };
375         if (auto Offset = find(DICtx.getAppleNames()))
376           return DumpOffsets[DIDT_ID_DebugInfo] = *Offset;
377         if (auto Offset = find(DICtx.getAppleTypes()))
378           return DumpOffsets[DIDT_ID_DebugInfo] = *Offset;
379         if (auto Offset = find(DICtx.getAppleNamespaces()))
380           return DumpOffsets[DIDT_ID_DebugInfo] = *Offset;
381       }
382       return None;
383     }();
384     // Early exit if --find was specified but the current file doesn't have it.
385     if (!DumpOffsets[DIDT_ID_DebugInfo])
386       return true;
387   }
388 
389   // Dump the complete DWARF structure.
390   DICtx.dump(OS, getDumpOpts(), DumpOffsets);
391   return true;
392 }
393 
394 static bool verifyObjectFile(ObjectFile &Obj, DWARFContext &DICtx,
395                              Twine Filename, raw_ostream &OS) {
396   // Verify the DWARF and exit with non-zero exit status if verification
397   // fails.
398   raw_ostream &stream = Quiet ? nulls() : OS;
399   stream << "Verifying " << Filename.str() << ":\tfile format "
400   << Obj.getFileFormatName() << "\n";
401   bool Result = DICtx.verify(stream, getDumpOpts());
402   if (Result)
403     stream << "No errors.\n";
404   else
405     stream << "Errors detected.\n";
406   return Result;
407 }
408 
409 static bool handleBuffer(StringRef Filename, MemoryBufferRef Buffer,
410                          HandlerFn HandleObj, raw_ostream &OS);
411 
412 static bool handleArchive(StringRef Filename, Archive &Arch,
413                           HandlerFn HandleObj, raw_ostream &OS) {
414   bool Result = true;
415   Error Err = Error::success();
416   for (auto Child : Arch.children(Err)) {
417     auto BuffOrErr = Child.getMemoryBufferRef();
418     error(Filename, errorToErrorCode(BuffOrErr.takeError()));
419     auto NameOrErr = Child.getName();
420     error(Filename, errorToErrorCode(NameOrErr.takeError()));
421     std::string Name = (Filename + "(" + NameOrErr.get() + ")").str();
422     Result &= handleBuffer(Name, BuffOrErr.get(), HandleObj, OS);
423   }
424   error(Filename, errorToErrorCode(std::move(Err)));
425 
426   return Result;
427 }
428 
429 static bool handleBuffer(StringRef Filename, MemoryBufferRef Buffer,
430                          HandlerFn HandleObj, raw_ostream &OS) {
431   Expected<std::unique_ptr<Binary>> BinOrErr = object::createBinary(Buffer);
432   error(Filename, errorToErrorCode(BinOrErr.takeError()));
433 
434   bool Result = true;
435   if (auto *Obj = dyn_cast<ObjectFile>(BinOrErr->get())) {
436     if (filterArch(*Obj)) {
437       std::unique_ptr<DWARFContext> DICtx = DWARFContext::create(*Obj);
438       Result = HandleObj(*Obj, *DICtx, Filename, OS);
439     }
440   }
441   else if (auto *Fat = dyn_cast<MachOUniversalBinary>(BinOrErr->get()))
442     for (auto &ObjForArch : Fat->objects()) {
443       std::string ObjName =
444           (Filename + "(" + ObjForArch.getArchFlagName() + ")").str();
445       if (auto MachOOrErr = ObjForArch.getAsObjectFile()) {
446         auto &Obj = **MachOOrErr;
447         if (filterArch(Obj)) {
448           std::unique_ptr<DWARFContext> DICtx = DWARFContext::create(Obj);
449           Result &= HandleObj(Obj, *DICtx, ObjName, OS);
450         }
451         continue;
452       } else
453         consumeError(MachOOrErr.takeError());
454       if (auto ArchiveOrErr = ObjForArch.getAsArchive()) {
455         error(ObjName, errorToErrorCode(ArchiveOrErr.takeError()));
456         Result &= handleArchive(ObjName, *ArchiveOrErr.get(), HandleObj, OS);
457         continue;
458       } else
459         consumeError(ArchiveOrErr.takeError());
460     }
461   else if (auto *Arch = dyn_cast<Archive>(BinOrErr->get()))
462     Result = handleArchive(Filename, *Arch, HandleObj, OS);
463   return Result;
464 }
465 
466 static bool handleFile(StringRef Filename, HandlerFn HandleObj,
467                        raw_ostream &OS) {
468   ErrorOr<std::unique_ptr<MemoryBuffer>> BuffOrErr =
469   MemoryBuffer::getFileOrSTDIN(Filename);
470   error(Filename, BuffOrErr.getError());
471   std::unique_ptr<MemoryBuffer> Buffer = std::move(BuffOrErr.get());
472   return handleBuffer(Filename, *Buffer, HandleObj, OS);
473 }
474 
475 /// If the input path is a .dSYM bundle (as created by the dsymutil tool),
476 /// replace it with individual entries for each of the object files inside the
477 /// bundle otherwise return the input path.
478 static std::vector<std::string> expandBundle(const std::string &InputPath) {
479   std::vector<std::string> BundlePaths;
480   SmallString<256> BundlePath(InputPath);
481   // Manually open up the bundle to avoid introducing additional dependencies.
482   if (sys::fs::is_directory(BundlePath) &&
483       sys::path::extension(BundlePath) == ".dSYM") {
484     std::error_code EC;
485     sys::path::append(BundlePath, "Contents", "Resources", "DWARF");
486     for (sys::fs::directory_iterator Dir(BundlePath, EC), DirEnd;
487          Dir != DirEnd && !EC; Dir.increment(EC)) {
488       const std::string &Path = Dir->path();
489       sys::fs::file_status Status;
490       EC = sys::fs::status(Path, Status);
491       error(Path, EC);
492       switch (Status.type()) {
493       case sys::fs::file_type::regular_file:
494       case sys::fs::file_type::symlink_file:
495       case sys::fs::file_type::type_unknown:
496         BundlePaths.push_back(Path);
497         break;
498       default: /*ignore*/;
499       }
500     }
501     error(BundlePath, EC);
502   }
503   if (!BundlePaths.size())
504     BundlePaths.push_back(InputPath);
505   return BundlePaths;
506 }
507 
508 int main(int argc, char **argv) {
509   // Print a stack trace if we signal out.
510   sys::PrintStackTraceOnErrorSignal(argv[0]);
511   PrettyStackTraceProgram X(argc, argv);
512   llvm_shutdown_obj Y;  // Call llvm_shutdown() on exit.
513 
514   llvm::InitializeAllTargetInfos();
515   llvm::InitializeAllTargetMCs();
516 
517   HideUnrelatedOptions({&DwarfDumpCategory, &SectionCategory});
518   cl::ParseCommandLineOptions(
519       argc, argv,
520       "pretty-print DWARF debug information in object files"
521       " and debug info archives.\n");
522 
523   if (Help) {
524     PrintHelpMessage(/*Hidden =*/false, /*Categorized =*/true);
525     return 0;
526   }
527 
528   std::unique_ptr<ToolOutputFile> OutputFile;
529   if (!OutputFilename.empty()) {
530     std::error_code EC;
531     OutputFile = llvm::make_unique<ToolOutputFile>(OutputFilename, EC,
532                                                      sys::fs::F_None);
533     error("Unable to open output file" + OutputFilename, EC);
534     // Don't remove output file if we exit with an error.
535     OutputFile->keep();
536   }
537 
538   raw_ostream &OS = OutputFile ? OutputFile->os() : outs();
539 
540   // Defaults to dumping all sections, unless brief mode is specified in which
541   // case only the .debug_info section in dumped.
542 #define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME)                \
543   if (Dump##ENUM_NAME.IsRequested) {                                           \
544     DumpType |= DIDT_##ENUM_NAME;                                              \
545     if (Dump##ENUM_NAME.HasValue)                                              \
546       DumpOffsets[DIDT_ID_##ENUM_NAME] = Dump##ENUM_NAME.Val;                  \
547   }
548 #include "llvm/BinaryFormat/Dwarf.def"
549 #undef HANDLE_DWARF_SECTION
550   if (DumpUUID)
551     DumpType |= DIDT_UUID;
552   if (DumpAll)
553     DumpType = DIDT_All;
554   if (DumpType == DIDT_Null) {
555     if (Verbose)
556       DumpType = DIDT_All;
557     else
558       DumpType = DIDT_DebugInfo;
559   }
560 
561   // Defaults to a.out if no filenames specified.
562   if (InputFilenames.size() == 0)
563     InputFilenames.push_back("a.out");
564 
565   // Expand any .dSYM bundles to the individual object files contained therein.
566   std::vector<std::string> Objects;
567   for (const auto &F : InputFilenames) {
568     auto Objs = expandBundle(F);
569     Objects.insert(Objects.end(), Objs.begin(), Objs.end());
570   }
571 
572   if (Verify) {
573     // If we encountered errors during verify, exit with a non-zero exit status.
574     if (!std::all_of(Objects.begin(), Objects.end(), [&](std::string Object) {
575           return handleFile(Object, verifyObjectFile, OS);
576         }))
577       exit(1);
578   } else if (Statistics)
579     for (auto Object : Objects)
580       handleFile(Object, collectStatsForObjectFile, OS);
581   else
582     for (auto Object : Objects)
583       handleFile(Object, dumpObjectFile, OS);
584 
585   return EXIT_SUCCESS;
586 }
587