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.h | |
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.h')
-rw-r--r-- | gdb/gdbarch.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index af060df..e0c933c 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -806,6 +806,24 @@ typedef CORE_ADDR (gdbarch_displaced_step_location_ftype) (struct gdbarch *gdbar extern CORE_ADDR gdbarch_displaced_step_location (struct gdbarch *gdbarch); extern void set_gdbarch_displaced_step_location (struct gdbarch *gdbarch, gdbarch_displaced_step_location_ftype *displaced_step_location); +/* Relocate an instruction to execute at a different address. OLDLOC + is the address in the inferior memory where the instruction to + relocate is currently at. On input, TO points to the destination + where we want the instruction to be copied (and possibly adjusted) + to. On output, it points to one past the end of the resulting + instruction(s). The effect of executing the instruction at TO shall + be the same as if executing it at FROM. For example, call + instructions that implicitly push the return address on the stack + should be adjusted to return to the instruction after OLDLOC; + relative branches, and other PC-relative instructions need the + offset adjusted; etc. */ + +extern int gdbarch_relocate_instruction_p (struct gdbarch *gdbarch); + +typedef void (gdbarch_relocate_instruction_ftype) (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from); +extern void gdbarch_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from); +extern void set_gdbarch_relocate_instruction (struct gdbarch *gdbarch, gdbarch_relocate_instruction_ftype *relocate_instruction); + /* Refresh overlay mapped state for section OSECT. */ extern int gdbarch_overlay_update_p (struct gdbarch *gdbarch); |