Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 1 | //===- tools/dsymutil/dsymutil.h - dsymutil high-level functionality ------===// |
| 2 | // |
Jonas Devlieghere | 928fea2 | 2018-06-27 16:13:40 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 9 | // |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 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. |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 14 | // |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 15 | //===----------------------------------------------------------------------===// |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 16 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 17 | #ifndef LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H |
| 18 | #define LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H |
| 19 | |
| 20 | #include "DebugMap.h" |
Jonas Devlieghere | 928fea2 | 2018-06-27 16:13:40 +0000 | [diff] [blame] | 21 | #include "LinkUtils.h" |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 22 | #include "llvm/ADT/ArrayRef.h" |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 23 | #include "llvm/ADT/StringRef.h" |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 24 | #include "llvm/Support/Compiler.h" |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 25 | #include "llvm/Support/ErrorOr.h" |
| 26 | #include <memory> |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 27 | #include <string> |
| 28 | #include <vector> |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 29 | |
| 30 | namespace llvm { |
| 31 | namespace dsymutil { |
Frederic Riss | d9a80bd | 2015-02-28 00:29:07 +0000 | [diff] [blame] | 32 | |
Jonas Devlieghere | 9f33bbfe | 2018-06-29 16:51:52 +0000 | [diff] [blame] | 33 | class BinaryHolder; |
Jonas Devlieghere | 4d3e6c1 | 2018-06-29 16:50:41 +0000 | [diff] [blame] | 34 | |
Jonas Devlieghere | 92a76c5 | 2018-02-22 11:43:43 +0000 | [diff] [blame] | 35 | /// Extract the DebugMaps from the given file. |
Frederic Riss | 7a42578 | 2015-08-05 18:27:44 +0000 | [diff] [blame] | 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. |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 38 | ErrorOr<std::vector<std::unique_ptr<DebugMap>>> |
Frederic Riss | 1b709aa | 2015-08-05 22:33:28 +0000 | [diff] [blame] | 39 | parseDebugMap(StringRef InputFile, ArrayRef<std::string> Archs, |
Jonas Devlieghere | 67eb8fd | 2018-04-02 10:40:43 +0000 | [diff] [blame] | 40 | StringRef PrependPath, bool PaperTrailWarnings, bool Verbose, |
| 41 | bool InputIsYAML); |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 42 | |
Jonas Devlieghere | 92a76c5 | 2018-02-22 11:43:43 +0000 | [diff] [blame] | 43 | /// Dump the symbol table |
Frederic Riss | a8a34c5 | 2015-08-31 00:29:09 +0000 | [diff] [blame] | 44 | bool dumpStab(StringRef InputFile, ArrayRef<std::string> Archs, |
| 45 | StringRef PrependPath = ""); |
| 46 | |
Jonas Devlieghere | 92a76c5 | 2018-02-22 11:43:43 +0000 | [diff] [blame] | 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. |
Jonas Devlieghere | 9f33bbfe | 2018-06-29 16:51:52 +0000 | [diff] [blame] | 49 | bool linkDwarf(raw_fd_ostream &OutFile, BinaryHolder &BinHolder, |
Jonas Devlieghere | 4d3e6c1 | 2018-06-29 16:50:41 +0000 | [diff] [blame] | 50 | const DebugMap &DM, const LinkOptions &Options); |
Frederic Riss | d2fb7bd | 2015-08-05 18:27:38 +0000 | [diff] [blame] | 51 | |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 52 | } // end namespace dsymutil |
| 53 | } // end namespace llvm |
| 54 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 55 | #endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H |