From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: [rfc] Merge set_register_cache() and supply_register(,NULL)
Date: Fri, 09 Mar 2001 12:54:00 -0000 [thread overview]
Message-ID: <3AA8491C.CC265D5E@cygnus.com> (raw)
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, ®s[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, ®s[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.
next reply other threads:[~2001-03-09 12:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-09 12:54 Andrew Cagney [this message]
2001-03-09 13:46 ` Michael Snyder
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=3AA8491C.CC265D5E@cygnus.com \
--to=ac131313@cygnus.com \
--cc=gdb-patches@sourceware.cygnus.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