Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] Merge set_register_cache() and supply_register(,NULL)
@ 2001-03-09 12:54 Andrew Cagney
  2001-03-09 13:46 ` Michael Snyder
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cagney @ 2001-03-09 12:54 UTC (permalink / raw)
  To: GDB Patches

Thoughts?

The attatched merges the semantics of the two sequences:

	supply_register (, zero_buf);
	set_register_cache(-1);

and 

	supply_register (, NULL);

Making the latter the only interface.  It marks the register as
unavailable and and stores zeroes in it.

The only thing looking that this ``unavailable'' status is the GUI
(Insight).

A number of existing targets suply NULL as the register value and, in
the cases I've checked the interpretation ``register not available'' is
the most applicable.

	Andrew
2001-03-08  Andrew Cagney  <ac131313@redhat.com>

	* remote.c (remote_fetch_registers): Supply a NULL register when
	register is not available.
	* regcache.h (set_register_cache): Delete declaration.
	(supply_register): Document behavour when register buffer is NULL.
	* regcache.c (set_register_cached): Make static.
	(supply_register): When buffer is NULL, mark register as
	unavailable.

Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.19
diff -p -r1.19 regcache.c
*** regcache.c	2001/03/06 08:21:11	1.19
--- regcache.c	2001/03/09 02:32:21
*************** supply_register (int regnum, char *val)
*** 536,548 ****
      }
  #endif
  
!   set_register_cached (regnum, 1);
!   if (val)
!     memcpy (register_buffer (regnum), val, 
! 	    REGISTER_RAW_SIZE (regnum));
    else
!     memset (register_buffer (regnum), '\000', 
! 	    REGISTER_RAW_SIZE (regnum));
  
    /* On some architectures, e.g. HPPA, there are a few stray bits in
       some registers, that the rest of the code would like to ignore.  */
--- 536,553 ----
      }
  #endif
  
!   if (val != NULL)
!     {
!       set_register_cached (regnum, 1);
!       memcpy (register_buffer (regnum), val, 
! 	      REGISTER_RAW_SIZE (regnum));
!     }
    else
!     {
!       set_register_cached (regnum, -1);
!       memset (register_buffer (regnum), '\000', 
! 	      REGISTER_RAW_SIZE (regnum));
!     }
  
    /* On some architectures, e.g. HPPA, there are a few stray bits in
       some registers, that the rest of the code would like to ignore.  */
Index: regcache.h
===================================================================
RCS file: /cvs/src/src/gdb/regcache.h,v
retrieving revision 1.3
diff -p -r1.3 regcache.h
*** regcache.h	2001/03/06 08:21:11	1.3
--- regcache.h	2001/03/09 02:32:21
*************** extern signed char *register_valid;
*** 34,41 ****
  
  extern int register_cached (int regnum);
  
- extern void set_register_cached (int regnum, int state);
- 
  extern void register_changed (int regnum);
  
  extern char *register_buffer (int regnum);
--- 34,39 ----
*************** extern LONGEST read_signed_register_pid 
*** 65,70 ****
--- 63,76 ----
  extern void write_register (int regnum, LONGEST val);
  
  extern void write_register_pid (int regnum, CORE_ADDR val, int pid);
+ 
+ /* Record that register REGNUM contains VAL.  This is used when the
+    value is obtained from the inferior or core dump, so there is no
+    need to store the value there.
+ 
+    If VAL is a NULL pointer, then it's probably an unsupported or
+    unavailable register.  We just set its value to all zeros and
+    record the register as unavailable.  */
  
  extern void supply_register (int regnum, char *val);
  
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.41
diff -p -r1.41 remote.c
*** remote.c	2001/03/06 08:21:13	1.41
--- remote.c	2001/03/09 02:32:36
*************** remote_fetch_registers (int regno)
*** 3092,3100 ****
  supply_them:
    for (i = 0; i < NUM_REGS; i++)
      {
-       supply_register (i, &regs[REGISTER_BYTE (i)]);
        if (buf[REGISTER_BYTE (i) * 2] == 'x')
! 	set_register_cached (i, -1);
      }
  }
  
--- 3092,3101 ----
  supply_them:
    for (i = 0; i < NUM_REGS; i++)
      {
        if (buf[REGISTER_BYTE (i) * 2] == 'x')
! 	supply_register (i, NULL);
!       else
! 	supply_register (i, &regs[REGISTER_BYTE (i)]);
      }
  }
  
From ac131313@cygnus.com Fri Mar 09 12:54:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: [fyi] Obsolete harris 88k target
Date: Fri, 09 Mar 2001 12:54:00 -0000
Message-id: <3AA8536B.BA956871@cygnus.com>
X-SW-Source: 2001-03/msg00147.html
Content-length: 358

FYI,

I've obsoleted the Harris 88k target/host/cross.

	Andrew
2001-03-08  Andrew Cagney  <ac131313@redhat.com>

	* configure.host (m88*-harris-cxux*): Mark as obsolete.
	* configure.tgt: Ditto.
	* config/m88k/xm-cxux.h: Ditto.
	* config/m88k/tm-cxux.h: Ditto.
	* config/m88k/nm-cxux.h: Ditto.
	* config/m88k/cxux.mt: Ditto.
	* config/m88k/cxux.mh: Ditto.


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

end of thread, other threads:[~2001-03-09 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-09 12:54 [rfc] Merge set_register_cache() and supply_register(,NULL) Andrew Cagney
2001-03-09 13:46 ` Michael Snyder

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