aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-01-23 12:20:11 -0700
committerTom Tromey <tom@tromey.com>2021-01-23 20:33:25 -0700
commit3637a558a50141676f9997979491296dc007168d (patch)
tree6a15b32e0bbf8f7d81f6557cbc0ce0e343bddbd2 /gdb/dwarf2
parent18454c151f5824564130ba626bd90e9de30444ef (diff)
downloadfsf-binutils-gdb-3637a558a50141676f9997979491296dc007168d.zip
fsf-binutils-gdb-3637a558a50141676f9997979491296dc007168d.tar.gz
fsf-binutils-gdb-3637a558a50141676f9997979491296dc007168d.tar.bz2
Use std::vector for "registers_used" in compile feature
This changes the GDB compile code to use std::vector<bool> when computing which registers are used. This is a bit more idiomatic, but the main benefit is that it also adds some checking when the libstd++ debug mode is enabled. 2021-01-23 Tom Tromey <tom@tromey.com> * symtab.h (struct symbol_computed_ops) <generate_c_location>: Change type of "registers_used". * dwarf2/loc.h (dwarf2_compile_property_to_c): Update. * dwarf2/loc.c (dwarf2_compile_property_to_c) (locexpr_generate_c_location, loclist_generate_c_location): Change type of "registers_used". * compile/compile.h (compile_dwarf_expr_to_c) (compile_dwarf_bounds_to_c): Update. * compile/compile-loc2c.c (pushf_register_address) (pushf_register, do_compile_dwarf_expr_to_c) (compile_dwarf_expr_to_c, compile_dwarf_bounds_to_c): Change type of "registers_used". * compile/compile-c.h (generate_c_for_variable_locations): Update. * compile/compile-c-symbols.c (generate_vla_size) (generate_c_for_for_one_variable): Change type of "registers_used". (generate_c_for_variable_locations): Return std::vector. * compile/compile-c-support.c (generate_register_struct): Change type of "registers_used". (compute): Update.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/loc.c6
-rw-r--r--gdb/dwarf2/loc.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 580e5b0..aec50da 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -2699,7 +2699,7 @@ void
dwarf2_compile_property_to_c (string_file *stream,
const char *result_name,
struct gdbarch *gdbarch,
- unsigned char *registers_used,
+ std::vector<bool> &registers_used,
const struct dynamic_prop *prop,
CORE_ADDR pc,
struct symbol *sym)
@@ -4475,7 +4475,7 @@ locexpr_tracepoint_var_ref (struct symbol *symbol, struct agent_expr *ax,
static void
locexpr_generate_c_location (struct symbol *sym, string_file *stream,
struct gdbarch *gdbarch,
- unsigned char *registers_used,
+ std::vector<bool> &registers_used,
CORE_ADDR pc, const char *result_name)
{
struct dwarf2_locexpr_baton *dlbaton
@@ -4707,7 +4707,7 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct agent_expr *ax,
static void
loclist_generate_c_location (struct symbol *sym, string_file *stream,
struct gdbarch *gdbarch,
- unsigned char *registers_used,
+ std::vector<bool> &registers_used,
CORE_ADDR pc, const char *result_name)
{
struct dwarf2_loclist_baton *dlbaton
diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h
index 694300f..2943baf 100644
--- a/gdb/dwarf2/loc.h
+++ b/gdb/dwarf2/loc.h
@@ -120,7 +120,7 @@ bool dwarf2_evaluate_property (const struct dynamic_prop *prop,
void dwarf2_compile_property_to_c (string_file *stream,
const char *result_name,
struct gdbarch *gdbarch,
- unsigned char *registers_used,
+ std::vector<bool> &registers_used,
const struct dynamic_prop *prop,
CORE_ADDR address,
struct symbol *sym);