2012-06-20 02:02:35 +08:00
|
|
|
//===------ utils/obj2yaml.hpp - obj2yaml conversion tool -------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2012-06-20 02:02:35 +08:00
|
|
|
//
|
|
|
|
// This file declares some helper routines, and also the format-specific
|
|
|
|
// writers. To add a new format, add the declaration here, and, in a separate
|
|
|
|
// source file, implement it.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_TOOLS_OBJ2YAML_OBJ2YAML_H
|
|
|
|
#define LLVM_TOOLS_OBJ2YAML_OBJ2YAML_H
|
2012-06-20 02:02:35 +08:00
|
|
|
|
2014-05-07 13:18:51 +08:00
|
|
|
#include "llvm/Object/COFF.h"
|
2019-04-02 19:58:37 +08:00
|
|
|
#include "llvm/Object/Minidump.h"
|
2017-03-31 03:44:09 +08:00
|
|
|
#include "llvm/Object/Wasm.h"
|
[XCOFF] Add functionality for parsing AIX XCOFF object file headers
Summary:
1. Add functionality for parsing AIX XCOFF object files headers.
2. Only support 32-bit AIX XCOFF object files in this patch.
3. Print out the AIX XCOFF object file header in YAML format.
Reviewers: sfertile, hubert.reinterpretcast, jasonliu, mstorsjo, zturner, rnk
Reviewed By: sfertile, hubert.reinterpretcast
Subscribers: jsji, mgorny, hiraditya, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59419
Patch by Digger Lin
llvm-svn: 357663
2019-04-04 08:53:21 +08:00
|
|
|
#include "llvm/Object/XCOFFObjectFile.h"
|
2012-12-04 18:37:14 +08:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2020-10-20 20:12:28 +08:00
|
|
|
#include "llvm/Support/MemoryBufferRef.h"
|
2014-06-13 01:38:55 +08:00
|
|
|
#include <system_error>
|
2012-06-20 02:02:35 +08:00
|
|
|
|
2021-11-09 03:29:04 +08:00
|
|
|
enum RawSegments : unsigned { none = 0, data = 1, linkedit = 1 << 1 };
|
2014-06-12 22:11:22 +08:00
|
|
|
std::error_code coff2yaml(llvm::raw_ostream &Out,
|
|
|
|
const llvm::object::COFFObjectFile &Obj);
|
2019-07-15 19:53:39 +08:00
|
|
|
llvm::Error elf2yaml(llvm::raw_ostream &Out,
|
2014-06-12 22:11:22 +08:00
|
|
|
const llvm::object::ObjectFile &Obj);
|
2021-11-09 03:29:04 +08:00
|
|
|
llvm::Error macho2yaml(llvm::raw_ostream &Out, const llvm::object::Binary &Obj,
|
|
|
|
unsigned RawSegments);
|
2019-04-02 19:58:37 +08:00
|
|
|
llvm::Error minidump2yaml(llvm::raw_ostream &Out,
|
|
|
|
const llvm::object::MinidumpFile &Obj);
|
2021-10-11 10:52:20 +08:00
|
|
|
llvm::Error xcoff2yaml(llvm::raw_ostream &Out,
|
|
|
|
const llvm::object::XCOFFObjectFile &Obj);
|
2017-03-31 03:44:09 +08:00
|
|
|
std::error_code wasm2yaml(llvm::raw_ostream &Out,
|
|
|
|
const llvm::object::WasmObjectFile &Obj);
|
2020-10-20 20:12:28 +08:00
|
|
|
llvm::Error archive2yaml(llvm::raw_ostream &Out, llvm::MemoryBufferRef Source);
|
2012-06-20 02:02:35 +08:00
|
|
|
|
2016-12-08 05:47:28 +08:00
|
|
|
// Forward decls for dwarf2yaml
|
|
|
|
namespace llvm {
|
2017-07-20 06:27:28 +08:00
|
|
|
class DWARFContext;
|
2016-12-08 05:47:28 +08:00
|
|
|
namespace DWARFYAML {
|
2016-12-09 01:46:57 +08:00
|
|
|
struct Data;
|
2016-12-08 05:47:28 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-07 12:07:31 +08:00
|
|
|
void dumpDebugAbbrev(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
|
2020-09-16 14:46:12 +08:00
|
|
|
llvm::Error dumpDebugAddr(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
|
2020-08-05 19:18:33 +08:00
|
|
|
llvm::Error dumpDebugARanges(llvm::DWARFContext &DCtx,
|
|
|
|
llvm::DWARFYAML::Data &Y);
|
2020-08-07 12:07:31 +08:00
|
|
|
void dumpDebugPubSections(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
|
|
|
|
void dumpDebugInfo(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
|
|
|
|
void dumpDebugLines(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
|
|
|
|
llvm::Error dumpDebugRanges(llvm::DWARFContext &DCtx, llvm::DWARFYAML::Data &Y);
|
2020-09-08 16:08:42 +08:00
|
|
|
llvm::Error dumpDebugStrings(llvm::DWARFContext &DCtx,
|
|
|
|
llvm::DWARFYAML::Data &Y);
|
2020-08-07 12:07:31 +08:00
|
|
|
|
2012-06-20 02:02:35 +08:00
|
|
|
#endif
|