From: Keith Seitz <keiths@redhat.com>
To: Insight Maling List <insight@sources.redhat.com>
Subject: [PATCH] Remove REGISTER_BYTES
Date: Fri, 01 Mar 2002 11:03:00 -0000 [thread overview]
Message-ID: <Pine.GSO.4.33.0203011100370.15276-100000@makita.cygnus.com> (raw)
Hi,
This patch removes the macro REGISTER_BYTES from our code. Although at one
time it was true that all NUM_REGS+NUM_PSEUDO_REGS were stored in
REGISTER_BYTES, this assumption no longer works. Gdb is cleaning up its
act, and we must, too.
Keith
ChangeLog
2002-03-01 Keith Seitz <keiths@redhat.com>
* generic/gdbtk-register.c (register_changed_p): Don't use REGISTER_BYTES.
There is no guarantee anymore that REGISTER_BYTES contains
NUM_REGS+NUM_PSEUDO_REGS registers.
(setup_architecture_data): Likewise.
Patch
Index: generic/gdbtk-register.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v
retrieving revision 1.6
diff -p -r1.6 gdbtk-register.c
*** generic/gdbtk-register.c 2002/02/07 05:05:06 1.6
--- generic/gdbtk-register.c 2002/03/01 19:00:33
***************
*** 28,35 ****
#include "gdbtk-cmds.h"
/* This contains the previous values of the registers, since the last call to
! gdb_changed_register_list. */
static char *old_regs = NULL;
static int get_pc_register (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
--- 28,37 ----
#include "gdbtk-cmds.h"
/* This contains the previous values of the registers, since the last call to
! gdb_changed_register_list.
+ It is an array of (NUM_REGS+NUM_PSEUDO_REGS)*MAX_REGISTER_RAW_SIZE bytes. */
+
static char *old_regs = NULL;
static int get_pc_register (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
*************** register_changed_p (int regnum, void *ar
*** 355,367 ****
if (read_relative_register_raw_bytes (regnum, raw_buffer))
return;
! if (memcmp (&old_regs[REGISTER_BYTE (regnum)], raw_buffer,
REGISTER_RAW_SIZE (regnum)) == 0)
return;
/* Found a changed register. Save new value and return its number. */
! memcpy (&old_regs[REGISTER_BYTE (regnum)], raw_buffer,
REGISTER_RAW_SIZE (regnum));
Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj (regnum));
--- 357,369 ----
if (read_relative_register_raw_bytes (regnum, raw_buffer))
return;
! if (memcmp (&old_regs[regnum * MAX_REGISTER_RAW_SIZE], raw_buffer,
REGISTER_RAW_SIZE (regnum)) == 0)
return;
/* Found a changed register. Save new value and return its number. */
! memcpy (&old_regs[regnum * MAX_REGISTER_RAW_SIZE], raw_buffer,
REGISTER_RAW_SIZE (regnum));
Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj (regnum));
*************** register_changed_p (int regnum, void *ar
*** 370,380 ****
static void
setup_architecture_data ()
{
- /* don't trust REGISTER_BYTES to be zero. */
if (old_regs != NULL)
xfree (old_regs);
! old_regs = xmalloc (REGISTER_BYTES + 1);
! memset (old_regs, 0, REGISTER_BYTES + 1);
}
--- 372,381 ----
static void
setup_architecture_data ()
{
if (old_regs != NULL)
xfree (old_regs);
! old_regs = xmalloc ((NUM_REGS + NUM_PSEUDO_REGS) * MAX_REGISTER_RAW_SIZE + 1);
! memset (old_regs, 0, sizeof (old_regs));
}
reply other threads:[~2002-03-01 19:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=Pine.GSO.4.33.0203011100370.15276-100000@makita.cygnus.com \
--to=keiths@redhat.com \
--cc=insight@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).