1 //===- tools/dsymutil/dsymutil.h - dsymutil high-level functionality ------===// 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 /// \file 11 /// 12 /// This file contains the class declaration for the code that parses STABS 13 /// debug maps that are embedded in the binaries symbol tables. 14 // 15 //===----------------------------------------------------------------------===// 16 17 #ifndef LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H 18 #define LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H 19 20 #include "DebugMap.h" 21 #include "LinkUtils.h" 22 #include "llvm/ADT/ArrayRef.h" 23 #include "llvm/ADT/StringRef.h" 24 #include "llvm/Support/Compiler.h" 25 #include "llvm/Support/ErrorOr.h" 26 #include <memory> 27 #include <string> 28 #include <vector> 29 30 namespace llvm { 31 namespace dsymutil { 32 33 class BinaryHolder; 34 35 /// Extract the DebugMaps from the given file. 36 /// The file has to be a MachO object file. Multiple debug maps can be 37 /// returned when the file is universal (aka fat) binary. 38 ErrorOr<std::vector<std::unique_ptr<DebugMap>>> 39 parseDebugMap(StringRef InputFile, ArrayRef<std::string> Archs, 40 StringRef PrependPath, bool PaperTrailWarnings, bool Verbose, 41 bool InputIsYAML); 42 43 /// Dump the symbol table 44 bool dumpStab(StringRef InputFile, ArrayRef<std::string> Archs, 45 StringRef PrependPath = ""); 46 47 /// Link the Dwarf debug info as directed by the passed DebugMap \p DM into a 48 /// DwarfFile named \p OutputFilename. \returns false if the link failed. 49 bool linkDwarf(raw_fd_ostream &OutFile, BinaryHolder &BinHolder, 50 const DebugMap &DM, const LinkOptions &Options); 51 52 } // end namespace dsymutil 53 } // end namespace llvm 54 55 #endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H 56