merge in latest Linton version
authorDonn Seeley <donn@ucbvax.Berkeley.EDU>
Tue, 12 Jan 1988 16:36:48 +0000 (08:36 -0800)
committerDonn Seeley <donn@ucbvax.Berkeley.EDU>
Tue, 12 Jan 1988 16:36:48 +0000 (08:36 -0800)
SCCS-vsn: old/dbx/coredump.c 5.3
SCCS-vsn: old/dbx/defs.h 5.2
SCCS-vsn: old/dbx/eval.c 5.5
SCCS-vsn: old/dbx/events.c 5.3
SCCS-vsn: old/dbx/fortran.c 5.4

usr/src/old/dbx/coredump.c
usr/src/old/dbx/defs.h
usr/src/old/dbx/eval.c
usr/src/old/dbx/events.c
usr/src/old/dbx/fortran.c

index 750eb79..48d0e04 100644 (file)
@@ -5,10 +5,10 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)coredump.c 5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)coredump.c 5.3 (Berkeley) %G%";
 #endif not lint
 
 #endif not lint
 
-static char rcsid[] = "$Header: coredump.c,v 1.5 84/12/26 10:38:56 linton Exp $";
+static char rcsid[] = "$Header: coredump.c,v 1.4 87/04/15 03:25:22 donn Exp $";
 
 /*
  * Deal with the core dump anachronism.
 
 /*
  * Deal with the core dump anachronism.
@@ -56,8 +56,11 @@ public coredump_getkerinfo ()
     if (s == nil) {
        panic("can't find 'masterpaddr'");
     }
     if (s == nil) {
        panic("can't find 'masterpaddr'");
     }
-    fseek(corefile,
-       datamap.seekaddr + physaddr(s->symvalue.offset) - datamap.begin, 0);
+    fseek(
+       corefile,
+       datamap.seekaddr + s->symvalue.offset&0x7fffffff - datamap.begin,
+       0
+    );
     get(corefile, masterpcbb);
     masterpcbb = (masterpcbb&PG_PFNUM)*NBPG;
     getpcb();
     get(corefile, masterpcbb);
     masterpcbb = (masterpcbb&PG_PFNUM)*NBPG;
     getpcb();
@@ -93,8 +96,18 @@ short *signo;
     } else {
        up = &(ustruct.u);
        fread(up, ctob(UPAGES), 1, corefile);
     } else {
        up = &(ustruct.u);
        fread(up, ctob(UPAGES), 1, corefile);
-       savreg = (Word *) &(ustruct.dummy[ctob(UPAGES)]);
-       *mask = savreg[PS];
+#      if vax || tahoe
+           savreg = (Word *) &(ustruct.dummy[ctob(UPAGES)]);
+#      else ifdef mc68000
+           savreg = (Word *) (
+               &ustruct.dummy[ctob(UPAGES) - 10] - (NREG * sizeof(Word))
+           );
+#      endif
+#       ifdef IRIS
+           *mask = savreg[RPS];
+#       else
+           *mask = savreg[PS];
+#       endif
        copyregs(savreg, reg);
        *signo = up->u_arg[0];
        datamap.seekaddr = ctob(UPAGES);
        copyregs(savreg, reg);
        *signo = up->u_arg[0];
        datamap.seekaddr = ctob(UPAGES);
@@ -103,13 +116,14 @@ short *signo;
        stkmap.seekaddr = datamap.seekaddr + ctob(up->u_dsize);
        switch (hdr.a_magic) {
            case OMAGIC:
        stkmap.seekaddr = datamap.seekaddr + ctob(up->u_dsize);
        switch (hdr.a_magic) {
            case OMAGIC:
-               datamap.begin = 0;
-               datamap.end = ctob(up->u_tsize) + ctob(up->u_dsize);
+               datamap.begin = CODESTART;
+               datamap.end = CODESTART + ctob(up->u_tsize) + ctob(up->u_dsize);
                break;
 
            case NMAGIC:
            case ZMAGIC:
                break;
 
            case NMAGIC:
            case ZMAGIC:
-               datamap.begin = (Address) ptob(btop(ctob(up->u_tsize) - 1) + 1);
+               datamap.begin = (Address)
+                   ptob(btop(ctob(up->u_tsize) - 1) + 1) + CODESTART;
                datamap.end = datamap.begin + ctob(up->u_dsize);
                break;
 
                datamap.end = datamap.begin + ctob(up->u_dsize);
                break;
 
@@ -145,7 +159,7 @@ int nbytes;
     if (hdr.a_magic == OMAGIC or vaddrs) {
        coredump_readdata(buff, addr, nbytes);
     } else {
     if (hdr.a_magic == OMAGIC or vaddrs) {
        coredump_readdata(buff, addr, nbytes);
     } else {
-       fseek(objfile, N_TXTOFF(hdr) + addr, 0);
+       fseek(objfile, N_TXTOFF(hdr) + addr - CODESTART, 0);
        fread(buff, nbytes, sizeof(Byte), objfile);
     }
 }
        fread(buff, nbytes, sizeof(Byte), objfile);
     }
 }
index 8801c48..45c93be 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)defs.h      5.1 (Berkeley) %G%
+ *     @(#)defs.h      5.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 
 #include <stdio.h>
 
 
 #include <stdio.h>
 
+#ifdef sgi
+#   define double long float
+#   define atof _latof
+#   define IRIS
+#   define mc68000
+#endif
+
 #define new(type)           ((type) malloc(sizeof(struct type)))
 #define newarr(type, n)     ((type *) malloc((unsigned) (n) * sizeof(type)))
 #define dispose(ptr)        { free((char *) ptr); ptr = 0; }
 #define new(type)           ((type) malloc(sizeof(struct type)))
 #define newarr(type, n)     ((type *) malloc((unsigned) (n) * sizeof(type)))
 #define dispose(ptr)        { free((char *) ptr); ptr = 0; }
index 6583c36..1e8ec6f 100644 (file)
@@ -5,10 +5,10 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)eval.c     5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)eval.c     5.5 (Berkeley) %G%";
 #endif not lint
 
 #endif not lint
 
-static char rcsid[] = "$Header: eval.c,v 1.5 84/12/26 10:39:08 linton Exp $";
+static char rcsid[] = "$Header: eval.c,v 1.2 87/03/25 19:48:33 donn Exp $";
 
 /*
  * Tree evaluation.
 
 /*
  * Tree evaluation.
@@ -208,15 +208,8 @@ register Node p;
            rpush(addr, len);
            break;
 
            rpush(addr, len);
            break;
 
-       /*
-        * Move the stack pointer so that the top of the stack has
-        * something corresponding to the size of the current node type.
-        * If this new type is bigger than the subtree (len > 0),
-        * then the stack is padded with nulls.  If it's smaller,
-        * the stack is just dropped by the appropriate amount.
-        */
        case O_TYPERENAME:
        case O_TYPERENAME:
