This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFC] PATCH gdb/arm convert to CALL_DUMMY_WORDS
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: Richard dot Earnshaw at arm dot com
- Date: Wed, 23 Jan 2002 16:28:31 +0000
- Subject: [RFC] PATCH gdb/arm convert to CALL_DUMMY_WORDS
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
There seems to be some dispute as to what is "trivial" for the multi-arch
work... So to play it safe:
This patch converts the ARM targets to use CALL_DUMMY_WORDS, as described
in the "converting to multi-arch" document.
R
<date> Richard Earnshaw <rearnsha@arm.com>
* arm-tdep.c (arm_call_dummy_words): Define.
* arm-linux-tdep.c (arm_linux_call_dummy_words): Define.
* config/arm/tm-arm.h (CALL_DUMMY_P): Define.
(CALL_DUMMY_WORDS): Define.
(arm_call_dummy_words): Declare.
* config/arm/tm-linux.h (CALL_DUMMY_WORDS): Define.
(arm_linux_call_dummy_words): Declare.
Index: arm-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-tdep.c,v
retrieving revision 1.12
diff -p -r1.12 arm-linux-tdep.c
*** arm-linux-tdep.c 2001/12/10 22:04:10 1.12
--- arm-linux-tdep.c 2002/01/23 16:23:38
***************
*** 33,38 ****
--- 33,52 ----
#include "symfile.h"
#include "objfiles.h"
+ /* CALL_DUMMY_WORDS:
+ This sequence of words is the instructions
+
+ mov lr, pc
+ mov pc, r4
+ swi bkpt_swi
+
+ Note this is 12 bytes. */
+
+ LONGEST arm_linux_call_dummy_words[] =
+ {
+ 0xe1a0e00f, 0xe1a0f004, 0xef9f001
+ };
+
#ifdef GET_LONGJMP_TARGET
/* Figure out where the longjmp will land. We expect that we have
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.29
diff -p -r1.29 arm-tdep.c
*** arm-tdep.c 2002/01/21 20:12:36 1.29
--- arm-tdep.c 2002/01/23 16:23:38
*************** arm_push_dummy_frame (void)
*** 1249,1254 ****
--- 1249,1268 ----
write_register (SP_REGNUM, sp);
}
+ /* CALL_DUMMY_WORDS:
+ This sequence of words is the instructions
+
+ mov lr,pc
+ mov pc,r4
+ illegal
+
+ Note this is 12 bytes. */
+
+ LONGEST arm_call_dummy_words[] =
+ {
+ 0xe1a0e00f, 0xe1a0f004, 0xe7ffdefe
+ };
+
/* Fix up the call dummy, based on whether the processor is currently
in Thumb or ARM mode, and whether the target function is Thumb or
ARM. There are three different situations requiring three
Index: config/arm/tm-arm.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-arm.h,v
retrieving revision 1.17
diff -p -r1.17 tm-arm.h
*** tm-arm.h 2002/01/21 17:36:11 1.17
--- tm-arm.h 2002/01/23 16:23:39
*************** void arm_pop_frame (void);
*** 407,421 ****
#define POP_FRAME arm_pop_frame ()
! /* This sequence of words is the instructions
! mov lr,pc
! mov pc,r4
! illegal
! Note this is 12 bytes. */
- #define CALL_DUMMY {0xe1a0e00f, 0xe1a0f004, 0xe7ffdefe}
#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
#define CALL_DUMMY_BREAKPOINT_OFFSET arm_call_dummy_breakpoint_offset()
--- 407,419 ----
#define POP_FRAME arm_pop_frame ()
! #define CALL_DUMMY_P (1)
! #define CALL_DUMMY_WORDS arm_call_dummy_words
! extern LONGEST arm_call_dummy_words[];
! #define SIZEOF_CALL_DUMMY_WORDS (3 * sizeof (LONGEST))
#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
#define CALL_DUMMY_BREAKPOINT_OFFSET arm_call_dummy_breakpoint_offset()
Index: config/arm/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-linux.h,v
retrieving revision 1.9
diff -p -r1.9 tm-linux.h
*** tm-linux.h 2002/01/20 19:26:48 1.9
--- tm-linux.h 2002/01/23 16:23:39
*************** extern struct link_map_offsets *arm_linu
*** 44,60 ****
#undef ARM_LE_BREAKPOINT
#define ARM_LE_BREAKPOINT {0x01,0x00,0x9f,0xef}
! /* This sequence of words used in the CALL_DUMMY are the following
! instructions:
!
! mov lr, pc
! mov pc, r4
! swi bkpt_swi
!
! Note this is 12 bytes. */
!
! #undef CALL_DUMMY
! #define CALL_DUMMY {0xe1a0e00f, 0xe1a0f004, 0xef9f001}
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
--- 44,52 ----
#undef ARM_LE_BREAKPOINT
#define ARM_LE_BREAKPOINT {0x01,0x00,0x9f,0xef}
! #undef CALL_DUMMY_WORDS
! #define CALL_DUMMY_WORDS arm_linux_call_dummy_words
! extern LONGEST arm_linux_call_dummy_words[];
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,