From: hyc@hanauma.jpl.nasa.gov (Howard Chu)
Newsgroups: fj.mail-lists.x-window
Subject: Xdbx for Alliant
Date: 9 Apr 92 13:40:17 GMT
Distribution: fj
Organization: SAR Systems Development & Processing, JPL

Date: Thu, 9 Apr 1992 09:33:43 GMT
Message-Id: <1992Apr9.093343.16599@elroy.jpl.nasa.gov>
Newsgroups: comp.sys.alliant,comp.windows.x

I tried to send this to Po Cheung, the author of Xdbx, but neither of the
two email addresses given in the README file works. The daemon at sw.mcc.com
says he's moved on to IBM but doesn't give a forwarding address. Oh well.
At any rate, the following patches are for Xdbx 2.1, patchlevel 2, and make
it usable with Alliant's dbx on both FX/8 and FX/2800. Note that you must
have X11R4 to use this. Our FX/800 seems to have come equipped with R3
libraries, which will make the output intolerable because the Athena Widget
code there is slightly broken. I imagine that it will still work with R5, but
we haven't upgraded yet so I don't know...

cd to your xdbx source directory, then feed this message to the patch
program. You will probably also need to tweak the Makefile; I didn't
bother fixing the Imakefile since I don't use them. My RCS changelogs
are included ahead of the actual diffs. Please send comments or bug reports
to me...

RCS file: RCS/calldbx.c,v
----------------------------
revision 1.2	locked by: hyc;
date: 1992/04/09 07:25:24;  author: hyc;  state: Exp;  lines: +15 -0
Make termio optional, use sgttyb in default case.
----------------------------
revision 1.1
date: 1992/03/04 00:12:50;  author: hyc;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/command.c,v
----------------------------
revision 1.2	locked by: hyc;
date: 1992/04/09 09:18:53;  author: hyc;  state: Exp;  lines: +6 -4
Fix up Alliant/BSD/Sun dependencies, eliminate unused code.
----------------------------
revision 1.1
date: 1992/04/09 08:00:16;  author: hyc;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/dbx.c,v
----------------------------
revision 1.2	locked by: hyc;
date: 1992/04/09 09:19:29;  author: hyc;  state: Exp;  lines: +3 -1
Change logic to allow *_handlers to generate output before xdbx prompt
gets displayed.
----------------------------
revision 1.1
date: 1992/04/09 09:05:23;  author: hyc;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/dialog.c,v
----------------------------
revision 1.2	locked by: hyc;
date: 1992/04/09 07:25:56;  author: hyc;  state: Exp;  lines: +2 -2
Eliminate floating point arithmetic; the roundoff was screwing things
up on Alliant FX/2800.
----------------------------
revision 1.1
date: 1992/04/08 21:12:18;  author: hyc;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/filemenu.c,v
----------------------------
revision 1.2	locked by: hyc;
date: 1992/04/09 09:20:24;  author: hyc;  state: Exp;  lines: +2 -2
More BSD/Alliant/Sun juggling
----------------------------
revision 1.1
date: 1992/04/09 08:00:16;  author: hyc;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/handler.c,v
----------------------------
revision 1.3	locked by: hyc;
date: 1992/04/09 09:20:44;  author: hyc;  state: Exp;  lines: +7 -3
More BSD/Alliant/Sun juggling, make updown_handler output message
text on Alliant to show current stack position.
----------------------------
revision 1.2
date: 1992/04/09 07:26:56;  author: hyc;  state: Exp;  lines: +15 -5
Add code to obtain filename from Alliant dbx, since it doesn't start up
knowing things...
----------------------------
revision 1.1
date: 1992/04/08 23:52:01;  author: hyc;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/parser.c,v
----------------------------
revision 1.3	locked by: hyc;
date: 1992/04/09 09:21:42;  author: hyc;  state: Exp;  lines: +7 -4
More BSD/Alliant/Sun juggling. Avoid a bus error in updown
handling when Alliant regex returns null mesg text.
----------------------------
revision 1.2
date: 1992/04/09 07:28:09;  author: hyc;  state: Exp;  lines: +60 -28
Add Alliant-specific where and func handling.
Add len argument to match, so calling routine can determine how much of
the given string was matched. Make debug handler call parser repeatedly
in case the startup output isn't fully matched. This handles the case
of debugging on Alliant when a core file exists, positioning the source
listing at the point of the abort.
----------------------------
revision 1.1
date: 1992/03/04 02:15:09;  author: hyc;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/windows.c,v
----------------------------
revision 1.2	locked by: hyc;
date: 1992/04/09 09:22:33;  author: hyc;  state: Exp;  lines: +1 -1
More BSD/Alliant/Sun juggling
----------------------------
revision 1.1
date: 1992/04/09 08:00:16;  author: hyc;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/xdbx.c,v
----------------------------
revision 1.2	locked by: hyc;
date: 1992/04/09 07:30:36;  author: hyc;  state: Exp;  lines: +7 -5
Handle Alliant-specific dbx option processing.
----------------------------
revision 1.1
date: 1992/04/08 23:40:44;  author: hyc;  state: Exp;
Initial revision
=============================================================================
*** 1.1	1992/03/04 00:12:50
--- calldbx.c	1992/04/09 09:23:07
***************
*** 41,45 ****
--- 41,49 ----
   */
  
