[4667] in Athena Bugs

home help back first fref pref prev next nref lref last post

RT dbx brain damage

daemon@ATHENA.MIT.EDU (John Carr)
Mon Apr 2 06:14:59 1990

To: bugs@ATHENA.MIT.EDU
Cc: probe@ATHENA.MIT.EDU
Date: Mon, 02 Apr 90 06:14:44 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>

dbx on the RT will fail ("<core file> does not match <executable file>") if
(1) the executable file name given as argument to dbx is not the same as the
name typed to the shell to run the program which generated the core file OR
(2) the file names match but are longer than 16 characters.

Here is a patch to fix this (and add better error reporting for other
failures).  Normally I would say "#if 0" to comment out a block of code, but
the program that generates .h files with function declarations from .c files
doesn't allow "#if".

*** /source/bsd-4.3/rt/ucb/dbx/coredump.c	Mon Nov 20 14:40:43 1989
--- coredump.c	Mon Apr  2 06:00:09 1990
***************
*** 131,136 ****
--- 131,137 ----
  	stat(objname,&o_stat);
  	stat(corefile,&c_stat);
  	if ( o_stat.st_mtime > c_stat.st_mtime ){
+ 		fprintf(stderr, "core older than executable\n");
  		badcore = true;
  		coredump_close();
  		return;
***************
*** 143,148 ****
--- 144,150 ----
      }
  
      if ( !get(objfile, hdr) ){
+ 	fprintf(stderr, "exec header read failed\n");
  	badcore = true;
  	coredump_close();
  	return;
***************
*** 156,167 ****
      } else {
  	fread(uarea, ctob(UPAGES), 1, corefile);
  	up = (struct user *) (&uarea[(int)uoffset]);
  	if(strncmp(up->u_comm,objname,strlen(objname))){
  		badcore = true;
  		coredump_close();
  		return;
  	}
! 
  /* u_exdata is not part of 4.3 uarea
  	if (up->u_exdata.ux_tsize != hdr.a_text ||
  	    up->u_exdata.ux_dsize != hdr.a_data ||
--- 158,171 ----
      } else {
  	fread(uarea, ctob(UPAGES), 1, corefile);
  	up = (struct user *) (&uarea[(int)uoffset]);
+ #ifdef ZERO_0
  	if(strncmp(up->u_comm,objname,strlen(objname))){
+ 		fprintf(stderr, "names don't match\n");
  		badcore = true;
  		coredump_close();
  		return;
  	}
! #endif
  /* u_exdata is not part of 4.3 uarea
  	if (up->u_exdata.ux_tsize != hdr.a_text ||
  	    up->u_exdata.ux_dsize != hdr.a_data ||


home help back first fref pref prev next nref lref last post