aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/db/regs.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-19 19:30:50 +0000
committerrsc <devnull@localhost>2004-04-19 19:30:50 +0000
commit84114f06650ba3db950532b1d0cd1d7e18b4b6be (patch)
tree4a5aa4819d01f1798bf86c3420db542c74092a6f /src/cmd/db/regs.c
parenta84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46 (diff)
downloadplan9port-84114f06650ba3db950532b1d0cd1d7e18b4b6be.tar.gz
plan9port-84114f06650ba3db950532b1d0cd1d7e18b4b6be.tar.bz2
plan9port-84114f06650ba3db950532b1d0cd1d7e18b4b6be.zip
debugger
Diffstat (limited to 'src/cmd/db/regs.c')
-rw-r--r--src/cmd/db/regs.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/cmd/db/regs.c b/src/cmd/db/regs.c
new file mode 100644
index 00000000..4a9a4426
--- /dev/null
+++ b/src/cmd/db/regs.c
@@ -0,0 +1,44 @@
+/*
+ * code to keep track of registers
+ */
+
+#include "defs.h"
+#include "fns.h"
+
+/*
+ * print the registers
+ */
+void
+printregs(int c)
+{
+ Regdesc *rp;
+ int i;
+ ulong u;
+
+ if(correg == nil){
+ dprint("registers not mapped\n");
+ return;
+ }
+
+ for (i = 1, rp = mach->reglist; rp->name; rp++, i++) {
+ if ((rp->flags & RFLT)) {
+ if (c != 'R')
+ continue;
+ if (rp->format == '8' || rp->format == '3')
+ continue;
+ }
+ rget(correg, rp->name, &u);
+ if(rp->format == 'Y')
+ dprint("%-8s %-20#llux", rp->name, (uvlong)u);
+ else
+ dprint("%-8s %-12#lux", rp->name, (ulong)u);
+ if ((i % 3) == 0) {
+ dprint("\n");
+ i = 0;
+ }
+ }
+ if (i != 1)
+ dprint("\n");
+ dprint ("%s\n", mach->exc(cormap, correg));
+ printpc();
+}