]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/compile/compile.h
Normalize include guards in gdb
[thirdparty/binutils-gdb.git] / gdb / compile / compile.h
1 /* Header file for Compile and inject module.
2
3 Copyright (C) 2014-2019 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18 #ifndef COMPILE_COMPILE_H
19 #define COMPILE_COMPILE_H
20
21 struct ui_file;
22 struct gdbarch;
23 struct dwarf2_per_cu_data;
24 struct symbol;
25 struct dynamic_prop;
26
27 /* Public function that is called from compile_control case in the
28 expression command. GDB returns either a CMD, or a CMD_STRING, but
29 never both. */
30
31 extern void eval_compile_command (struct command_line *cmd,
32 const char *cmd_string,
33 enum compile_i_scope_types scope,
34 void *scope_data);
35
36 /* Compile a DWARF location expression to C, suitable for use by the
37 compiler.
38
39 STREAM is the stream where the code should be written.
40
41 RESULT_NAME is the name of a variable in the resulting C code. The
42 result of the expression will be assigned to this variable.
43
44 SYM is the symbol corresponding to this expression.
45 PC is the location at which the expression is being evaluated.
46 ARCH is the architecture to use.
47
48 REGISTERS_USED is an out parameter which is updated to note which
49 registers were needed by this expression.
50
51 ADDR_SIZE is the DWARF address size to use.
52
53 OPT_PTR and OP_END are the bounds of the DWARF expression.
54
55 PER_CU is the per-CU object used for looking up various other
56 things. */
57
58 extern void compile_dwarf_expr_to_c (string_file *stream,
59 const char *result_name,
60 struct symbol *sym,
61 CORE_ADDR pc,
62 struct gdbarch *arch,
63 unsigned char *registers_used,
64 unsigned int addr_size,
65 const gdb_byte *op_ptr,
66 const gdb_byte *op_end,
67 struct dwarf2_per_cu_data *per_cu);
68
69 /* Compile a DWARF bounds expression to C, suitable for use by the
70 compiler.
71
72 STREAM is the stream where the code should be written.
73
74 RESULT_NAME is the name of a variable in the resulting C code. The
75 result of the expression will be assigned to this variable.
76
77 PROP is the dynamic property for which we're compiling.
78
79 SYM is the symbol corresponding to this expression.
80 PC is the location at which the expression is being evaluated.
81 ARCH is the architecture to use.
82
83 REGISTERS_USED is an out parameter which is updated to note which
84 registers were needed by this expression.
85
86 ADDR_SIZE is the DWARF address size to use.
87
88 OPT_PTR and OP_END are the bounds of the DWARF expression.
89
90 PER_CU is the per-CU object used for looking up various other
91 things. */
92
93 extern void compile_dwarf_bounds_to_c (string_file *stream,
94 const char *result_name,
95 const struct dynamic_prop *prop,
96 struct symbol *sym, CORE_ADDR pc,
97 struct gdbarch *arch,
98 unsigned char *registers_used,
99 unsigned int addr_size,
100 const gdb_byte *op_ptr,
101 const gdb_byte *op_end,
102 struct dwarf2_per_cu_data *per_cu);
103
104 extern void compile_print_value (struct value *val, void *data_voidp);
105
106 /* Command element for the 'compile' command. */
107 extern cmd_list_element *compile_cmd_element;
108
109 #endif /* COMPILE_COMPILE_H */