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