From: Andrew Cagney <cagney@gnu.org>
To: gdb-patches@sources.redhat.com
Subject: [commit] oops, re-instate cris_register_size
Date: Tue, 03 Aug 2004 04:00:00 -0000 [thread overview]
Message-ID: <410F0DC0.1040902@gnu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 81 bytes --]
I didn't notice a local call, picked up when doing re-builds.
committed,
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1806 bytes --]
2004-08-02 Andrew Cagney <cagney@gnu.org>
* cris-tdep.c (cris_register_size): Restore function, still used
locally.
Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.115
diff -p -u -r1.115 cris-tdep.c
--- cris-tdep.c 3 Aug 2004 03:09:32 -0000 1.115
+++ cris-tdep.c 3 Aug 2004 03:57:01 -0000
@@ -1096,6 +1096,45 @@ cris_spec_reg_applicable (struct cris_sp
}
}
+/* Returns the register size in unit byte. Returns 0 for an unimplemented
+ register, -1 for an invalid register. */
+
+static int
+cris_register_size (int regno)
+{
+ int i;
+ int spec_regno;
+
+ if (regno >= 0 && regno < NUM_GENREGS)
+ {
+ /* General registers (R0 - R15) are 32 bits. */
+ return 4;
+ }
+ else if (regno >= NUM_GENREGS && regno < NUM_REGS)
+ {
+ /* Special register (R16 - R31). cris_spec_regs is zero-based.
+ Adjust regno accordingly. */
+ spec_regno = regno - NUM_GENREGS;
+
+ /* The entries in cris_spec_regs are stored in register number order,
+ which means we can shortcut into the array when searching it. */
+ for (i = spec_regno; cris_spec_regs[i].name != NULL; i++)
+ {
+ if (cris_spec_regs[i].number == spec_regno
+ && cris_spec_reg_applicable (cris_spec_regs[i]))
+ /* Go with the first applicable register. */
+ return cris_spec_regs[i].reg_size;
+ }
+ /* Special register not applicable to this CRIS version. */
+ return 0;
+ }
+ else
+ {
+ /* Invalid register. */
+ return -1;
+ }
+}
+
/* Nonzero if regno should not be fetched from the target. This is the case
for unimplemented (size 0) and non-existant registers. */
reply other threads:[~2004-08-03 4:00 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=410F0DC0.1040902@gnu.org \
--to=cagney@gnu.org \
--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