Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@cygnus.com>
To: gdb-patches@sources.redhat.com
Cc: cagney@redhat.com
Subject: [PATCH] Generic register_virtual_size function.
Date: Mon, 10 Dec 2001 13:44:00 -0000	[thread overview]
Message-ID: <200112102141.fBALfJW01783@reddwarf.cygnus.com> (raw)


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


             reply	other threads:[~2001-12-10 21:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-10 13:44 Michael Snyder [this message]
2001-12-10 13:46 ` Michael Snyder
2001-12-10 14:39   ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200112102141.fBALfJW01783@reddwarf.cygnus.com \
    --to=msnyder@cygnus.com \
    --cc=cagney@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox