2
* DWARF2 debugging format
4
* Copyright (C) 2006-2007 Peter Johnson
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions
9
* 1. Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
* 2. Redistributions in binary form must reproduce the above copyright
12
* notice, this list of conditions and the following disclaimer in the
13
* documentation and/or other materials provided with the distribution.
15
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
16
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
19
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
* POSSIBILITY OF SUCH DAMAGE.
27
#ifndef YASM_DWARF2_DBGFMT_H
28
#define YASM_DWARF2_DBGFMT_H
33
char *pathname; /* full filename */
34
char *filename; /* basename of full filename */
35
unsigned long dir; /* index into directories array for relative path;
36
* 0 for current directory. */
40
typedef struct yasm_dbgfmt_dwarf2 {
41
yasm_dbgfmt_base dbgfmt; /* base structure */
44
unsigned long dirs_size;
45
unsigned long dirs_allocated;
47
dwarf2_filename *filenames;
48
unsigned long filenames_size;
49
unsigned long filenames_allocated;
56
unsigned int sizeof_address, sizeof_offset, min_insn_len;
59
/* .loc directive data */
60
typedef struct dwarf2_loc {
61
/*@reldef@*/ STAILQ_ENTRY(dwarf2_loc) link;
63
unsigned long vline; /* virtual line number of .loc directive */
65
/* source information */
66
unsigned long file; /* index into table of filenames */
67
unsigned long line; /* source line number */
68
unsigned long column; /* source column */
69
unsigned long discriminator;
81
yasm_bytecode *bc; /* first bytecode following */
82
yasm_symrec *sym; /* last symbol preceding */
85
/* Per-section data */
86
typedef struct dwarf2_section_data {
87
/* The locations set by the .loc directives in this section, in assembly
90
/*@reldef@*/ STAILQ_HEAD(dwarf2_lochead, dwarf2_loc) locs;
91
} dwarf2_section_data;
93
extern const yasm_assoc_data_callback yasm_dwarf2__section_data_cb;
95
yasm_bytecode *yasm_dwarf2__append_bc(yasm_section *sect, yasm_bytecode *bc);
97
/*@dependent@*/ yasm_symrec *yasm_dwarf2__bc_sym(yasm_symtab *symtab,
100
typedef struct dwarf2_head dwarf2_head;
101
dwarf2_head *yasm_dwarf2__add_head
102
(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, yasm_section *sect,
103
/*@null@*/ yasm_section *debug_ptr, int with_address, int with_segment);
104
void yasm_dwarf2__set_head_end(dwarf2_head *head, yasm_bytecode *end_prevbc);
106
/* Line number functions */
107
yasm_section *yasm_dwarf2__generate_line
108
(yasm_object *object, yasm_linemap *linemap, yasm_errwarns *errwarns,
109
int asm_source, /*@out@*/ yasm_section **main_code,
110
/*@out@*/ size_t *num_line_sections);
111
void yasm_dwarf2__dir_loc(yasm_object *object, yasm_valparamhead *valparams,
112
yasm_valparamhead *objext_valparams,
114
void yasm_dwarf2__dir_file(yasm_object *object, yasm_valparamhead *valparams,
115
yasm_valparamhead *objext_valparams,
118
/* Address range table functions */
119
yasm_section *yasm_dwarf2__generate_aranges(yasm_object *object,
120
yasm_section *debug_info);
122
/* Name lookup table functions */
123
yasm_section *yasm_dwarf2__generate_pubnames(yasm_object *object,
124
yasm_section *debug_info);
126
/* Information functions */
127
yasm_section *yasm_dwarf2__generate_info
128
(yasm_object *object, yasm_section *debug_line,
129
/*@null@*/ yasm_section *main_code);