diff options
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 06eccad..b14cee8 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -214,6 +214,7 @@ struct gdbarch gdbarch_saved_pc_after_call_ftype *saved_pc_after_call; gdbarch_frame_num_args_ftype *frame_num_args; gdbarch_stack_align_ftype *stack_align; + gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr; }; @@ -319,6 +320,7 @@ struct gdbarch startup_gdbarch = { 0, 0, 0, + 0, /* startup_gdbarch() */ }; struct gdbarch *current_gdbarch = &startup_gdbarch; @@ -623,6 +625,7 @@ verify_gdbarch (struct gdbarch *gdbarch) && (gdbarch->frame_num_args == 0)) internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid"); /* Skip verify of stack_align, has predicate */ + /* Skip verify of reg_struct_has_addr, has predicate */ } @@ -962,6 +965,10 @@ gdbarch_dump (void) "gdbarch_update: STACK_ALIGN = 0x%08lx\n", (long) current_gdbarch->stack_align /*STACK_ALIGN ()*/); + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: REG_STRUCT_HAS_ADDR = 0x%08lx\n", + (long) current_gdbarch->reg_struct_has_addr + /*REG_STRUCT_HAS_ADDR ()*/); } struct gdbarch_tdep * @@ -2517,6 +2524,29 @@ set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch->stack_align = stack_align; } +int +gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch) +{ + return gdbarch->reg_struct_has_addr != 0; +} + +int +gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) +{ + if (gdbarch->reg_struct_has_addr == 0) + internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n"); + return gdbarch->reg_struct_has_addr (gcc_p, type); +} + +void +set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, + gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr) +{ + gdbarch->reg_struct_has_addr = reg_struct_has_addr; +} + /* Keep a registrary of per-architecture data-pointers required by GDB modules. */ |