-           typerename(size(p->value.arg[0]->nodetype), size(p->nodetype));
+           loophole(size(p->value.arg[0]->nodetype), size(p->nodetype));
            break;
 
        case O_COMMA:
            break;
 
        case O_COMMA:
@@ -797,13 +790,15 @@ Symbol t;
 public Boolean cond(p)
 Node p;
 {
 public Boolean cond(p)
 Node p;
 {
-    register Boolean b;
+    Boolean b;
+    int i;
 
     if (p == nil) {
        b = true;
     } else {
        eval(p);
 
     if (p == nil) {
        b = true;
     } else {
        eval(p);
-       b = (Boolean) pop(Boolrep);
+       i = pop(Boolrep);
+       b = (Boolean) i;
     }
     return b;
 }
     }
     return b;
 }
@@ -1008,6 +1003,9 @@ Node cond;
     Node event;
     Command action;
 
     Node event;
     Command action;
 
+    if (size(exp->nodetype) > MAXTRSIZE) {
+       error("expression too large to trace (limit is %d bytes)", MAXTRSIZE);
+    }
     p = (place == nil) ? tcontainer(exp) : place->value.sym;
     if (p == nil) {
        p = program;
     p = (place == nil) ? tcontainer(exp) : place->value.sym;
     if (p == nil) {
        p = program;
@@ -1105,6 +1103,9 @@ Node cond;
     Node event;
     Command action;
 
     Node event;
     Command action;
 
+    if (size(exp->nodetype) > MAXTRSIZE) {
+       error("expression too large to trace (limit is %d bytes)", MAXTRSIZE);
+    }
     if (place == nil) {
        if (exp->op == O_LCON) {
            p = program;
     if (place == nil) {
        if (exp->op == O_LCON) {
            p = program;
@@ -1271,12 +1272,6 @@ Node p;
  * Send a message to the current support person.
  */
 
  * Send a message to the current support person.
  */
 
-#ifdef MAINTAINER
-static char maintainer[] = MAINTAINER;
-#else
-static char maintainer[] = "";
-#endif
-
 public gripe()
 {
     typedef Operation();
 public gripe()
 {
     typedef Operation();
@@ -1285,24 +1280,25 @@ public gripe()
     extern int versionNumber;
     char subject[100];
 
     extern int versionNumber;
     char subject[100];
 
-    if (maintainer[0] == '\0') {
-       puts("Gripes not supported at this site.  Sorry.");
-       return;
-    }
-    puts("Type control-D to end your message.  Be sure to include");
-    puts("your name and the name of the file you are debugging.");
-    putchar('\n');
-    old = signal(SIGINT, SIG_DFL);
-    sprintf(subject, "dbx (version 3.%d) gripe", versionNumber);
-    pid = back("Mail", stdin, stdout, "-s", subject, maintainer, nil);
-    signal(SIGINT, SIG_IGN);
-    pwait(pid, &status);
-    signal(SIGINT, old);
-    if (status == 0) {
-       puts("Thank you.");
-    } else {
-       puts("\nMail not sent.");
-    }
+#   ifdef MAINTAINER
+       puts("Type control-D to end your message.  Be sure to include");
+       puts("your name and the name of the file you are debugging.");
+       putchar('\n');
+       old = signal(SIGINT, SIG_DFL);
+       sprintf(subject, "dbx (version 3.%d) gripe", versionNumber);
+       pid = back("Mail", stdin, stdout, "-s", subject, MAINTAINER, nil);
+       signal(SIGINT, SIG_IGN);
+       pwait(pid, &status);
+       signal(SIGINT, old);
+       if (status == 0) {
+           puts("Thank you.");
+       } else {
+           puts("\nMail not sent.");
+       }
+#   else
+       puts("Sorry, no dbx maintainer available to gripe to.");
+       puts("Try contacting your system manager.");
+#   endif
 }
 
 /*
 }
 
 /*
index 3645faa..7a2704e 100644 (file)
@@ -5,10 +5,10 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)events.c   5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)events.c   5.3 (Berkeley) %G%";
 #endif not lint
 
 #endif not lint
 
-static char rcsid[] = "$Header: events.c,v 1.5 84/12/26 10:39:26 linton Exp $";
+static char rcsid[] = "$Header: events.c,v 1.3 87/07/08 18:46:02 donn Exp $";
 
 /*
  * Event/breakpoint managment.
 
 /*
  * Event/breakpoint managment.
@@ -28,25 +28,34 @@ static char rcsid[] = "$Header: events.c,v 1.5 84/12/26 10:39:26 linton Exp $";
 #include "lists.h"
 
 #ifndef public
 #include "lists.h"
 
 #ifndef public
+
 typedef struct Event *Event;
 typedef struct Breakpoint *Breakpoint;
 
 typedef struct Event *Event;
 typedef struct Breakpoint *Breakpoint;
 
-boolean inst_tracing;
-boolean single_stepping;
-boolean isstopped;
-
 #include "symbols.h"
 
 #include "symbols.h"
 
-Symbol linesym;
-Symbol procsym;
-Symbol pcsym;
-Symbol retaddrsym;
-
 #define addevent(cond, cmdlist) event_alloc(false, cond, cmdlist)
 #define event_once(cond, cmdlist) event_alloc(true, cond, cmdlist)
 
 #define addevent(cond, cmdlist) event_alloc(false, cond, cmdlist)
 #define event_once(cond, cmdlist) event_alloc(true, cond, cmdlist)
 
+/*
+ * When tracing variables we keep a copy of their most recent value
+ * and compare it to the current one each time a breakpoint occurs.
+ * MAXTRSIZE is the maximum size variable we allow.
+ */
+
+#define MAXTRSIZE 512
+
 #endif
 
 #endif
 
+public boolean inst_tracing;
+public boolean single_stepping;
+public boolean isstopped;
+
+public Symbol linesym;
+public Symbol procsym;
+public Symbol pcsym;
+public Symbol retaddrsym;
+
 struct Event {
     unsigned int id;
     boolean temporary;
 struct Event {
     unsigned int id;
     boolean temporary;
@@ -689,14 +698,6 @@ boolean iscall;
     return false;
 }
 
     return false;
 }
 
-/*
- * When tracing variables we keep a copy of their most recent value
- * and compare it to the current one each time a breakpoint occurs.
- * MAXTRSIZE is the maximum size variable we allow.
- */
-
-#define MAXTRSIZE 512
-
 /*
  * List of variables being watched.
  */
 /*
  * List of variables being watched.
  */
index 9ef270b..73fdc81 100644 (file)
@@ -5,10 +5,10 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)fortran.c  5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)fortran.c  5.4 (Berkeley) %G%";
 #endif not lint
 
 #endif not lint
 
-static char rcsid[] = "$Header: fortran.c,v 1.5 84/12/26 10:39:37 linton Exp $";
+static char rcsid[] = "$Header: fortran.c,v 1.3 87/03/25 20:00:03 donn Exp $";
 
 /*
  * FORTRAN dependent symbol routines.
 
 /*
  * FORTRAN dependent symbol routines.
@@ -171,14 +171,10 @@ char  **pbuf;
 public fortran_printdecl(s)
 Symbol s;
 {
 public fortran_printdecl(s)
 Symbol s;
 {
-
-
-Symbol eltype;
+    Symbol eltype;
 
     switch (s->class) {
 
     switch (s->class) {
-
        case CONST:
        case CONST:
-           
            printf("parameter %s = ", symname(s));
            eval(s->symvalue.constval);
             printval(s);
            printf("parameter %s = ", symname(s));
            eval(s->symvalue.constval);
             printval(s);
@@ -291,7 +287,7 @@ Symbol s;
            break;
 
        case RANGE:
            break;
 
        case RANGE:
-           if (isspecial(s)) {
+            if (isspecial(s)) {
                switch (s->symvalue.rangev.lower) {
                    case sizeof(short):
                        if (istypename(s->type, "logical*2")) {
                switch (s->symvalue.rangev.lower) {
                    case sizeof(short):
                        if (istypename(s->type, "logical*2")) {
@@ -308,7 +304,7 @@ Symbol s;
                        break;
 
                    case sizeof(double):
                        break;
 
                    case sizeof(double):
-                       if (istypename(s->type, "complex")) {
+                       if (istypename(s->type,"complex")) {
                            d2 = pop(float);
                            d1 = pop(float);
                            printf("(");
                            d2 = pop(float);
                            d1 = pop(float);
                            printf("(");
@@ -330,7 +326,7 @@ Symbol s;
                        prtreal(d2);
                        printf(")");
                        break;
                        prtreal(d2);
                        printf(")");
                        break;
-               
+
                    default:
                        panic("bad size \"%d\" for special",
                                   s->symvalue.rangev.lower);
                    default:
                        panic("bad size \"%d\" for special",
                                   s->symvalue.rangev.lower);
@@ -354,8 +350,8 @@ Symbol s;
  * Print out a logical
  */
 
  * Print out a logical
  */
 
-private printlogical(i)
-Integer i;
+private printlogical (i)
+integer i;
 {
     if (i == 0) {
        printf(".false.");
 {
     if (i == 0) {
        printf(".false.");
@@ -372,8 +368,9 @@ private printint(i, t)
 Integer i;
 register Symbol t;
 {
 Integer i;
 register Symbol t;
 {
-    if ( (t->type == t_int) or istypename(t->type, "integer") or
-                  istypename(t->type,"integer*2") ) {
+    if (t->type == t_int or istypename(t->type, "integer") or
+       istypename(t->type,"integer*2")
+    ) {
        printf("%ld", i);
     } else if (istypename(t->type, "addr")) {
        printf("0x%lx", i);
        printf("%ld", i);
     } else if (istypename(t->type, "addr")) {
        printf("0x%lx", i);