[7360] in Athena Bugs
adb
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Mon Mar 25 15:14:44 1991
To: bugs@ATHENA.MIT.EDU
Date: Mon, 25 Mar 91 15:14:32 EST
From: John Carr <jfc@ATHENA.MIT.EDU>
This is a change to VAX adb which makes it print the saved registers in each
stack frame when the 'C' option is used. This is what the RT adb does; I
find it a very useful feature.
I decided to write my addition in C instead of the strange language the rest
of adb is written in, so it doesn't look much like the surrounding code.
*** /source/bsd-4.3/vax/bin/adb/print.c Thu May 2 18:39:49 1985
--- print.c Mon Mar 25 15:11:32 1991
***************
*** 121,127 ****
CHAR hi, lo;
ADDR word;
STRING comptr;
! ADDR argp, frame, link;
register struct nlist *sp;
INT stack;
INT ntramp;
--- 121,127 ----
CHAR hi, lo;
ADDR word;
STRING comptr;
! register ADDR argp, frame, link;
register struct nlist *sp;
INT stack;
INT ntramp;
***************
*** 326,331 ****
--- 326,352 ----
FI
OD
FI
+ if (modif == 'C') {
+ printf("Frame:%16tzero%16tsave mask%16tap%16tfp\n");
+ printf("%16t%X%16t%X%16t%X%16t%X\n",
+ get(frame, DSP), get(frame+4, DSP),
+ get(frame+8,DSP), get(frame+12,DSP));
+ word = get(frame+6,DSP) & 0xfff;
+ if (word) {
+ int i = -1, np = 0;
+ register u_int tmpf = frame+20;
+ do {
+ i++;
+ if (!(word & 1))
+ continue;
+ printf("%16tr%D=%X", i, get(tmpf,DSP));
+ tmpf += 4;
+ if (np++ == 3)
+ printf("\n"), np = 0;
+ } while (word >>= 1);
+ printf ("\n");
+ }
+ }
argp=get(frame+8, DSP);
lastframe=frame;