From 144db8270db6f4f3c5f0f59f08809ba14c5bc826 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 26 Oct 2012 19:34:09 +0000 Subject: [PATCH] 2012-10-26 Pedro Alves * amd64-tdep.c (amd64_relocate_instruction): Use store_unsigned_integer instead of memcpy. * i386-tdep.c (i386_relocate_instruction): Ditto. --- gdb/ChangeLog | 6 ++++++ gdb/amd64-tdep.c | 2 +- gdb/i386-tdep.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fb6c9902919..cb2c7d0b04e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2012-10-26 Pedro Alves + + * amd64-tdep.c (amd64_relocate_instruction): Use + store_unsigned_integer instead of memcpy. + * i386-tdep.c (i386_relocate_instruction): Ditto. + 2012-10-26 Pedro Alves * infrun.c (handle_inferior_event): Merge handling of diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index a4172fc2dc1..2edaecf1427 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -1631,7 +1631,7 @@ amd64_relocate_instruction (struct gdbarch *gdbarch, /* Where "ret" in the original code will return to. */ ret_addr = oldloc + insn_length; push_buf[0] = 0x68; /* pushq $... */ - memcpy (&push_buf[1], &ret_addr, 4); + store_unsigned_integer (&push_buf[1], 4, byte_order, ret_addr); /* Push the push. */ append_insns (to, 5, push_buf); diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 2768dbc9630..df29b71532e 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -750,7 +750,7 @@ i386_relocate_instruction (struct gdbarch *gdbarch, /* Where "ret" in the original code will return to. */ ret_addr = oldloc + insn_length; push_buf[0] = 0x68; /* pushq $... */ - memcpy (&push_buf[1], &ret_addr, 4); + store_unsigned_integer (&push_buf[1], 4, byte_order, ret_addr); /* Push the push. */ append_insns (to, 5, push_buf); -- 2.30.2