1 /* Header file for Compile and inject module.
3 Copyright (C) 2014-2019 Free Software Foundation, Inc.
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.
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.
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/>. */
23 struct dwarf2_per_cu_data;
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
31 extern void eval_compile_command (struct command_line *cmd,
32 const char *cmd_string,
33 enum compile_i_scope_types scope,
36 /* Compile a DWARF location expression to C, suitable for use by the
39 STREAM is the stream where the code should be written.
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.
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.
48 REGISTERS_USED is an out parameter which is updated to note which
49 registers were needed by this expression.
51 ADDR_SIZE is the DWARF address size to use.
53 OPT_PTR and OP_END are the bounds of the DWARF expression.
55 PER_CU is the per-CU object used for looking up various other
58 extern void compile_dwarf_expr_to_c (string_file *stream,
59 const char *result_name,
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);
69 /* Compile a DWARF bounds expression to C, suitable for use by the
72 STREAM is the stream where the code should be written.
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.
77 PROP is the dynamic property for which we're compiling.
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.
83 REGISTERS_USED is an out parameter which is updated to note which
84 registers were needed by this expression.
86 ADDR_SIZE is the DWARF address size to use.
88 OPT_PTR and OP_END are the bounds of the DWARF expression.
90 PER_CU is the per-CU object used for looking up various other
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,
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);
104 extern void compile_print_value (struct value *val, void *data_voidp);
106 /* Command element for the 'compile' command. */
107 extern cmd_list_element *compile_cmd_element;
109 #endif /* GDB_COMPILE_H */