+ #ifdef	HAVE_TERMIO
  #include	<termio.h>
+ #else
+ #include	<sgtty.h>
+ #endif
  #include	"global.h"
  
***************
*** 91,95 ****
--- 95,103 ----
  char *argv[];
  {
+ #ifdef HAVE_TERMIO
      struct termio Termio;
+ #else
+     struct sgttyb Sgttyb;
+ #endif
      int  	  master;		/* file descriptor of master pty */
      int  	  slave; 		/* file descriptor of slave pty */
***************
*** 158,161 ****
--- 166,170 ----
  	 * Modify local and output mode of slave pty
  	 */
+ #ifdef HAVE_TERMIO
  	ioctl(slave, TCGETA, &Termio);
  	Termio.c_lflag &= ~ECHO;	/* No echo */
***************
*** 162,165 ****
--- 171,180 ----
  	Termio.c_oflag &= ~ONLCR;	/* Do not map NL to CR-NL on output */
  	ioctl(slave, TCSETA, &Termio);
+ #else
+ 	ioctl(slave, TIOCGETP, &Sgttyb);
+ 	Sgttyb.sg_flags &= ~ECHO;
+ 	Sgttyb.sg_flags &= ~CRMOD;
+ 	ioctl(slave, TIOCSETP, &Sgttyb);
+ #endif
  
  	dup2(slave, 0);
*** 1.1	1992/04/09 08:00:16
--- command.c	1992/04/09 08:22:40
***************
*** 100,103 ****
--- 100,104 ----
  }
  
+ #if defined(BSD) && !defined(alliant)
  /* ARGSUSED */
  static void Return (w, client_data, call_data)
***************
*** 117,120 ****
--- 118,122 ----
      AppendDialogText(command);
  }
+ #endif
  
  /* ARGSUSED */
***************
*** 253,257 ****
  }
  
! 
  /* ARGSUSED */
  static void Display_(w, client_data, call_data)
--- 255,259 ----
  }
  
! #if !defined(BSD) || defined(alliant)
  /* ARGSUSED */
  static void Display_(w, client_data, call_data)
***************
*** 292,296 ****
      AppendDialogText(command);
  }
! 
  
  /* ARGSUSED */
--- 294,298 ----
      AppendDialogText(command);
  }
! #endif
  
  /* ARGSUSED */
***************
*** 583,587 ****
      button[i++] = AddButton (parent, "next", DoIt, "next\n");
      button[i++] = AddButton (parent, "step", DoIt, "step\n");
! #ifdef BSD
      button[i++] = AddButton (parent, "return", Return, "return\n");
  #endif
--- 585,589 ----
      button[i++] = AddButton (parent, "next", DoIt, "next\n");
      button[i++] = AddButton (parent, "step", DoIt, "step\n");
! #if defined(BSD) && !defined(alliant)
      button[i++] = AddButton (parent, "return", Return, "return\n");
  #endif
***************
*** 597,601 ****
      button[i++] = AddButton (parent, "file", File, NULL);
      button[i++] = AddButton (parent, "status", DoIt, "status\n");
