Date: Fri, 24 Feb 1995 09:28:28 +0800 From: pierre AT phi DOT la DOT tce DOT com (Pierre Willard) To: palomino!edward AT uunet DOT uu DOT net Cc: uunet!sun.soe.clarkson.edu!djgpp AT uunet DOT uu DOT net Subject: Re: Where can I find source code for xgdb to work with gdb-4.13 Reply-To: pierre AT la DOT tce DOT com Get xxgdb 1.08, you can ftp from : ftp.funet.fi in /pub/X11R5/contrib directory, file : - -rw-r--r-- 1 ruokonen ftp 109994 Jan 12 22:41 xxgdb.108.tar.gz Also there is a small patch to build xxgdb 1.09 (see below). Bye Pierre Willard *** XDbx.NEW_INTERFACE Thu Dec 2 16:01:55 1993 --- ../XDbx.NEW_INTERFACE Fri Feb 11 09:26:50 1994 *************** *** 1,6 **** ! # ! # XXgdb 1.08 Application defaults file with NEW_INTERFACE ! # (derived from Xdbx 2.1 app-defaults) *background: snow1 *foreground: black --- 1,6 ---- ! ! ! ! XXgdb 1.08 Application defaults file with NEW_INTERFACE ! ! (derived from Xdbx 2.1 app-defaults) *background: snow1 *foreground: black *** XDbx.ad Mon Jan 10 13:13:10 1994 --- ../XDbx.ad Fri Feb 11 09:24:06 1994 *************** *** 1,6 **** ! # ! # Xdbx 2.1 Application defaults file ! # *background: snow1 *foreground: black --- 1,6 ---- ! ! ! ! Xdbx 2.1 Application defaults file ! ! *background: snow1 *foreground: black *************** *** 46,55 **** : SelectEnd() \n *commandWindow.preferredPaneSize: 135 *commandWindow.skipAdjust: True ! #*commandWindow.hSpace: 14 ! #*commandWindow.vSpace: 10 ! #*Command.height: 20 ! #*Command.width: 60 *List.columnSpacing: 10 *displayWindow.preferredPaneSize: 50 *displayWindow.skipAdjust: True --- 46,55 ---- : SelectEnd() \n *commandWindow.preferredPaneSize: 135 *commandWindow.skipAdjust: True ! !*commandWindow.hSpace: 14 ! !*commandWindow.vSpace: 10 ! !*Command.height: 20 ! !*Command.width: 60 *List.columnSpacing: 10 *displayWindow.preferredPaneSize: 50 *displayWindow.skipAdjust: True *** bitmaps.h Thu Nov 18 15:46:00 1993 --- ../bitmaps.h Fri Feb 11 09:19:06 1994 *************** *** 37,47 **** * in the source window. */ /* bitmap data for 48x48 xdbx icon */ #define xdbx48_width 48 #define xdbx48_height 48 ! static char xdbx48_bits[] = { 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x78, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x3c, 0xf8, 0x7f, 0x00, 0x02, 0x00, 0x3c, 0xf0, 0xff, 0x00, 0x02, 0x00, 0x1e, --- 37,52 ---- * in the source window. */ + /* + * iand 94/02/10 remove compiler warnings + */ + /* bitmap data for 48x48 xdbx icon */ #define xdbx48_width 48 #define xdbx48_height 48 ! #define xdbx48_bits (char *)xdbx48_bits_u ! static unsigned char xdbx48_bits_u[] = { 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x78, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x3c, 0xf8, 0x7f, 0x00, 0x02, 0x00, 0x3c, 0xf0, 0xff, 0x00, 0x02, 0x00, 0x1e, *************** *** 72,78 **** #define xdbx64_width 64 #define xdbx64_height 64 ! static char xdbx64_bits[] = { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xf8, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xf8, 0xff, 0x07, 0x00, --- 77,84 ---- #define xdbx64_width 64 #define xdbx64_height 64 ! #define xdbx64_bits (char *)xdbx64_bits_u ! static unsigned char xdbx64_bits_u[] = { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xf8, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xf8, 0xff, 0x07, 0x00, *************** *** 124,130 **** #define stop_height 16 #define stop_x_hot -1 #define stop_y_hot -1 ! static char stop_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xd0, 0x01, 0x5c, 0x07, 0x54, 0x05, 0x54, 0x05, 0x14, 0x04, 0x0c, 0x04, 0x08, 0x04, 0x18, 0x06, 0xf0, 0x03, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00}; --- 130,137 ---- #define stop_height 16 #define stop_x_hot -1 #define stop_y_hot -1 ! #define stop_bits (char *)stop_bits_u ! static unsigned char stop_bits_u[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xd0, 0x01, 0x5c, 0x07, 0x54, 0x05, 0x54, 0x05, 0x14, 0x04, 0x0c, 0x04, 0x08, 0x04, 0x18, 0x06, 0xf0, 0x03, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00}; *************** *** 136,142 **** #define arrow_height 16 #define arrow_x_hot -1 #define arrow_y_hot -1 ! static char arrow_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x01, 0x80, 0x03, 0xff, 0x07, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x07, 0x80, 0x03, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; --- 143,150 ---- #define arrow_height 16 #define arrow_x_hot -1 #define arrow_y_hot -1 ! #define arrow_bits (char *)arrow_bits_u ! static unsigned char arrow_bits_u[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x01, 0x80, 0x03, 0xff, 0x07, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x07, 0x80, 0x03, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; *************** *** 148,154 **** #define updown_height 16 #define updown_x_hot -1 #define updown_y_hot -1 ! static char updown_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x01, 0x80, 0x03, 0xff, 0x06, 0x01, 0x0c, 0x01, 0x0c, 0xff, 0x06, 0x80, 0x03, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; --- 156,163 ---- #define updown_height 16 #define updown_x_hot -1 #define updown_y_hot -1 ! #define updown_bits (char *)updown_bits_u ! static unsigned char updown_bits_u[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x01, 0x80, 0x03, 0xff, 0x06, 0x01, 0x0c, 0x01, 0x0c, 0xff, 0x06, 0x80, 0x03, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; *************** *** 158,164 **** #define bomb_width 16 #define bomb_height 16 ! static char bomb_bits[] = { 0x00, 0x00, 0x69, 0x00, 0x94, 0x00, 0x8a, 0x00, 0xc0, 0x01, 0xc5, 0x01, 0xf0, 0x07, 0xf0, 0x07, 0xf8, 0x0f, 0xf8, 0x0d, 0xf8, 0x0d, 0xf8, 0x0d, 0xf0, 0x06, 0xf0, 0x07, 0xc0, 0x01, 0x00, 0x00}; --- 167,174 ---- #define bomb_width 16 #define bomb_height 16 ! #define bomb_bits (char *)bomb_bits_u ! static unsigned char bomb_bits_u[] = { 0x00, 0x00, 0x69, 0x00, 0x94, 0x00, 0x8a, 0x00, 0xc0, 0x01, 0xc5, 0x01, 0xf0, 0x07, 0xf0, 0x07, 0xf8, 0x0f, 0xf8, 0x0d, 0xf8, 0x0d, 0xf8, 0x0d, 0xf0, 0x06, 0xf0, 0x07, 0xc0, 0x01, 0x00, 0x00}; *** calldbx.c Mon Nov 29 17:49:38 1993 --- ../calldbx.c Wed Apr 13 14:43:57 1994 *************** *** 69,74 **** --- 69,83 ---- * create_io_window(): create an io window for gdb to use */ + /* iand 94/02/10 clean up iowin stuff + * iand 94/02/10 enable CREATE_IO_WINDOW feature to compile on SVR4 + * iand 94/02/10 Better pty support. + * Removes complaints about tcsetpgrp fails etc. + * Don't need to explicitly fiddle process groups anyway. + * Push ttcompat on SVR4 boxen. + * pw 94/02/11 Include and if not SVR4. + */ + /* * (JBL)10MAY91 : not only OLDSUNOS but generic BSD have sgttyb */ *************** *** 81,86 **** --- 90,96 ---- #include #include #include + #include #include "global.h" *************** *** 89,112 **** #include #endif /* CREATE_IO_WINDOW */ ! #ifdef SYSV #ifdef SUNOS4 /*(PW)27AUG93 : for Solaris */ #include #endif /* SUNOS4 */ ! #ifdef SVR4 /* (MJH) Need to use STREAMS pseudo-ttys */ ! #define MASTER_CLONE "/dev/ptmx" #include #include #include #include - #include #else #ifdef sco ! # include #endif /* sco */ #endif /* SVR4 */ #endif /* SYSV */ extern char *progname; /* (MJH) */ FILE *dbxfp = NULL; /* file pointer to dbx */ --- 99,128 ---- #include #endif /* CREATE_IO_WINDOW */ ! #ifdef SYSV #ifdef SUNOS4 /*(PW)27AUG93 : for Solaris */ #include #endif /* SUNOS4 */ ! ! #define MASTER_CLONE "/dev/ptmx" /* (MJH) Need to use STREAMS pseudo-ttys */ ! ! #ifdef SVR4 #include #include #include #include #else + #include #ifdef sco ! #include #endif /* sco */ #endif /* SVR4 */ #endif /* SYSV */ + #if defined(SYSV) || defined(SVR4) + #define signal sigset + #endif + extern char *progname; /* (MJH) */ FILE *dbxfp = NULL; /* file pointer to dbx */ *************** *** 120,130 **** #ifndef SVR4 /* (MJH) */ static char pty[11] = "/dev/pty??"; /* master side of pseudo-terminal */ static char tty[11] = "/dev/tty??"; /* slave side of pseudo-terminal */ #ifdef CREATE_IO_WINDOW ! char iowintty[] = "/dev/ttyp0"; int iowinpid = 0; #endif /* CREATE_IO_WINDOW */ - #endif /* SVR4 */ extern char *dbxprompt; /* --- 136,146 ---- #ifndef SVR4 /* (MJH) */ static char pty[11] = "/dev/pty??"; /* master side of pseudo-terminal */ static char tty[11] = "/dev/tty??"; /* slave side of pseudo-terminal */ + #endif /* SVR4 */ #ifdef CREATE_IO_WINDOW ! char iowintty[50]; int iowinpid = 0; #endif /* CREATE_IO_WINDOW */ extern char *dbxprompt; /* *************** *** 136,148 **** { int master; ! #ifdef SVR4 /* (MJH) Use STREAMS */ if((master = open(MASTER_CLONE, O_RDWR)) < 0) perror(MASTER_CLONE); else return master; ! #else int i; char c; --- 152,166 ---- { int master; ! #ifdef MASTER_CLONE /* (MJH) Use STREAMS */ if((master = open(MASTER_CLONE, O_RDWR)) < 0) perror(MASTER_CLONE); else return master; ! ! #else /* not MASTER_CLONE */ ! int i; char c; *************** *** 161,168 **** #ifndef sco } #endif ! #endif /* SVR4 */ #ifdef GDB fprintf(stderr, "xxgdb: all ptys in use\n"); #else --- 179,187 ---- #ifndef sco } #endif ! #endif /* MASTER_CLONE */ + #ifdef GDB fprintf(stderr, "xxgdb: all ptys in use\n"); #else *************** *** 177,187 **** { int slave; ! #ifdef SVR4 /* (MJH) */ char *slave_name = "unknown"; extern char *ptsname(int master); void (*handler)(); if(((handler = signal(SIGCHLD, SIG_DFL)) != SIG_ERR) && (grantpt(master) == 0) && (signal(SIGCHLD, handler) == SIG_DFL) && --- 196,234 ---- { int slave; ! #ifdef MASTER_CLONE /* (MJH) */ char *slave_name = "unknown"; extern char *ptsname(int master); void (*handler)(); + #if 1 + if ((handler = signal(SIGCHLD, SIG_DFL)) == SIG_ERR) { + perror ("Pseudo-tty slave : signal SIG_DFL"); + } else if (grantpt(master)) { + perror ("Pseudo-tty slave : grantpt"); + } else if (signal(SIGCHLD, handler) != SIG_DFL) { + perror ("Pseudo-tty slave : signal handler"); + } else if (unlockpt(master)) { + perror ("Pseudo-tty slave : unlockpt"); + } else if ((slave_name = ptsname(master)) == NULL) { + perror ("Pseudo-tty slave : ptsname"); + } else if ((slave = open(slave_name, O_RDWR)) < 0) { + perror ("Pseudo-tty slave : open"); + fprintf(stderr, "open: cannot open slave pty %s", slave_name); + } else if (ioctl(slave, I_PUSH, "ptem") < 0) { + perror ("Pseudo-tty slave : ioctl ptem"); + } else if (ioctl(slave, I_PUSH, "ldterm") < 0) { + perror ("Pseudo-tty slave : ioctl ldterm"); + #ifdef SVR4 + } else if (ioctl(slave, I_PUSH, "ttcompat") < 0) { + perror ("Pseudo-tty slave : ioctl ttcompat"); + #endif + } else { + return slave; + } + exit (1); + #else + if(((handler = signal(SIGCHLD, SIG_DFL)) != SIG_ERR) && (grantpt(master) == 0) && (signal(SIGCHLD, handler) == SIG_DFL) && *************** *** 189,200 **** ((slave_name = ptsname(master)) != NULL) && ((slave = open(slave_name, O_RDWR)) >= 0) && (ioctl(slave, I_PUSH, "ptem") >= 0) && ! (ioctl(slave, I_PUSH, "ldterm") >= 0)) return slave; perror("Pseudo-tty slave"); fprintf(stderr, "open: cannot open slave pty %s", slave_name); exit(1); ! #else tty[8] = pty[8]; tty[9] = pty[9]; if ((slave = open(tty, O_RDWR)) < 0) --- 236,254 ---- ((slave_name = ptsname(master)) != NULL) && ((slave = open(slave_name, O_RDWR)) >= 0) && (ioctl(slave, I_PUSH, "ptem") >= 0) && ! (ioctl(slave, I_PUSH, "ldterm") >= 0) ! #ifdef SVR4 ! && (ioctl(slave, I_PUSH, "ttcompat") >= 0) ! #endif ! ) return slave; perror("Pseudo-tty slave"); fprintf(stderr, "open: cannot open slave pty %s", slave_name); exit(1); ! #endif ! ! #else /* not MASTER_CLONE */ ! tty[8] = pty[8]; tty[9] = pty[9]; if ((slave = open(tty, O_RDWR)) < 0) *************** *** 203,209 **** exit(1); } return slave; ! #endif /* SVR4 */ } #ifdef CREATE_IO_WINDOW --- 257,263 ---- exit(1); } return slave; ! #endif /* MASTER_CLONE */ } #ifdef CREATE_IO_WINDOW *************** *** 216,222 **** void create_io_window () { ! int pid = fork(); if (pid == -1) { printf("unable to fork\n"); --- 270,279 ---- void create_io_window () { ! int pid; ! ! (void) fflush(stdout); ! pid = fork(); if (pid == -1) { printf("unable to fork\n"); *************** *** 240,251 **** { /* child */ /* printf("xterm xterm -l -e xxgdbiowin\n");*/ ! if (execlp("xterm", "xterm", "-e", "xxgdbiowin", 0)) ! { ! printf("exec of 'xterm -e xxgdbiowin' fails\n"); ! unlink("/tmp/iowindowtty"); ! } ! } } #endif /* CREATE_IO_WINDOW */ --- 297,307 ---- { /* child */ /* printf("xterm xterm -l -e xxgdbiowin\n");*/ ! (void) execlp("xterm", "xterm", "-e", "xxgdbiowin", 0); ! perror("exec of 'xterm -e xxgdbiowin' fails"); ! unlink("/tmp/iowindowtty"); ! _exit(1); ! } } #endif /* CREATE_IO_WINDOW */ *************** *** 303,329 **** * controlling tty. */ - #if defined(SVR4) /* (MJH) */ - if ((tcgetsid(0) != tcgetpgrp(0)) && /* Check if fore- or back-ground */ - (fd = open("/dev/tty", O_RDWR|O_NDELAY)) > 0) { - ioctl(fd, TIOCNOTTY, 0); - close(fd); - } - #else /* not SVR4 */ - if ((fd = open("/dev/tty", O_RDWR)) > 0) { - #ifndef SYSV - ioctl(fd, TIOCNOTTY, 0); - #endif /* SYSV */ - close(fd); - } - #endif /* SVR4 */ - master = open_master(); - #if defined(SVR4) || !defined(SYSV) - slave = open_slave(master); - #endif - dbxpid = fork(); if (dbxpid == -1) { sprintf(errmsg, "%s error: Cannot fork %s\n", progname, debugger); /* (MJH) */ --- 359,366 ---- *************** *** 339,349 **** * set line buffered mode * register dbx input with X */ - - #if defined(SVR4) || !defined(SYSV) /* (MJH) */ - close(slave); - #endif /* SYSV */ - close(0); close(1); fcntl(master, F_SETFL, FNDELAY); --- 376,381 ---- *************** *** 372,378 **** #else setvbuf(dbxfp, NULL, _IONBF, 0); #endif ! #endif dbxInputId = XtAppAddInput(app_context, master, (XtPointer) XtInputReadMask, read_dbx, NULL); --- 404,410 ---- #else setvbuf(dbxfp, NULL, _IONBF, 0); #endif ! #endif /* SYSV */ dbxInputId = XtAppAddInput(app_context, master, (XtPointer) XtInputReadMask, read_dbx, NULL); *************** *** 383,395 **** * redirect stdin, stdout, stderr of dbx to pty * unbuffer output data from dbx * exec dbx with arguments */ ! ! #if defined(SYSV) && !defined(SVR4) /* (MJH) */ ! setpgrp(); ! slave = open_slave(master); #endif ! close(master); /* * Modify local and output mode of slave pty --- 415,435 ---- * redirect stdin, stdout, stderr of dbx to pty * unbuffer output data from dbx * exec dbx with arguments + * + * Make the child gain the slave as its controlling tty, + * and cause the child to enter a new process group at the + * same time. */ ! #if defined(SYSV) || defined(SVR4) ! setpgrp(); ! #else ! if ((fd = open("/dev/tty", O_RDWR)) >= 0) { ! ioctl(fd, TIOCNOTTY, 0); ! close(fd); ! } #endif ! slave = open_slave(master); ! close(master); /* * Modify local and output mode of slave pty *************** *** 418,453 **** fcntl(1, F_SETFL, FAPPEND); setbuf(stdout, NULL); - - /* - * Set our process group to that of the terminal, - * so we can change the group of the terminal. - */ - #ifndef SYSV - { - int pid; /* process id */ - int pgrp; /* process group id */ - - ioctl(0, TIOCGPGRP, &pgrp); - setpgrp(0, pgrp); - - /* - * Now set the process group of the terminal and of us - * to our process id. This clears us from the control - * of the other process group. - */ - pid = getpid(); - ioctl(0, TIOCSPGRP, &pid); - setpgrp(0, pid); - } - #endif /* not SYSV */ - - #ifdef SVR4 /* (MJH) */ - if (tcsetpgrp(0, tcgetpgrp(0))) - perror ("tcsetpgrp"); - if (tcsetpgrp(0, getpid())) - perror ("tcsetpgrp"); - #endif /* SVR4 */ argv[0] = debugger; execvp(debugger, argv); --- 458,463 ---- *** datadpy.c Thu Nov 18 14:26:21 1993 --- ../datadpy.c Wed Apr 13 15:40:22 1994 *************** *** 78,83 **** --- 78,92 ---- * print_handler(): Action handler for displaying pointers and structures. */ + /* + * 01FEB94: bugs fixed (klamer) + * xxgdb does not allow the graphically displaying of members of parents + * from a class. + * xxgdb does not allow the graphically displaying of data through a + * reference. + */ + + #include #include "global.h" #include "regex.h" #include "datadpy.h" *************** *** 220,225 **** --- 229,240 ---- newcommand = parse_gdb_print(command, dataDpy->buf, dataDpy->buf + left ); if (*newcommand) { + if (strchr(selection, '@')) + { + char *p = strchr(newcommand, '*'); + if (p != 0) + *p = ' '; + } PopupMode = True; query_gdb(newcommand, PARSE_ON | ECHO_OFF | FILTER_OFF); } *************** *** 699,706 **** #ifdef GDB - #include - #define GOODCHARNAME(c) \ ( (((c) >='a') && ((c) <= 'z')) \ || (((c) >='A') && ((c) <= 'Z')) \ --- 714,719 ---- *************** *** 732,737 **** --- 745,754 ---- *result = 0; return; } + + if ((c == '.') && (result[result_index] == '.')) + return; /* To prevent $1..name for pointers in + g++ parents */ result_index--; *(result+result_index) = c; *** datadpy.h Thu Nov 18 14:25:59 1993 --- ../datadpy.h Fri Feb 11 12:43:28 1994 *************** *** 80,86 **** /* Note : for GDB the 'set prettyprint on' must be ON. ! Exaamples " $3 = (struct toto *) 0x40c0 --- 80,86 ---- /* Note : for GDB the 'set prettyprint on' must be ON. ! Examples : $3 = (struct toto *) 0x40c0 *************** *** 92,98 **** */ PatternRec dataPattern[] = { ! {"0x[0-9a-f]+", NULL, {-1, -1, -1, -1, -1, -1} }, {"\\([ ]*\\)\\(.*[^ ]+\\)[ ]* = \\((.*) \\)?\\(0x[0-9a-f]+\\)[,]?[ ]*\n", --- 92,98 ---- */ PatternRec dataPattern[] = { ! {"@*0x[0-9a-f]+", NULL, {-1, -1, -1, -1, -1, -1} }, {"\\([ ]*\\)\\(.*[^ ]+\\)[ ]* = \\((.*) \\)?\\(0x[0-9a-f]+\\)[,]?[ ]*\n", *** gdb_handler.c Mon Jan 10 12:40:58 1994 --- ../gdb_handler.c Wed Apr 13 15:54:14 1994 *************** *** 419,425 **** { if (*(output_string++) == '\n') { ! if (sscanf(output_string, "%d%s%s%s", &i,&type,&disp,&enb) == 4) if (i > 0 && i <= nstops && stops[i].line > 0 && !strcmp(type,"breakpoint") && !strcmp(enb,"y")) stops[i].tag = 1; --- 419,425 ---- { if (*(output_string++) == '\n') { ! if (sscanf(output_string, "%d%s%s%s", &i,type,disp,enb) == 4) if (i > 0 && i <= nstops && stops[i].line > 0 && !strcmp(type,"breakpoint") && !strcmp(enb,"y")) stops[i].tag = 1; *** gdb_parser.c Thu Nov 18 15:24:18 1993 --- ../gdb_parser.c Wed Apr 13 15:54:57 1994 *************** *** 72,79 **** --- 72,86 ---- * gdb_source_command(): Test for source command. */ + /* + * iand 94/02/10 cope better with non-blocking I/O. Exit when pty is closed rather + * than spinning in a loop. + * + */ + #include #include + #include extern Boolean Prompt; /* True when gdb prompt arrives */ *************** *** 897,902 **** --- 904,954 ---- return FALSE; } + + /* + * cope with non-blocking I/O correctly + * ie: exit if child closes pty, but return if would block. + */ + static char * + #ifdef __STDC__ + my_fgets(char *buf, int size, FILE *f) + #else + my_fgets(buf, size, f) + char *buf; + int size; + FILE *f; + #endif + { + char *orig_buf = buf; + + while(size > 1) { + int cc; + + cc = read(fileno(f), buf, 1); + if(cc == -1) { + if(errno == EAGAIN || errno == EWOULDBLOCK) { + if(buf != orig_buf) + break; + return(0); + } + perror("read from gdb"); + exit(1); + /*NOTREACHED*/ + } + if(cc == 0) { + (void) fprintf(stderr, "EOF from gdb\n"); + exit(1); + /*NOTREACHED*/ + } + buf++; + size--; + if(*(buf-1) == '\n') + break; + } + *buf = '\0'; + return(orig_buf); + } + /*--------------------------------------------------------------------------+ | | | Read gdb output until fgets returns no string. | *************** *** 927,933 **** while (more) { Prompt = False; /* keep reading until no more or until prompt arrives */ ! while ((more = (fgets(s, LINESIZ, dbxfp) != NULL)) && !Prompt) { if (debug) fprintf(stderr, "=>%s", s); --- 979,985 ---- while (more) { Prompt = False; /* keep reading until no more or until prompt arrives */ ! while ((more = (my_fgets(s, LINESIZ, dbxfp) != NULL)) && !Prompt) { if (debug) fprintf(stderr, "=>%s", s); *************** *** 949,955 **** string = concat(string, s); strcpy(s, ""); } ! output = concat(output, string); command = get_command(); /* read queue's top command */ --- 1001,1007 ---- string = concat(string, s); strcpy(s, ""); } ! output = concat(output, string); command = get_command(); /* read queue's top command */ *** signals.c Mon Nov 29 18:25:14 1993 --- ../signals.c Fri Feb 11 09:25:33 1994 *************** *** 42,47 **** --- 42,53 ---- * trap_signals(): Install signal handlers. */ + /* + * iand 94/02/10 eliminate signal handler prototype warnings on SVR4 and similar systems + * iand 94/02/10 use reliable signals on SYSV + * + */ + #include #ifdef _POSIX_SOURCE #include *************** *** 49,60 **** #include #include "global.h" /* Kill the dbx child process and then exits. */ /* ARGSUSED */ ! static void kill_handler(sig, code, scp, addr) ! int sig, code; ! struct sigcontext *scp; ! char *addr; { if (FalseSignal) { FalseSignal = FALSE; --- 55,69 ---- #include #include "global.h" + #if defined(SYSV) || defined(SVR4) + #define signal sigset + #endif + /* Kill the dbx child process and then exits. */ /* ARGSUSED */ ! static void ! kill_handler(sig) ! int sig; { if (FalseSignal) { FalseSignal = FALSE; *************** *** 78,84 **** } ! static void quit_handler() { int pid; #ifdef SYSV --- 87,93 ---- } ! static void quit_handler(sig) { int pid; #ifdef SYSV *************** *** 119,125 **** } ! static void stop_handler() { if (dbxpid) kill(dbxpid, SIGSTOP); /* stop dbx process */ --- 128,134 ---- } ! static void stop_handler(sig) { if (dbxpid) kill(dbxpid, SIGSTOP); /* stop dbx process */ *************** *** 127,133 **** } ! static void cont_handler() { if (dbxpid) { sleep(1); /* we need this */ --- 136,142 ---- } ! static void cont_handler(sig) { if (dbxpid) { sleep(1); /* we need this */ *** source.c Mon Nov 29 17:49:22 1993 --- ../source.c Wed Apr 13 15:53:30 1994 *************** *** 404,409 **** --- 404,411 ---- {NULL, NULL} }; + #ifdef EDIT_BUTTON + static String eTextTranslations = "#override \n\ CtrlV: next-page() Update(warp) \n\ MetaV: previous-page() Update(warp) \n\ *************** *** 416,426 **** MetaF: forward-word() Update() \n\ MetaB: backward-word() Update() \n\ CtrlF: forward-character() Update() \n\ ! CtrlB: backward-character() Update() \n" ! #ifdef EDIT_BUTTON ! " MetaE: Editor() \n" ! #endif ! " Meta<: beginning-of-file() Update(warp) \n\ Meta>: end-of-file() Update(warp) \n\ L: redraw-display() Update() \n\ S: Search() Update() \n\ --- 418,426 ---- MetaF: forward-word() Update() \n\ MetaB: backward-word() Update() \n\ CtrlF: forward-character() Update() \n\ ! CtrlB: backward-character() Update() \n\ ! MetaE: Editor() \n\ ! Meta<: beginning-of-file() Update(warp) \n\ Meta>: end-of-file() Update(warp) \n\ L: redraw-display() Update() \n\ S: Search() Update() \n\ *************** *** 442,452 **** space: forward-character() Update() \n\ BackSpace: backward-character() Update() \n\ 1: beginning-of-file() Update(warp) \n\ ! G: end-of-file() Update(warp) \n" ! #ifdef EDIT_BUTTON ! " E: Editor() \n" ! #endif ! " L: redraw-display() Update() \n\ /: Search() Update() \n\ ?: Search() Update() \n\ : SelectStart() SelectWord() \n\ --- 442,450 ---- space: forward-character() Update() \n\ BackSpace: backward-character() Update() \n\ 1: beginning-of-file() Update(warp) \n\ ! G: end-of-file() Update(warp) \n\ ! E: Editor() \n\ ! L: redraw-display() Update() \n\ /: Search() Update() \n\ ?: Search() Update() \n\ : SelectStart() SelectWord() \n\ *************** *** 453,458 **** --- 451,504 ---- Shift: Update() SelectEnd() PrintSelection() \n\ : Update() SelectEnd() \n\ "; + + #else /* not EDIT_BUTTON */ + + static String eTextTranslations = "#override \n\ + CtrlV: next-page() Update(warp) \n\ + MetaV: previous-page() Update(warp) \n\ + CtrlN: next-line() Update() \n\ + CtrlP: previous-line() Update() \n\ + CtrlZ: scroll-one-line-up() Update(warp) \n\ + MetaZ: scroll-one-line-down() Update(warp) \n\ + Meta]: forward-paragraph() Update(warp) \n\ + Meta[: backward-paragraph() Update(warp) \n\ + MetaF: forward-word() Update() \n\ + MetaB: backward-word() Update() \n\ + CtrlF: forward-character() Update() \n\ + CtrlB: backward-character() Update() \n\ + Meta<: beginning-of-file() Update(warp) \n\ + Meta>: end-of-file() Update(warp) \n\ + L: redraw-display() Update() \n\ + S: Search() Update() \n\ + R: Search() Update() \n\ + : SelectStart() SelectWord() \n\ + Shift: Update() SelectEnd() PrintSelection() \n\ + : Update() SelectEnd() \n\ + "; + + static String vTextTranslations = "#override \n\ + CtrlF: next-page() Update(warp) \n\ + CtrlB: previous-page() Update(warp) \n\ + CtrlD: next-page() Update() \n\ + CtrlU: previous-page() Update() \n\ + Return: next-line() Update() \n\ + -: previous-line() Update() \n\ + j: next-line() Update() \n\ + k: previous-line() Update() \n\ + space: forward-character() Update() \n\ + BackSpace: backward-character() Update() \n\ + 1: beginning-of-file() Update(warp) \n\ + G: end-of-file() Update(warp) \n\ + L: redraw-display() Update() \n\ + /: Search() Update() \n\ + ?: Search() Update() \n\ + : SelectStart() SelectWord() \n\ + Shift: Update() SelectEnd() PrintSelection() \n\ + : Update() SelectEnd() \n\ + "; + + #endif /* EDIT_BUTTON */ /* fixes keybindings in source window */ static String sbarTranslations = "\ *** xdbx.c Mon Jan 10 13:33:39 1994 --- ../xdbx.c Wed Apr 13 14:54:42 1994 *************** *** 71,77 **** */ #ifdef GDB ! #define XGDBVERSION "1.08" #endif #ifdef SYSV --- 71,77 ---- */ #ifdef GDB ! #define XGDBVERSION "1.09" #endif #ifdef SYSV *** xxgdbiowin.c Mon Jan 10 13:11:25 1994 --- ../xxgdbiowin.c Fri Feb 11 09:07:55 1994 *************** *** 1,3 **** --- 1,7 ---- + /* + * iand 94/02/10 SVR4 port + * + */ #include #include #include *************** *** 5,13 **** #include #include ! void handler () { - } main () --- 9,22 ---- #include #include ! #if defined(SYSV) || defined(SVR4) ! #define signal sigset ! #endif ! ! static void ! handler (sig) ! int sig; { } main () *************** *** 42,50 **** signal(SIGINT, handler); signal(SIGQUIT, handler); signal(SIGTSTP, handler); setpgrp(0,0); close(0); close(1); ! while (1) sleep(2); } --- 51,63 ---- signal(SIGINT, handler); signal(SIGQUIT, handler); signal(SIGTSTP, handler); + #ifdef SVR4 + setpgid(0,0); + #else setpgrp(0,0); + #endif close(0); close(1); ! while (1) pause(); }