LLVM
4.0.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
llvm.src
include
llvm
DebugInfo
CodeView
ModuleSubstream.h
Go to the documentation of this file.
1
//===- ModuleSubstream.h ----------------------------------------*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLVM_DEBUGINFO_CODEVIEW_MODULESUBSTREAM_H
11
#define LLVM_DEBUGINFO_CODEVIEW_MODULESUBSTREAM_H
12
13
#include "
llvm/DebugInfo/CodeView/CodeView.h
"
14
#include "
llvm/DebugInfo/MSF/StreamArray.h
"
15
#include "
llvm/DebugInfo/MSF/StreamRef.h
"
16
#include "
llvm/Support/Endian.h
"
17
#include "
llvm/Support/Error.h
"
18
19
namespace
llvm {
20
namespace
codeview {
21
22
// Corresponds to the `CV_DebugSSubsectionHeader_t` structure.
23
struct
ModuleSubsectionHeader
{
24
support::ulittle32_t
Kind
;
// codeview::ModuleSubstreamKind enum
25
support::ulittle32_t
Length
;
// number of bytes occupied by this record.
26
};
27
28
// Corresponds to the `CV_DebugSLinesHeader_t` structure.
29
struct
LineSubstreamHeader
{
30
support::ulittle32_t
RelocOffset
;
// Code offset of line contribution.
31
support::ulittle16_t
RelocSegment
;
// Code segment of line contribution.
32
support::ulittle16_t
Flags
;
// See LineFlags enumeration.
33
support::ulittle32_t
CodeSize
;
// Code size of this line contribution.
34
};
35
36
// Corresponds to the `CV_DebugSLinesFileBlockHeader_t` structure.
37
struct
LineFileBlockHeader
{
38
support::ulittle32_t
NameIndex
;
// Index in DBI name buffer of filename.
39
support::ulittle32_t
NumLines
;
// Number of lines
40
support::ulittle32_t
BlockSize
;
// Code size of block, in bytes.
41
// The following two variable length arrays appear immediately after the
42
// header. The structure definitions follow.
43
// LineNumberEntry Lines[NumLines];
44
// ColumnNumberEntry Columns[NumLines];
45
};
46
47
// Corresponds to `CV_Line_t` structure
48
struct
LineNumberEntry
{
49
support::ulittle32_t
Offset
;
// Offset to start of code bytes for line number
50
support::ulittle32_t
Flags
;
// Start:24, End:7, IsStatement:1
51
};
52
53
// Corresponds to `CV_Column_t` structure
54
struct
ColumnNumberEntry
{
55
support::ulittle16_t
StartColumn
;
56
support::ulittle16_t
EndColumn
;
57
};
58
59
class
ModuleSubstream
{
60
public
:
61
ModuleSubstream
();
62
ModuleSubstream
(
ModuleSubstreamKind
Kind,
msf::ReadableStreamRef
Data);
63
static
Error
initialize
(
msf::ReadableStreamRef
Stream,
ModuleSubstream
&Info);
64
uint32_t
getRecordLength
()
const
;
65
ModuleSubstreamKind
getSubstreamKind
()
const
;
66
msf::ReadableStreamRef
getRecordData
()
const
;
67
68
private
:
69
ModuleSubstreamKind
Kind;
70
msf::ReadableStreamRef
Data;
71
};
72
73
typedef
msf::VarStreamArray<ModuleSubstream>
ModuleSubstreamArray
;
74
}
// namespace codeview
75
76
namespace
msf {
77
template
<>
struct
VarStreamArrayExtractor
<codeview::ModuleSubstream> {
78
Error
operator()
(
ReadableStreamRef
Stream,
uint32_t
&Length,
79
codeview::ModuleSubstream
&Info)
const
{
80
if
(
auto
EC =
codeview::ModuleSubstream::initialize
(Stream, Info))
81
return
EC;
82
Length = Info.
getRecordLength
();
83
return
Error::success
();
84
}
85
};
86
}
// namespace msf
87
}
// namespace llvm
88
89
#endif // LLVM_DEBUGINFO_CODEVIEW_MODULESUBSTREAM_H
llvm::codeview::ModuleSubstreamKind
ModuleSubstreamKind
Definition:
CodeView.h:288
llvm::codeview::LineFileBlockHeader
Definition:
ModuleSubstream.h:37
llvm::codeview::ModuleSubstream::getSubstreamKind
ModuleSubstreamKind getSubstreamKind() const
Definition:
ModuleSubstream.cpp:43
llvm::support::detail::packed_endian_specific_integral
Definition:
Endian.h:174
llvm::codeview::LineNumberEntry::Flags
support::ulittle32_t Flags
Definition:
ModuleSubstream.h:50
StreamArray.h
CodeView.h
Endian.h
llvm::codeview::LineSubstreamHeader::CodeSize
support::ulittle32_t CodeSize
Definition:
ModuleSubstream.h:33
StreamRef.h
llvm::codeview::ModuleSubstream
Definition:
ModuleSubstream.h:59
llvm::msf::VarStreamArray< ModuleSubstream >
llvm::codeview::ModuleSubstream::ModuleSubstream
ModuleSubstream()
Definition:
ModuleSubstream.cpp:18
llvm::codeview::LineFileBlockHeader::NameIndex
support::ulittle32_t NameIndex
Definition:
ModuleSubstream.h:38
Error.h
llvm::codeview::ColumnNumberEntry
Definition:
ModuleSubstream.h:54
llvm::codeview::LineSubstreamHeader::RelocOffset
support::ulittle32_t RelocOffset
Definition:
ModuleSubstream.h:30
llvm::codeview::ModuleSubstream::initialize
static Error initialize(msf::ReadableStreamRef Stream, ModuleSubstream &Info)
Definition:
ModuleSubstream.cpp:24
llvm::codeview::ColumnNumberEntry::EndColumn
support::ulittle16_t EndColumn
Definition:
ModuleSubstream.h:56
uint32_t
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition:
Support/Error.h:299
llvm::codeview::LineFileBlockHeader::NumLines
support::ulittle32_t NumLines
Definition:
ModuleSubstream.h:39
llvm::codeview::LineSubstreamHeader
Definition:
ModuleSubstream.h:29
llvm::msf::VarStreamArrayExtractor< codeview::ModuleSubstream >::operator()
Error operator()(ReadableStreamRef Stream, uint32_t &Length, codeview::ModuleSubstream &Info) const
Definition:
ModuleSubstream.h:78
llvm::codeview::ModuleSubstream::getRecordLength
uint32_t getRecordLength() const
Definition:
ModuleSubstream.cpp:39
llvm::codeview::ModuleSubsectionHeader::Length
support::ulittle32_t Length
Definition:
ModuleSubstream.h:25
llvm::msf::ReadableStreamRef
Definition:
StreamRef.h:67
llvm::codeview::ModuleSubstreamArray
msf::VarStreamArray< ModuleSubstream > ModuleSubstreamArray
Definition:
ModuleSubstream.h:73
llvm::codeview::LineFileBlockHeader::BlockSize
support::ulittle32_t BlockSize
Definition:
ModuleSubstream.h:40
llvm::msf::VarStreamArrayExtractor
VarStreamArrayExtractor is intended to be specialized to provide customized extraction logic...
Definition:
StreamArray.h:35
llvm::codeview::LineSubstreamHeader::Flags
support::ulittle16_t Flags
Definition:
ModuleSubstream.h:32
llvm::codeview::ModuleSubstream::getRecordData
msf::ReadableStreamRef getRecordData() const
Definition:
ModuleSubstream.cpp:45
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition:
Support/Error.h:152
llvm::codeview::LineNumberEntry
Definition:
ModuleSubstream.h:48
llvm::codeview::ModuleSubsectionHeader::Kind
support::ulittle32_t Kind
Definition:
ModuleSubstream.h:24
llvm::codeview::ColumnNumberEntry::StartColumn
support::ulittle16_t StartColumn
Definition:
ModuleSubstream.h:55
llvm::codeview::LineNumberEntry::Offset
support::ulittle32_t Offset
Definition:
ModuleSubstream.h:49
llvm::codeview::ModuleSubsectionHeader
Definition:
ModuleSubstream.h:23
llvm::codeview::LineSubstreamHeader::RelocSegment
support::ulittle16_t RelocSegment
Definition:
ModuleSubstream.h:31
Generated on Wed Mar 8 2017 17:17:45 for LLVM by
1.8.6