obj2yaml.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //===------ utils/obj2yaml.hpp - obj2yaml conversion tool -------*- C++ -*-===//
  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. // This file declares some helper routines, and also the format-specific
  8. // writers. To add a new format, add the declaration here, and, in a separate
  9. // source file, implement it.
  10. //===----------------------------------------------------------------------===//
  11. #ifndef LLVM_TOOLS_OBJ2YAML_OBJ2YAML_H
  12. #define LLVM_TOOLS_OBJ2YAML_OBJ2YAML_H
  13. #include "llvm/Object/COFF.h"
  14. #include "llvm/Object/Minidump.h"
  15. #include "llvm/Object/Wasm.h"
  16. #include "llvm/Object/XCOFFObjectFile.h"
  17. #include "llvm/Support/raw_ostream.h"
  18. #include "llvm/Support/MemoryBufferRef.h"
  19. #include <system_error>
  20. std::error_code coff2yaml(llvm::raw_ostream &Out,
  21. const llvm::object::COFFObjectFile &Obj);
  22. llvm::Error elf2yaml(llvm::raw_ostream &Out,
  23. const llvm::object::ObjectFile &Obj);
  24. llvm::Error macho2yaml(llvm::raw_ostream &Out,
  25. const llvm::object::Binary &Obj);
  26. llvm::Error minidump2yaml(llvm::raw_ostream &Out,
  27. const llvm::object::MinidumpFile &Obj);
  28. std::error_code xcoff2yaml(llvm::raw_ostream &Out,
  29. const llvm::object::XCOFFObjectFile &Obj);
  30. std::error_code wasm2yaml(llvm::raw_ostream &Out,
  31. const llvm::object::WasmObjectFile &Obj);
  32. llvm::Error archive2yaml(llvm::raw_ostream &Out, llvm::MemoryBufferRef Source);
  33. // Forward decls for dwarf2yaml
  34. namespace llvm {
  35. class DWARFContext;
  36. namespace DWARFYAML {
  37. struct Data;
  38. }
  39. }
  40. void dumpDebugAbbrev(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
  41. llvm::Error dumpDebugAddr(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
  42. llvm::Error dumpDebugARanges(llvm::DWARFContext &DCtx,
  43. llvm::DWARFYAML::Data &Y);
  44. void dumpDebugPubSections(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
  45. void dumpDebugInfo(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
  46. void dumpDebugLines(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
  47. llvm::Error dumpDebugRanges(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
  48. llvm::Error dumpDebugStrings(llvm::DWARFContext &DCtx,
  49. llvm::DWARFYAML::Data &Y);
  50. #endif