Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Generic register_virtual_size function.
@ 2001-12-10 13:44 Michael Snyder
  2001-12-10 13:46 ` Michael Snyder
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Snyder @ 2001-12-10 13:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: cagney


This idea occurred to me after looking at Andrew's 
generic version of register_raw_size:

2001-12-10  Michael Snyder  <msnyder@redhat.com>

	* arch-utils.c (generic_register_virtual_size): New function.
	* arch-utils.h: Export generic version of register_virtual_size.
	* gdbarch.sh (REGISTER_VIRTUAL_SIZE): Use new function as default.
	* gdbarch.c: Regenerate.

Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.96
diff -c -3 -p -r1.96 gdbarch.sh
*** gdbarch.sh	2001/12/10 04:58:29	1.96
--- gdbarch.sh	2001/12/10 21:40:13
*************** v:2:REGISTER_BYTES:int:register_bytes:::
*** 429,435 ****
  f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::0:0
  f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::generic_register_raw_size:0
  v:2:MAX_REGISTER_RAW_SIZE:int:max_register_raw_size::::0:-1
! f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::0:0
  v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1
  f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
  f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs:::do_registers_info::0
--- 429,435 ----
  f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::0:0
  f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::generic_register_raw_size:0
  v:2:MAX_REGISTER_RAW_SIZE:int:max_register_raw_size::::0:-1
! f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::generic_register_virtual_size:0
  v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1
  f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
  f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs:::do_registers_info::0
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.91
diff -c -3 -p -r1.91 gdbarch.c
*** gdbarch.c	2001/12/10 04:58:29	1.91
--- gdbarch.c	2001/12/10 21:40:13
*************** struct gdbarch startup_gdbarch =
*** 314,320 ****
    0,
    generic_register_raw_size,
    0,
!   0,
    0,
    0,
    0,
--- 314,320 ----
    0,
    generic_register_raw_size,
    0,
!   generic_register_virtual_size,
    0,
    0,
    0,
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.40
diff -c -3 -p -r1.40 arch-utils.c
*** arch-utils.c	2001/12/10 04:58:29	1.40
--- arch-utils.c	2001/12/10 21:40:13
*************** generic_register_raw_size (int regnum)
*** 387,392 ****
--- 387,400 ----
    return TARGET_INT_BIT / HOST_CHAR_BIT;
  }
  
+ /* Assume the virtual size corresponds to the virtual type.  */
+ 
+ int
+ generic_register_virtual_size (int regnum)
+ {
+   return REGISTER_VIRTUAL_TYPE (regnum);
+ }
+ 
  \f
  /* Functions to manipulate the endianness of the target.  */
  
Index: arch-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.h,v
retrieving revision 1.25
diff -c -3 -p -r1.25 arch-utils.h
*** arch-utils.h	2001/12/10 04:58:29	1.25
--- arch-utils.h	2001/12/10 21:40:13
*************** extern int generic_in_function_epilogue_
*** 142,145 ****
--- 142,149 ----
     of the integer type.  */
  extern int generic_register_raw_size (int regnum);
  
+ /* Assume the virtual size of registers corresponds to the virtual type.  */
+ 
+ extern int generic_register_virtual_type (int regnum);
+ 
  #endif


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-12-10 22:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-10 13:44 [PATCH] Generic register_virtual_size function Michael Snyder
2001-12-10 13:46 ` Michael Snyder
2001-12-10 14:39   ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox