dsymutil.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //===- tools/dsymutil/dsymutil.h - dsymutil high-level functionality ------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. /// \file
  10. ///
  11. /// This file contains the class declaration for the code that parses STABS
  12. /// debug maps that are embedded in the binaries symbol tables.
  13. //
  14. //===----------------------------------------------------------------------===//
  15. #ifndef LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
  16. #define LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
  17. #include "DebugMap.h"
  18. #include "LinkUtils.h"
  19. #include "llvm/ADT/ArrayRef.h"
  20. #include "llvm/ADT/StringRef.h"
  21. #include "llvm/Support/Compiler.h"
  22. #include "llvm/Support/ErrorOr.h"
  23. #include <memory>
  24. #include <string>
  25. #include <vector>
  26. namespace llvm {
  27. namespace dsymutil {
  28. class BinaryHolder;
  29. /// Extract the DebugMaps from the given file.
  30. /// The file has to be a MachO object file. Multiple debug maps can be
  31. /// returned when the file is universal (aka fat) binary.
  32. ErrorOr<std::vector<std::unique_ptr<DebugMap>>>
  33. parseDebugMap(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
  34. StringRef InputFile, ArrayRef<std::string> Archs,
  35. StringRef PrependPath, bool PaperTrailWarnings, bool Verbose,
  36. bool InputIsYAML);
  37. /// Dump the symbol table.
  38. bool dumpStab(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
  39. StringRef InputFile, ArrayRef<std::string> Archs,
  40. StringRef PrependPath = "");
  41. /// Link the Dwarf debug info as directed by the passed DebugMap \p DM into a
  42. /// DwarfFile named \p OutputFilename. \returns false if the link failed.
  43. bool linkDwarf(raw_fd_ostream &OutFile, BinaryHolder &BinHolder,
  44. const DebugMap &DM, LinkOptions Options);
  45. } // end namespace dsymutil
  46. } // end namespace llvm
  47. #endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H