! #ifndef BSD
      button[i++] = AddButton (parent, "display", Display_, NULL);
      button[i++] = AddButton (parent, "undisplay", Undisplay, NULL);
--- 599,603 ----
      button[i++] = AddButton (parent, "file", File, NULL);
      button[i++] = AddButton (parent, "status", DoIt, "status\n");
! #if !defined(BSD) || defined(alliant)
      button[i++] = AddButton (parent, "display", Display_, NULL);
      button[i++] = AddButton (parent, "undisplay", Undisplay, NULL);
*** 1.1	1992/04/09 09:05:23
--- dbx.c	1992/04/09 09:15:17
***************
*** 121,124 ****
--- 121,125 ----
      char 	s[LINESIZ];
      Boolean 	more;
+     Boolean	myEcho=False;
  
      more = True;
***************
*** 146,150 ****
  	if (Echo) {
  	    filter(string, output, command);
! 	    if (Prompt) AppendDialogText(xdbxprompt);
  	}
  	if (string) {
--- 147,151 ----
  	if (Echo) {
  	    filter(string, output, command);
! 	    myEcho = True;
  	}
  	if (string) {
***************
*** 162,165 ****
--- 163,167 ----
  	    XtFree(output);
  	    output = NULL;
+ 	    if (myEcho) AppendDialogText(xdbxprompt);
  	}
      }
*** 1.1	1992/04/08 21:12:18
--- dialog.c	1992/04/08 21:14:12
***************
*** 295,300 ****
  
  	i = textblock.length - (DIALOGSIZE - lastPos);
! 	if (i < 0.9*DIALOGSIZE)
! 	    i += 0.1*DIALOGSIZE;
          while (DialogText[i] != '\n') i++;
          XawTextReplace(dialogWindow, 0, i+1, &nullblock);
--- 295,300 ----
  
  	i = textblock.length - (DIALOGSIZE - lastPos);
! 	if (i < (9*DIALOGSIZE)/10)
! 	    i += DIALOGSIZE/10;
          while (DialogText[i] != '\n') i++;
          XawTextReplace(dialogWindow, 0, i+1, &nullblock);
*** 1.1	1992/04/09 08:00:16
--- filemenu.c	1992/04/09 08:02:23
***************
*** 84,88 ****
      char command[LINESIZ];
  
! #ifdef BSD
      int i;
  
--- 84,88 ----
      char command[LINESIZ];
  
! #if defined(BSD) && !defined(alliant)
      int i;
  
***************
*** 207,211 ****
      else if (LASTCH(filename) == '*') {
      	UpdateMessageWindow("");
! #ifndef BSD
  	strcpy(string, filename);
  	LASTCH(string) = '\0';
--- 207,211 ----
      else if (LASTCH(filename) == '*') {
      	UpdateMessageWindow("");
! #if !defined(BSD) || defined(alliant)
  	strcpy(string, filename);
  	LASTCH(string) = '\0';
*** 1.1	1992/04/08 23:52:01
--- handler.c	1992/04/09 09:06:19
***************
*** 55,59 ****
  #include <ctype.h>
  #include "global.h"
! #ifdef BSD
  #define	BRACKET	"[%d]"
  #else
--- 55,59 ----
  #include <ctype.h>
  #include "global.h"
! #if defined(BSD) && !defined(alliant)
  #define	BRACKET	"[%d]"
  #else
***************
*** 140,144 ****
      if (Token.func == NULL || Token.line == 0) 
  	return; 
!     UpdateMessageWindow(Token.mesg);
      line = Token.line;
      func = XtNewString(Token.func);
--- 140,144 ----
      if (Token.func == NULL || Token.line == 0) 
  	return; 
!     UpdateMessageWindow("%s",Token.mesg);
      line = Token.line;
      func = XtNewString(Token.func);
***************
*** 168,172 ****
  
      AdjustText(line);
! #ifndef BSD
      display_handler();
  #endif
--- 168,172 ----
  
      AdjustText(line);
! #if !defined(BSD) || defined(alliant)
      display_handler();
  #endif
***************
*** 298,305 ****
  	file = displayedFile->pathname;
  #endif
  
!     if (line <= 0 || func == NULL || file == NULL) 
  	return;
!     if (displayedFile && strcmp(file, displayedFile->pathname)) {
  	LoadFile(file);
  	/* set dbx file variable to file */
--- 298,310 ----
  	file = displayedFile->pathname;
  #endif
+ #ifdef alliant
+     if (Token.mesg)
+ 	AppendDialogText(Token.mesg);
+ #endif
  
!     if (line <= 0)
  	return;
! 
!     if (file && displayedFile && strcmp(file, displayedFile->pathname)) {
  	LoadFile(file);
  	/* set dbx file variable to file */
***************
*** 313,321 ****
      }
      updown.line = line;
!     strcpy(updown.func, func);
      if (displayedFile)
      	strcpy(updown.file, displayedFile->pathname);
      AdjustText(line);
-     XtFree(func);
  }
  
--- 318,328 ----
      }
      updown.line = line;
!     if (func) {
!     	strcpy(updown.func, func);
!     	XtFree(func);
!     }
      if (displayedFile)
      	strcpy(updown.file, displayedFile->pathname);
      AdjustText(line);
  }
  
