This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH ARM/Linux multi-arch a few easy things


Move the easy bits into the multi-arch vector (LOWEST_PC) was already 
there.

2002-02-23  Richard Earnshaw  <rearnsha@arm.com>

	* arm-linux-tdep.c (arm_linux_extract_return_value): Make static.
	(arm_linux_push_arguments): Likewise.
	(arm_linux_init_abi): Register them.  Also register linux-specific
	call_dummy_words.
	(find_minsym_and_objfile): Use strcmp, not STREQ.
	* config/arm/tm-linux.h (CALL_DUMMY_WORDS): Delete.
	(arm_linux_call_dummy_words): Delete declaration.
	(EXTRACT_RETURN_VALUE, PUSH_ARGUMENTS): Delete.
	(arm_linux_extract_return_value, arm_linux_push_arguments): Delete
	declarations.
	(LOWEST_PC): Delete.


Index: arm-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-tdep.c,v
retrieving revision 1.18
diff -p -p -r1.18 arm-linux-tdep.c
*** arm-linux-tdep.c	2002/02/19 14:28:57	1.18
--- arm-linux-tdep.c	2002/02/23 16:51:33
*************** LONGEST arm_linux_call_dummy_words[] =
*** 66,73 ****
  /* Extract from an array REGBUF containing the (raw) register state
     a function return value of type TYPE, and copy that, in virtual format,
     into VALBUF.  */
! 
! void
  arm_linux_extract_return_value (struct type *type,
  				char regbuf[REGISTER_BYTES],
  				char *valbuf)
--- 66,76 ----
  /* Extract from an array REGBUF containing the (raw) register state
     a function return value of type TYPE, and copy that, in virtual format,
     into VALBUF.  */
! /* FIXME rearnsha/2002-02-23: This function shouldn't be necessary.
!    The ARM generic one should be able to handle the model used by
!    linux and the low-level formatting of the registers should be
!    hidden behind the regcache abstraction.  */
! static void
  arm_linux_extract_return_value (struct type *type,
  				char regbuf[REGISTER_BYTES],
  				char *valbuf)
*************** arm_linux_extract_return_value (struct t
*** 101,107 ****
  #define MAKE_THUMB_ADDR(addr)	((addr) | 1)
  #define UNMAKE_THUMB_ADDR(addr) ((addr) & ~1)
     	  
! CORE_ADDR
  arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
  		          int struct_return, CORE_ADDR struct_addr)
  {
--- 104,110 ----
  #define MAKE_THUMB_ADDR(addr)	((addr) | 1)
  #define UNMAKE_THUMB_ADDR(addr) ((addr) & ~1)
     	  
! static CORE_ADDR
  arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
  		          int struct_return, CORE_ADDR struct_addr)
  {
*************** find_minsym_and_objfile (char *name, str
*** 360,366 ****
        ALL_OBJFILE_MSYMBOLS (objfile, msym)
  	{
  	  if (SYMBOL_NAME (msym)
! 	      && STREQ (SYMBOL_NAME (msym), name))
  	    {
  	      *objfile_p = objfile;
  	      return msym;
--- 363,369 ----
        ALL_OBJFILE_MSYMBOLS (objfile, msym)
  	{
  	  if (SYMBOL_NAME (msym)
! 	      && strcmp (SYMBOL_NAME (msym), name) == 0)
  	    {
  	      *objfile_p = objfile;
  	      return msym;
*************** arm_linux_init_abi (struct gdbarch_info 
*** 523,528 ****
--- 526,539 ----
  
    tdep->jb_pc = JB_PC;
    tdep->jb_elt_size = JB_ELEMENT_SIZE;
+ 
+   set_gdbarch_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
+   set_gdbarch_sizeof_call_dummy_words (gdbarch,
+ 				       sizeof (arm_linux_call_dummy_words));
+ 
+   /* The following two overrides shouldn't be needed.  */
+   set_gdbarch_extract_return_value (gdbarch, arm_linux_extract_return_value);
+   set_gdbarch_push_arguments (gdbarch, arm_linux_push_arguments);
  }
  
  void
Index: config/arm/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-linux.h,v
retrieving revision 1.14
diff -p -p -r1.14 tm-linux.h
*** tm-linux.h	2002/02/19 14:29:00	1.14
--- tm-linux.h	2002/02/23 16:51:36
***************
*** 34,79 ****
  extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void);
  #define SVR4_FETCH_LINK_MAP_OFFSETS() arm_linux_svr4_fetch_link_map_offsets ()
  
- #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,
-    into VALBUF.  */
- struct type;
- struct value;
- extern void arm_linux_extract_return_value (struct type *, char[], char *);
- #undef EXTRACT_RETURN_VALUE
- #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- 	arm_linux_extract_return_value ((TYPE), (REGBUF), (VALBUF))
- 
- /* Things needed for making the inferior call functions.  
- 
-    FIXME:  This and arm_push_arguments should be merged.  However this 
-    	   function breaks on a little endian host, big endian target
-    	   using the COFF file format.  ELF is ok.  
-    	   
-    	   ScottB.  */
- 
- #undef PUSH_ARGUMENTS
- #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
-      sp = arm_linux_push_arguments ((nargs), (args), (sp), (struct_return), \
-      				    (struct_addr))
- extern CORE_ADDR arm_linux_push_arguments (int, struct value **, CORE_ADDR, 
- 					   int, CORE_ADDR);
- 
- /* The first page is not writeable in ARM GNU/Linux.  */
- #undef LOWEST_PC
- #define LOWEST_PC	0x8000
- 
- /* Define NO_SINGLE_STEP if ptrace(PT_STEP,...) fails to function
-    correctly on ARM Linux kernel.  This is the case on 2.0.x kernels,
-    2.1.x kernels and some 2.2.x kernels.  This will include the
-    implementation of single_step() in armlinux-tdep.c.  See
-    armlinux-ss.c for more details. */
- /* #define NO_SINGLE_STEP	1 */
- 
  /* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
  #define SIGCONTEXT_PC_OFFSET	(sizeof(unsigned long) * 18)
  
--- 34,39 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]