X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fgdbarch.c;h=fa6be50730b4aac73a73754f769453456927ba1e;hb=e264b5b7a57dab997776ae845f9e0b3e5f20c713;hp=2b3fcef004febe84097dc65e13eb69017728ff90;hpb=6e056c817845f3d736a1be6b68c69b439c6c6d25;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 2b3fcef004..fa6be50730 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -324,6 +324,7 @@ struct gdbarch const char * stap_gdb_register_suffix; gdbarch_stap_is_single_operand_ftype *stap_is_single_operand; gdbarch_stap_parse_special_token_ftype *stap_parse_special_token; + gdbarch_stap_adjust_register_ftype *stap_adjust_register; gdbarch_dtrace_parse_probe_argument_ftype *dtrace_parse_probe_argument; gdbarch_dtrace_probe_is_enabled_ftype *dtrace_probe_is_enabled; gdbarch_dtrace_enable_probe_ftype *dtrace_enable_probe; @@ -357,6 +358,7 @@ struct gdbarch char ** disassembler_options; const disasm_options_and_args_t * valid_disassembler_options; gdbarch_type_align_ftype *type_align; + gdbarch_get_pc_address_flags_ftype *get_pc_address_flags; }; /* Create a new ``struct gdbarch'' based on information provided by @@ -472,6 +474,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->gnu_triplet_regexp = default_gnu_triplet_regexp; gdbarch->addressable_memory_unit_size = default_addressable_memory_unit_size; gdbarch->type_align = default_type_align; + gdbarch->get_pc_address_flags = default_get_pc_address_flags; /* gdbarch_alloc() */ return gdbarch; @@ -687,6 +690,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */ /* Skip verify of stap_is_single_operand, has predicate. */ /* Skip verify of stap_parse_special_token, has predicate. */ + /* Skip verify of stap_adjust_register, has predicate. */ /* Skip verify of dtrace_parse_probe_argument, has predicate. */ /* Skip verify of dtrace_probe_is_enabled, has predicate. */ /* Skip verify of dtrace_enable_probe, has predicate. */ @@ -719,6 +723,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of disassembler_options, invalid_p == 0 */ /* Skip verify of valid_disassembler_options, invalid_p == 0 */ /* Skip verify of type_align, invalid_p == 0 */ + /* Skip verify of get_pc_address_flags, invalid_p == 0 */ if (!log.empty ()) internal_error (__FILE__, __LINE__, _("verify_gdbarch: the following are invalid ...%s"), @@ -1063,6 +1068,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: get_longjmp_target = <%s>\n", host_address_to_string (gdbarch->get_longjmp_target)); + fprintf_unfiltered (file, + "gdbarch_dump: get_pc_address_flags = <%s>\n", + host_address_to_string (gdbarch->get_pc_address_flags)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n", gdbarch_get_siginfo_type_p (gdbarch)); @@ -1396,6 +1404,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: stack_frame_destroyed_p = <%s>\n", host_address_to_string (gdbarch->stack_frame_destroyed_p)); + fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_stap_adjust_register_p() = %d\n", + gdbarch_stap_adjust_register_p (gdbarch)); + fprintf_unfiltered (file, + "gdbarch_dump: stap_adjust_register = <%s>\n", + host_address_to_string (gdbarch->stap_adjust_register)); fprintf_unfiltered (file, "gdbarch_dump: stap_gdb_register_prefix = %s\n", pstring (gdbarch->stap_gdb_register_prefix)); @@ -3766,7 +3780,7 @@ gdbarch_core_pid_to_str_p (struct gdbarch *gdbarch) return gdbarch->core_pid_to_str != NULL; } -const char * +std::string gdbarch_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid) { gdb_assert (gdbarch != NULL); @@ -4515,6 +4529,30 @@ set_gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, gdbarch->stap_parse_special_token = stap_parse_special_token; } +int +gdbarch_stap_adjust_register_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->stap_adjust_register != NULL; +} + +std::string +gdbarch_stap_adjust_register (struct gdbarch *gdbarch, struct stap_parse_info *p, const std::string ®name, int regnum) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->stap_adjust_register != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_adjust_register called\n"); + return gdbarch->stap_adjust_register (gdbarch, p, regname, regnum); +} + +void +set_gdbarch_stap_adjust_register (struct gdbarch *gdbarch, + gdbarch_stap_adjust_register_ftype stap_adjust_register) +{ + gdbarch->stap_adjust_register = stap_adjust_register; +} + int gdbarch_dtrace_parse_probe_argument_p (struct gdbarch *gdbarch) { @@ -4523,13 +4561,13 @@ gdbarch_dtrace_parse_probe_argument_p (struct gdbarch *gdbarch) } void -gdbarch_dtrace_parse_probe_argument (struct gdbarch *gdbarch, struct parser_state *pstate, int narg) +gdbarch_dtrace_parse_probe_argument (struct gdbarch *gdbarch, struct expr_builder *builder, int narg) { gdb_assert (gdbarch != NULL); gdb_assert (gdbarch->dtrace_parse_probe_argument != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_dtrace_parse_probe_argument called\n"); - gdbarch->dtrace_parse_probe_argument (gdbarch, pstate, narg); + gdbarch->dtrace_parse_probe_argument (gdbarch, builder, narg); } void @@ -5005,7 +5043,7 @@ set_gdbarch_infcall_munmap (struct gdbarch *gdbarch, gdbarch->infcall_munmap = infcall_munmap; } -char * +std::string gdbarch_gcc_target_options (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); @@ -5124,6 +5162,23 @@ set_gdbarch_type_align (struct gdbarch *gdbarch, gdbarch->type_align = type_align; } +std::string +gdbarch_get_pc_address_flags (struct gdbarch *gdbarch, frame_info *frame, CORE_ADDR pc) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->get_pc_address_flags != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_get_pc_address_flags called\n"); + return gdbarch->get_pc_address_flags (frame, pc); +} + +void +set_gdbarch_get_pc_address_flags (struct gdbarch *gdbarch, + gdbarch_get_pc_address_flags_ftype get_pc_address_flags) +{ + gdbarch->get_pc_address_flags = get_pc_address_flags; +} + /* Keep a registry of per-architecture data-pointers required by GDB modules. */