diff options
author | Pedro Alves <palves@redhat.com> | 2010-05-26 18:19:28 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2010-05-26 18:19:28 +0000 |
commit | dde08ee10924b57d4e1c80e40a6a1fe14c93dcb5 (patch) | |
tree | 1d24a9d5f315737edcb115c43f6ae024437126ba /gdb/gdbarch.c | |
parent | 0a5b531f15567f9b4d5b5ac6b6e89ee5e8e0e7f0 (diff) | |
download | gdb-dde08ee10924b57d4e1c80e40a6a1fe14c93dcb5.zip gdb-dde08ee10924b57d4e1c80e40a6a1fe14c93dcb5.tar.gz gdb-dde08ee10924b57d4e1c80e40a6a1fe14c93dcb5.tar.bz2 |
gdb/
2010-05-26 Pedro Alves <pedro@codesourcery.com>
* NEWS: Mention the `qRelocInsn' feature.
* gdbarch.sh (relocate_instruction): New.
* amd64-tdep.c (rip_relative_offset): New.
(append_insns): New.
(amd64_relocate_instruction): New.
(amd64_init_abi): Install it.
* i386-tdep.c (append_insns): New.
(i386_relocate_instruction): New.
(i386_gdbarch_init): Install it.
* remote.c (remote_get_noisy_reply): Handle qRelocInsn requests.
* gdbarch.h, gdbarch.c: Regenerate.
gdb/doc/
2010-05-26 Pedro Alves <pedro@codesourcery.com>
* gdb.texinfo (General Query Packets) <qSupported>: Describe the
`qRelocInsn' feature.
(Relocate instruction reply packet): New subsection
of `Tracepoint Packets'.
(Tracepoint Packets): Mention that packets QTDP and QTStart
support the qRelocInsn request, and add cross reference to new
subsection.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 626a9db..bf41ab3 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -245,6 +245,7 @@ struct gdbarch gdbarch_displaced_step_fixup_ftype *displaced_step_fixup; gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure; gdbarch_displaced_step_location_ftype *displaced_step_location; + gdbarch_relocate_instruction_ftype *relocate_instruction; gdbarch_overlay_update_ftype *overlay_update; gdbarch_core_read_description_ftype *core_read_description; gdbarch_static_transform_name_ftype *static_transform_name; @@ -392,6 +393,7 @@ struct gdbarch startup_gdbarch = 0, /* displaced_step_fixup */ NULL, /* displaced_step_free_closure */ NULL, /* displaced_step_location */ + 0, /* relocate_instruction */ 0, /* overlay_update */ 0, /* core_read_description */ 0, /* static_transform_name */ @@ -493,6 +495,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->displaced_step_fixup = NULL; gdbarch->displaced_step_free_closure = NULL; gdbarch->displaced_step_location = NULL; + gdbarch->relocate_instruction = NULL; gdbarch->target_signal_from_host = default_target_signal_from_host; gdbarch->target_signal_to_host = default_target_signal_to_host; gdbarch->has_shared_address_space = default_has_shared_address_space; @@ -667,6 +670,7 @@ verify_gdbarch (struct gdbarch *gdbarch) fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure"); if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn)) fprintf_unfiltered (log, "\n\tdisplaced_step_location"); + /* Skip verify of relocate_instruction, has predicate */ /* Skip verify of overlay_update, has predicate */ /* Skip verify of core_read_description, has predicate */ /* Skip verify of static_transform_name, has predicate */ @@ -1105,6 +1109,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: regset_from_core_section = <%s>\n", host_address_to_string (gdbarch->regset_from_core_section)); fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n", + gdbarch_relocate_instruction_p (gdbarch)); + fprintf_unfiltered (file, + "gdbarch_dump: relocate_instruction = <%s>\n", + host_address_to_string (gdbarch->relocate_instruction)); + fprintf_unfiltered (file, "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n", host_address_to_string (gdbarch->remote_breakpoint_from_pc)); fprintf_unfiltered (file, @@ -3303,6 +3313,31 @@ set_gdbarch_displaced_step_location (struct gdbarch *gdbarch, } int +gdbarch_relocate_instruction_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->relocate_instruction != NULL; +} + +void +gdbarch_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->relocate_instruction != NULL); + /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_relocate_instruction called\n"); + gdbarch->relocate_instruction (gdbarch, to, from); +} + +void +set_gdbarch_relocate_instruction (struct gdbarch *gdbarch, + gdbarch_relocate_instruction_ftype relocate_instruction) +{ + gdbarch->relocate_instruction = relocate_instruction; +} + +int gdbarch_overlay_update_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); |