* [commit] FRV register related updates
@ 2007-04-09 22:40 Kevin Buettner
0 siblings, 0 replies; only message in thread
From: Kevin Buettner @ 2007-04-09 22:40 UTC (permalink / raw)
To: rda
I've comitted the patch below. It updates NUM_REGS (which should've
been done quite a while back) and prevents an error when attempting to
read PSR on FRV.
unix/ChangeLog:
* linux-target.c (NUM_REGS)[FRV_LINUX_TARGET]: Update.
(frv_read_only_register): New function.
(reginfo)[FRV_LINUX_TARGET]: Mark as read-only.
Index: unix/linux-target.c
===================================================================
RCS file: /cvs/src/src/rda/unix/linux-target.c,v
retrieving revision 1.23
diff -u -p -r1.23 linux-target.c
--- unix/linux-target.c 3 Oct 2006 22:49:05 -0000 1.23
+++ unix/linux-target.c 9 Apr 2007 22:33:39 -0000
@@ -1252,7 +1252,7 @@ is_extended_reg (int regnum)
enum
{
- NUM_REGS = 149,
+ NUM_REGS = 166,
PC_REGNUM = 128,
sign_extend = 0
};
@@ -1263,6 +1263,8 @@ enum
static int frv_fdpic_loadmap_addresses (struct gdbserv *, int, int, void *,
const void *);
+static int frv_read_only_register (struct gdbserv *, int, int, void *,
+ const void *);
static struct peekuser_pokeuser_reginfo reginfo[] =
{
@@ -1398,7 +1400,8 @@ static struct peekuser_pokeuser_reginfo
{ PT_FR(63) * 4, 4, fpreg_offset_and_size (fr[63]), 4, 0 },
{ PT_PC * 4, 4, greg_offset_and_size (pc), 4, 0 },
- { PT_PSR * 4, 4, greg_offset_and_size (psr), 4, 0 },
+ /* The PSR is read-only. */
+ { PT_PSR * 4, 4, greg_offset_and_size (psr), 4, frv_read_only_register },
{ PT_CCR * 4, 4, greg_offset_and_size (ccr), 4, 0 },
{ PT_CCCR * 4, 4, greg_offset_and_size (cccr), 4, 0 },
@@ -1493,6 +1496,19 @@ frv_fdpic_loadmap_addresses (struct gdbs
return 0;
}
+int
+frv_read_only_register (struct gdbserv *serv, int pid, int regno,
+ void *read_buf, const void *write_buf)
+{
+ if (read_buf != NULL)
+ {
+ return ptrace_read_user (serv, pid, reginfo[regno].ptrace_offset,
+ reginfo[regno].ptrace_size, read_buf);
+ }
+ return 0;
+}
+
+
/* Breakpoint methods for the frv. These use the stock breakpoint
code.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-04-09 22:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-09 22:40 [commit] FRV register related updates Kevin Buettner
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).