***************
*** 400,403 ****
--- 407,417 ----
      query_dbx("use\n");
      displayedFile = NULL;		/* force reloading of source file */
+ #ifdef alliant
+     { char command[LINESIZ];		/* Alliant dbx doesn't know its */
+     query_dbx("func\n");		/* source file name at first... */
+     Skip_func_handler = True;
+     sprintf(command,"func %s.main\n", Token.func);
+     query_dbx(command); }
+ #endif
      if (LoadCurrentFile() == 0) {
  	arrow.line = 0;			/* clear arrow sign */
***************
*** 411,415 ****
          UpdateMessageWindow("Ready for execution");
  	query_dbx("func main\n");
! #ifndef BSD
  	query_dbx("display\n");		/* clear display window */
  #endif
--- 425,429 ----
          UpdateMessageWindow("Ready for execution");
  	query_dbx("func main\n");
! #if !defined(BSD) || defined(alliant)
  	query_dbx("display\n");		/* clear display window */
  #endif
*** 1.1	1992/03/04 02:15:09
--- parser.c	1992/04/09 08:43:02
***************
*** 53,58 ****
--- 53,62 ----
  #include	"mips_regex.h"
  #else
+ #ifdef alliant
+ #include	"alliant_regex.h"
+ #else
  #include	"bsd_regex.h"
  #endif
+ #endif
  #else
  #include	"sun_regex.h"
***************
*** 97,104 ****
   *  the function returns an index to the pattern table.
   */
! static int match(patternTable, string, type)
      PatternRec 	*patternTable;
      char 	*string;
      int		type;
  {
      struct re_registers	regs;
--- 101,109 ----
   *  the function returns an index to the pattern table.
   */
! static int match(patternTable, string, type, len)
      PatternRec 	*patternTable;
      char 	*string;
      int		type;
+     int		*len;
  {
      struct re_registers	regs;
***************
*** 141,144 ****
--- 146,150 ----
  	}
      }
+     *len = m;
      return index;
  }
***************
*** 168,171 ****
--- 174,178 ----
      int  command_type;
      char *output_string;
