LLVM
20.0.0git
include
llvm
DebugInfo
GSYM
DwarfTransformer.h
Go to the documentation of this file.
1
//===- DwarfTransformer.h ---------------------------------------*- 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
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_DEBUGINFO_GSYM_DWARFTRANSFORMER_H
10
#define LLVM_DEBUGINFO_GSYM_DWARFTRANSFORMER_H
11
12
#include "
llvm/ADT/StringRef.h
"
13
#include "
llvm/DebugInfo/GSYM/ExtractRanges.h
"
14
#include "
llvm/Support/Error.h
"
15
16
namespace
llvm
{
17
18
class
raw_ostream;
19
20
namespace
gsym {
21
22
struct
CUInfo
;
23
struct
FunctionInfo
;
24
class
GsymCreator
;
25
class
OutputAggregator
;
26
27
/// A class that transforms the DWARF in a DWARFContext into GSYM information
28
/// by populating the GsymCreator object that it is constructed with. This
29
/// class supports converting all DW_TAG_subprogram DIEs into
30
/// gsym::FunctionInfo objects that includes line table information and inline
31
/// function information. Creating a separate class to transform this data
32
/// allows this class to be unit tested.
33
class
DwarfTransformer
{
34
public
:
35
36
/// Create a DWARF transformer.
37
///
38
/// \param D The DWARF to use when converting to GSYM.
39
///
40
/// \param G The GSYM creator to populate with the function information
41
/// from the debug info.
42
DwarfTransformer
(
DWARFContext
&
D
,
GsymCreator
&
G
) : DICtx(
D
), Gsym(
G
) {}
43
44
/// Extract the DWARF from the supplied object file and convert it into the
45
/// Gsym format in the GsymCreator object that is passed in. Returns an
46
/// error if something fatal is encountered.
47
///
48
/// \param NumThreads The number of threads that the conversion process can
49
/// use.
50
///
51
/// \param OS The stream to log warnings and non fatal issues to. If NULL
52
/// then don't log.
53
///
54
/// \returns An error indicating any fatal issues that happen when parsing
55
/// the DWARF, or Error::success() if all goes well.
56
llvm::Error
convert
(
uint32_t
NumThreads,
OutputAggregator
&
OS
);
57
58
llvm::Error
verify
(
StringRef
GsymPath,
OutputAggregator
&
OS
);
59
60
private
:
61
62
/// Parse the DWARF in the object file and convert it into the GsymCreator.
63
Error
parse
();
64
65
/// Handle any DIE (debug info entry) from the DWARF.
66
///
67
/// This function will find all DW_TAG_subprogram DIEs that convert them into
68
/// GSYM FuntionInfo objects and add them to the GsymCreator supplied during
69
/// construction. The DIE and all its children will be recursively parsed
70
/// with calls to this function.
71
///
72
/// \param Strm The thread specific log stream for any non fatal errors and
73
/// warnings. Once a thread has finished parsing an entire compile unit, all
74
/// information in this temporary stream will be forwarded to the member
75
/// variable log. This keeps logging thread safe. If the value is NULL, then
76
/// don't log.
77
///
78
/// \param CUI The compile unit specific information that contains the DWARF
79
/// line table, cached file list, and other compile unit specific
80
/// information.
81
///
82
/// \param Die The DWARF debug info entry to parse.
83
void
handleDie(
OutputAggregator
&Strm,
CUInfo
&CUI,
DWARFDie
Die);
84
85
DWARFContext
&DICtx;
86
GsymCreator
&Gsym;
87
88
friend
class
DwarfTransformerTest
;
89
};
90
91
}
// namespace gsym
92
}
// namespace llvm
93
94
#endif
// LLVM_DEBUGINFO_GSYM_DWARFTRANSFORMER_H
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
convert
expand large fp convert
Definition:
ExpandLargeFpConvert.cpp:703
ExtractRanges.h
G
#define G(x, y, z)
Definition:
MD5.cpp:56
verify
ppc ctr loops verify
Definition:
PPCCTRLoopsVerify.cpp:74
OS
raw_pwrite_stream & OS
Definition:
SampleProfWriter.cpp:53
StringRef.h
llvm::DWARFContext
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
Definition:
DWARFContext.h:48
llvm::DWARFDie
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
Definition:
DWARFDie.h:42
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition:
Error.h:160
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:
StringRef.h:50
llvm::gsym::DwarfTransformer
A class that transforms the DWARF in a DWARFContext into GSYM information by populating the GsymCreat...
Definition:
DwarfTransformer.h:33
llvm::gsym::DwarfTransformer::DwarfTransformerTest
friend class DwarfTransformerTest
Definition:
DwarfTransformer.h:88
llvm::gsym::DwarfTransformer::DwarfTransformer
DwarfTransformer(DWARFContext &D, GsymCreator &G)
Create a DWARF transformer.
Definition:
DwarfTransformer.h:42
llvm::gsym::GsymCreator
GsymCreator is used to emit GSYM data to a stand alone file or section within a file.
Definition:
GsymCreator.h:134
llvm::gsym::OutputAggregator
Definition:
OutputAggregator.h:24
uint32_t
Error.h
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::gsym::CUInfo
Definition:
DwarfTransformer.cpp:31
llvm::gsym::FunctionInfo
Function information in GSYM files encodes information for one contiguous address range.
Definition:
FunctionInfo.h:89
parse
Definition:
regcomp.c:192
Generated on Wed Nov 20 2024 23:47:42 for LLVM by
1.9.6