]>
Commit | Line | Data |
---|---|---|
89b66cde | 1 | /* dwarf2dbg.h - DWARF2 debug support |
a2c58332 | 2 | Copyright (C) 1999-2022 Free Software Foundation, Inc. |
89b66cde ILT |
3 | |
4 | This file is part of GAS, the GNU Assembler. | |
5 | ||
6 | GAS is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
ec2655a6 | 8 | the Free Software Foundation; either version 3, or (at your option) |
89b66cde ILT |
9 | any later version. |
10 | ||
11 | GAS is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GAS; see the file COPYING. If not, write to the Free | |
4b4da160 NC |
18 | Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA |
19 | 02110-1301, USA. */ | |
89b66cde | 20 | |
fac0d250 RH |
21 | #ifndef AS_DWARF2DBG_H |
22 | #define AS_DWARF2DBG_H | |
23 | ||
24 | #include "as.h" | |
25 | ||
bd0eb99b RH |
26 | #define DWARF2_FLAG_IS_STMT (1 << 0) |
27 | #define DWARF2_FLAG_BASIC_BLOCK (1 << 1) | |
28 | #define DWARF2_FLAG_PROLOGUE_END (1 << 2) | |
29 | #define DWARF2_FLAG_EPILOGUE_BEGIN (1 << 3) | |
fac0d250 | 30 | |
ba8826a8 AO |
31 | struct dwarf2_line_info |
32 | { | |
e6c774b4 KH |
33 | unsigned int filenum; |
34 | unsigned int line; | |
35 | unsigned int column; | |
bd0eb99b | 36 | unsigned int isa; |
e6c774b4 | 37 | unsigned int flags; |
92846e72 | 38 | unsigned int discriminator; |
51298b33 AM |
39 | /* filenum == -1u chooses filename, otherwise view. */ |
40 | union | |
41 | { | |
42 | symbolS *view; | |
43 | const char *filename; | |
44 | } u; | |
e6c774b4 | 45 | }; |
fac0d250 RH |
46 | |
47 | /* Implements the .file FILENO "FILENAME" directive. FILENO can be 0 | |
48 | to indicate that no file number has been assigned. All real file | |
68d20676 NC |
49 | number must be >0. The second form returns the filename extracted |
50 | from the input stream. */ | |
51 | extern void dwarf2_directive_file (int); | |
52 | extern char * dwarf2_directive_filename (void); | |
fac0d250 RH |
53 | |
54 | /* Implements the .loc FILENO LINENO [COLUMN] directive. FILENO is | |
55 | the file number, LINENO the line number and the (optional) COLUMN | |
56 | the column of the source code that the following instruction | |
57 | corresponds to. FILENO can be 0 to indicate that the filename | |
58 | specified by the textually most recent .file directive should be | |
59 | used. */ | |
ba8826a8 | 60 | extern void dwarf2_directive_loc (int); |
fac0d250 | 61 | |
07a53e5c | 62 | /* Implements the .loc_mark_labels {0,1} directive. */ |
ba8826a8 | 63 | extern void dwarf2_directive_loc_mark_labels (int); |
07a53e5c | 64 | |
fac0d250 RH |
65 | /* Returns the current source information. If .file directives have |
66 | been encountered, the info for the corresponding source file is | |
67 | returned. Otherwise, the info for the assembly source file is | |
68 | returned. */ | |
ba8826a8 | 69 | extern void dwarf2_where (struct dwarf2_line_info *); |
fac0d250 | 70 | |
34bca508 | 71 | /* A hook to allow the target backend to inform the line number state |
ecea7679 | 72 | machine of isa changes when assembler debug info is enabled. */ |
ba8826a8 | 73 | extern void dwarf2_set_isa (unsigned int); |
ecea7679 | 74 | |
fac0d250 RH |
75 | /* This function generates .debug_line info based on the address and |
76 | source information passed in the arguments. ADDR should be the | |
77 | frag-relative offset of the instruction the information is for and | |
78 | L is the source information that should be associated with that | |
a01b9fa4 | 79 | address. */ |
ba8826a8 | 80 | extern void dwarf2_gen_line_info (addressT, struct dwarf2_line_info *); |
fac0d250 | 81 | |
220e750f | 82 | /* Must be called for each generated instruction. */ |
a2e22468 | 83 | extern void dwarf2_emit_insn (int); |
220e750f | 84 | |
e410add4 RS |
85 | void dwarf2_move_insn (int); |
86 | ||
661ba50f BW |
87 | /* Reset the state of the line number information to reflect that |
88 | it has been used. */ | |
89 | extern void dwarf2_consume_line_info (void); | |
90 | ||
07a53e5c RH |
91 | /* Should be called for each code label. */ |
92 | extern void dwarf2_emit_label (symbolS *); | |
93 | ||
1eee4adc BW |
94 | /* True when we've seen a .loc directive recently. Used to avoid |
95 | doing work when there's nothing to do. */ | |
5b7c81bd | 96 | extern bool dwarf2_loc_directive_seen; |
1eee4adc | 97 | |
07a53e5c | 98 | /* True when we're supposed to set the basic block mark whenever a label |
34bca508 | 99 | is seen. Unless the target is doing Something Weird, just call |
07a53e5c | 100 | dwarf2_emit_label. */ |
5b7c81bd | 101 | extern bool dwarf2_loc_mark_labels; |
07a53e5c | 102 | |
1e9cc1c2 NC |
103 | extern void dwarf2_init (void); |
104 | ||
a2e22468 | 105 | extern void dwarf2_finish (void); |
fac0d250 | 106 | |
a2e22468 KH |
107 | extern int dwarf2dbg_estimate_size_before_relax (fragS *); |
108 | extern int dwarf2dbg_relax_frag (fragS *); | |
109 | extern void dwarf2dbg_convert_frag (fragS *); | |
85a39694 | 110 | |
ba8826a8 AO |
111 | extern void dwarf2dbg_final_check (void); |
112 | ||
14e777e0 KB |
113 | /* An enumeration which describes the sizes of offsets (to DWARF sections) |
114 | and the mechanism by which the size is indicated. */ | |
ba8826a8 AO |
115 | enum dwarf2_format |
116 | { | |
14e777e0 KB |
117 | /* 32-bit format: the initial length field is 4 bytes long. */ |
118 | dwarf2_format_32bit, | |
119 | /* DWARF3 64-bit format: the representation of the initial length | |
120 | (of a DWARF section) is 0xffffffff (4 bytes) followed by eight | |
121 | bytes indicating the actual length. */ | |
122 | dwarf2_format_64bit, | |
123 | /* SGI extension to DWARF2: The initial length is eight bytes. */ | |
124 | dwarf2_format_64bit_irix | |
125 | }; | |
126 | ||
fac0d250 | 127 | #endif /* AS_DWARF2DBG_H */ |