+     int  clen;
  
      if (debug) {
***************
*** 178,184 ****
  
      if (!command) {
! 	if (match(output_pattern, output_string, O_DEBUG) != -1)
  	    debug_handler(); 
  	debug_init();
  	return;
      }
--- 185,195 ----
  
      if (!command) {
! 	if (match(output_pattern, output_string, O_DEBUG, &clen) != -1)
  	    debug_handler(); 
  	debug_init();
+ #ifdef alliant
+ 	if (clen < strlen(output_string))	/* O_EXEC from core file */
+ 	    parse(output_string+clen, "step\n");
+ #endif
  	return;
      }
***************
*** 186,195 ****
  	return;
  
!     command_type = match(command_pattern, command, C_ANY);
      switch (command_type) {
        	case C_EXEC: 
! 	    if (match(output_pattern, output_string, O_EXEC) != -1)
  		exec_handler();
! 	    else if (match(output_pattern, output_string, O_DONE) != -1)
  		done_handler();
  	    else
--- 197,206 ----
  	return;
  
!     command_type = match(command_pattern, command, C_ANY, &clen);
      switch (command_type) {
        	case C_EXEC: 
! 	    if (match(output_pattern, output_string, O_EXEC, &clen) != -1)
  		exec_handler();
! 	    else if (match(output_pattern, output_string, O_DONE, &clen) != -1)
  		done_handler();
  	    else
***************
*** 197,201 ****
  	    break;
  	case C_STOPAT: 
! 	    if (match(output_pattern, output_string, O_STOPAT) != -1)
  		stop_at_handler();
  	    else
--- 208,212 ----
  	    break;
  	case C_STOPAT: 
! 	    if (match(output_pattern, output_string, O_STOPAT, &clen) != -1)
  		stop_at_handler();
  	    else
***************
*** 203,207 ****
  	    break;
  	case C_STOPIN: 
! 	    if (match(output_pattern, output_string, O_STOPIN) != -1)
  		stop_in_handler();
  	    else
--- 214,218 ----
  	    break;
  	case C_STOPIN: 
! 	    if (match(output_pattern, output_string, O_STOPIN, &clen) != -1)
  		stop_in_handler();
  	    else
***************
*** 209,219 ****
  	    break;
  	case C_UPDOWN:
! 	    if (match(output_pattern, output_string, O_UPDOWN) != -1)
  		updown_handler();
! 	    else
  		bell(0);
  	    break;
  	case C_SEARCH:
! 	    if (match(output_pattern, output_string, O_SEARCH) != -1)
  		search_handler();
  	    else
--- 220,236 ----
  	    break;
  	case C_UPDOWN:
! 	    if (match(output_pattern, output_string, O_UPDOWN, &clen) != -1) {
! #ifdef alliant
! 		clen = Token.line;	/* up/down prints src line w/# */
! 		query_dbx("where\n");
! 		if (Token.line == 0)	/* 'where' yields no # at toplevel */
! 		    Token.line = clen;
! #endif
  		updown_handler();
! 	    } else
  		bell(0);
  	    break;
  	case C_SEARCH:
! 	    if (match(output_pattern, output_string, O_SEARCH, &clen) != -1)
  		search_handler();
  	    else
***************
*** 224,228 ****
  	    break;
  	case C_FILE:
! 	    if (match(output_pattern, output_string, O_FILE) != -1)
  	    	file_handler();		/* command was 'file' */
  	    else
--- 241,245 ----
  	    break;
  	case C_FILE:
! 	    if (match(output_pattern, output_string, O_FILE, &clen) != -1)
  	    	file_handler();		/* command was 'file' */
  	    else
***************
*** 230,234 ****
  	    break;
  	case C_LIST:
! 	    if (match(output_pattern, output_string, O_LIST) != -1)
  	        list_handler();
  	    else
--- 247,251 ----
  	    break;
  	case C_LIST:
! 	    if (match(output_pattern, output_string, O_LIST, &clen) != -1)
  	        list_handler();
  	    else
***************
*** 237,242 ****
  	case C_FUNC:
  #ifdef MIPS
! 	    if (match(output_pattern, output_string, O_FUNC) != -1)
  #else
  	    if (strcmp(output_string, "") == NULL)
  #endif
--- 254,264 ----
  	case C_FUNC:
  #ifdef MIPS
! 	    if (match(output_pattern, output_string, O_FUNC, &clen) != -1)
  #else
+ #ifdef alliant
+ 	    if (match(output_pattern, output_string, O_FUNC, &clen) != -1)
+ 		;			/* command was 'func' */
+ 	    else			/* command was 'func ...' */
+ #endif
  	    if (strcmp(output_string, "") == NULL)
  #endif
***************
*** 248,254 ****
  	    use_handler(output_string); 
  	    break;
! #ifndef BSD
  	case C_PRINT:
! 	    if (match(output_pattern, output_string, O_PRINT) != -1)
  	    	print_handler(output_string);
  	    else
--- 270,276 ----
  	    use_handler(output_string); 
  	    break;
! #if !defined(BSD) || defined(alliant)
  	case C_PRINT:
! 	    if (match(output_pattern, output_string, O_PRINT, &clen) != -1)
  	    	print_handler(output_string);
  	    else
***************
*** 256,262 ****
  	    break;
  	case C_DEBUG:
! 	    if (match(output_pattern, output_string, O_DEBUG) != -1)
  		debug_handler(); 
! 	    else
  		bell(0);
  	    break;
--- 278,288 ----
  	    break;
  	case C_DEBUG:
! 	    if (match(output_pattern, output_string, O_DEBUG, &clen) != -1) {
  		debug_handler(); 
! #ifdef alliant
! 		if (clen < strlen(output_string))  /* O_EXEC from core file */
! 		    parse(output_string+clen, "step\n");
! #endif
! 	    } else
  		bell(0);
  	    break;
***************
*** 272,276 ****
  	case C_DISPLAY:
  	    if (strcmp(output_string, "") == NULL ||
! 	    	match(output_pattern, output_string, O_PRINT) != -1)
  	    	display_handler();
  	    else
--- 298,302 ----
  	case C_DISPLAY:
  	    if (strcmp(output_string, "") == NULL ||
! 	    	match(output_pattern, output_string, O_PRINT, &clen) != -1)
  	    	display_handler();
  	    else
***************
*** 282,285 ****
--- 308,317 ----
  	    break;
  #endif
+ #ifdef alliant
+ 	case C_WHERE:
+ 	    if (match(output_pattern, output_string, O_WHERE, &clen) == -1)    
+ 		bell(0);
+ 	    break;
+ #endif
  	default:
  	    break;
***************
*** 304,307 ****
--- 336,340 ----
      static Boolean	deleteRest = False;
      int			command_type = -1;
+     int			clen;
  
      if (output == NULL || strcmp(output, "") == NULL) 
***************
*** 316,320 ****
  
      if (command)
!     	command_type = match(command_pattern, command, C_ANY);
      if (command_type == C_EXEC) {
  	if (re_match(output_pattern[O_EXEC].buf, string, strlen(string), 0, 
--- 349,353 ----
  
      if (command)
!     	command_type = match(command_pattern, command, C_ANY, &clen);
      if (command_type == C_EXEC) {
  	if (re_match(output_pattern[O_EXEC].buf, string, strlen(string), 0, 
***************
*** 338,350 ****
  	char *s;
  
! 	s = XtNewString(output);
  	switch (command_type) {
! #ifndef BSD
  	case C_UPDOWN:
! 	    if (match(output_pattern, s, O_UPDOWN) != -1)
! 		strcpy(s, Token.mesg);    
  	    break;
  	case C_DISPLAY:
! 	    if (match(output_pattern, s, O_PRINT) != -1)
  		strcpy(s, "");
  	    break;
--- 371,386 ----
  	char *s;
  
! 	s = XtNewString(string);
  	switch (command_type) {
! #if !defined(BSD) || defined(alliant)
  	case C_UPDOWN:
! 	    if (match(output_pattern, s, O_UPDOWN, &clen) != -1)
! 		if (Token.mesg)
! 		    strcpy(s, Token.mesg);    
! 		else
! 		    strcpy(s, "");
  	    break;
  	case C_DISPLAY:
! 	    if (match(output_pattern, s, O_PRINT, &clen) != -1)
  		strcpy(s, "");
  	    break;
***************
*** 352,356 ****
  #ifdef MIPS
  	case C_UPDOWN:
! 	    if (match(output_pattern, s, O_UPDOWN) != -1)
  		strcpy(s, Token.mesg);    
  		strcat(s, "\n");
--- 388,392 ----
  #ifdef MIPS
  	case C_UPDOWN:
! 	    if (match(output_pattern, s, O_UPDOWN, &clen) != -1)
  		strcpy(s, Token.mesg);    
  		strcat(s, "\n");
***************
*** 357,361 ****
  	    break;
  	case C_FUNC:
! 	    if (match(output_pattern, s, O_FUNC) != -1)
  		strcpy(s, "");
  	    break;
--- 393,397 ----
  	    break;
  	case C_FUNC:
! 	    if (match(output_pattern, s, O_FUNC, &clen) != -1)
  		strcpy(s, "");
  	    break;
***************
*** 362,374 ****
  #endif
  	case C_SEARCH:
! 	    if (match(output_pattern, s, O_SEARCH) != -1)
  		strcpy(s, "");
  	    break;
  	case C_LIST:
! 	    if (match(output_pattern, s, O_LIST) != -1)
  		strcpy(s, "");
  	    break;
! 	default:
! 	    s = XtNewString(string);		/* append 'string' only */
  	    break;
  	}
--- 398,409 ----
  #endif
  	case C_SEARCH:
! 	    if (match(output_pattern, s, O_SEARCH, &clen) != -1)
  		strcpy(s, "");
  	    break;
  	case C_LIST:
! 	    if (match(output_pattern, s, O_LIST, &clen) != -1)
  		strcpy(s, "");
  	    break;
! 	default:		/* append 'string' only */
  	    break;
  	}
***************
*** 378,382 ****
      else {
  	switch (command_type) {
! #ifndef BSD
  	case C_UPDOWN:
  	case C_DISPLAY:
--- 413,417 ----
      else {
  	switch (command_type) {
! #if !defined(BSD) || defined(alliant)
  	case C_UPDOWN:
  	case C_DISPLAY:
*** 1.1	1992/04/09 08:00:16
--- windows.c	1992/04/09 08:10:41
***************
*** 160,164 ****
      CreateCommandPanel(vpane);
      CreateDialogWindow(vpane);
! #ifndef BSD
      CreateDisplayWindow(vpane);
  #endif
--- 160,164 ----
      CreateCommandPanel(vpane);
      CreateDialogWindow(vpane);
! #if !defined(BSD) || defined(alliant)
      CreateDisplayWindow(vpane);
  #endif
*** 1.1	1992/04/08 23:40:44
--- xdbx.c	1992/04/08 23:43:31
***************
*** 156,167 ****
      {"-I",	"includeDir",	XrmoptionSepArg, NULL},
      {"-k",	"dbxopt_k",	XrmoptionNoArg, "True"},
! #ifdef BSD   /* Berkeley dbx */
      {"-c",	"cfile",	XrmoptionSepArg, NULL},
! #else	     /* Sun dbx */
!     {"-kbd",	"dbxopt_kbd",	XrmoptionNoArg, "True"},
!     {"-f",	"fcount",	XrmoptionSepArg, NULL},
      {"-s",	"startup",	XrmoptionSepArg, NULL},
      {"-sr",	"tstartup",	XrmoptionSepArg, NULL},
  #endif
  #ifdef MIPS  /* Mips dbx */
      {"-pixie",  "pixie",	XrmoptionNoArg, "True"},
--- 156,169 ----
      {"-I",	"includeDir",	XrmoptionSepArg, NULL},
      {"-k",	"dbxopt_k",	XrmoptionNoArg, "True"},
! #if defined(BSD) && !defined(alliant)
      {"-c",	"cfile",	XrmoptionSepArg, NULL},
! #else	     /* Sun & Alliant dbx */
      {"-s",	"startup",	XrmoptionSepArg, NULL},
      {"-sr",	"tstartup",	XrmoptionSepArg, NULL},
  #endif
+ #ifndef BSD	/* Sun dbx */
+     {"-kbd",	"dbxopt_kbd",	XrmoptionNoArg, "True"},
+     {"-f",	"fcount",	XrmoptionSepArg, NULL},
+ #endif
  #ifdef MIPS  /* Mips dbx */
      {"-pixie",  "pixie",	XrmoptionNoArg, "True"},
***************
*** 281,285 ****
       */
      if (strcmp(xdbxinit, "")) {		/* .dbxinit or ~/.dbxinit exists */
! #ifdef BSD
  	dbxargv[i++] = "-c";
  #else
--- 283,287 ----
       */
      if (strcmp(xdbxinit, "")) {		/* .dbxinit or ~/.dbxinit exists */
! #if defined(BSD) && !defined(alliant)
  	dbxargv[i++] = "-c";
  #else
-- 
  -- Howard Chu @ Jet Propulsion Laboratory, Pasadena, CA