1 # Apply these patches to GDB to produce an Energize GDB.
2 # To apply these patches, first cd to gdb-XX/gdb, then run patch -p0 < thisfile.
3 ===================================================================
4 RCS file: /local/cvsfiles/devo/gdb/.Sanitize,v
5 retrieving revision 2.55
6 diff -c -r2.55 .Sanitize
7 *** 2.55 1992/06/23 05:03:32
8 --- .Sanitize 1992/06/23 05:03:51
29 ===================================================================
30 RCS file: /local/cvsfiles/devo/gdb/Makefile.in,v
31 retrieving revision 1.158
32 diff -c -r1.158 Makefile.in
33 *** 1.158 1992/06/19 22:39:40
34 --- Makefile.in 1992/06/23 04:22:01
38 READLINE_DEP = $$(READLINE_DIR)
39 RL_LIB = ./../readline${subdir}/libreadline.a
41 + # Cadillac libraries
42 + CADILLAC_DIR = ${srcdir}/deblib
43 + CADILLAC_INCLUDES = -I${CADILLAC_DIR}/connection -I${CADILLAC_DIR}/debugger
44 + CADILLAC_LIBS = ${srcdir}/deblib/connection/libconn.a
46 # All the includes used for CFLAGS and for lint.
47 # -I. for config files.
48 # -I${srcdir} possibly for regex.h also.
51 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
52 # TERMCAP comes after readline, since readline depends on it.
53 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
54 ! ${XM_CLIBS} ${TM_CLIBS}
55 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
56 ${RL_LIB} ${MMALLOC_LIB}
59 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
60 # TERMCAP comes after readline, since readline depends on it.
61 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
62 ! ${XM_CLIBS} ${TM_CLIBS} ${CADILLAC_LIBS}
63 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
64 ${RL_LIB} ${MMALLOC_LIB}
68 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
69 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
70 ieee-float.c language.c parse.c buildsym.c objfiles.c \
71 ! minsyms.c mipsread.c
73 # Source files in subdirectories (which will be handled separately by
76 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
77 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
78 ieee-float.c language.c parse.c buildsym.c objfiles.c \
79 ! minsyms.c mipsread.c cadillac.c
81 # Source files in subdirectories (which will be handled separately by
85 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
86 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
87 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
88 ! buildsym.o objfiles.o minsyms.o \
89 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
91 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
93 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
94 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
95 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
96 ! buildsym.o objfiles.o minsyms.o cadillac.o \
97 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
99 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
104 ttyflush.o: ${srcdir}/nindy-share/ttyflush.c
105 ${CC} -c ${INTERNAL_CFLAGS} ${srcdir}/nindy-share/ttyflush.c
107 + cadillac.o: ${srcdir}/cadillac.c
108 + ${CC} -c ${INTERNAL_CFLAGS} ${CADILLAC_INCLUDES} ${srcdir}/cadillac.c
111 $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
112 ===================================================================
113 RCS file: /local/cvsfiles/devo/gdb/breakpoint.c,v
114 retrieving revision 1.36
115 diff -c -r1.36 breakpoint.c
116 *** 1.36 1992/06/17 21:53:28
117 --- breakpoint.c 1992/06/23 04:19:21
121 b->cond_string = NULL;
123 printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
125 + cadillac_condition_breakpoint(b);
132 typed in or the decompiled expression. */
133 b->cond_string = savestring (arg, strlen (arg));
134 b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
136 + cadillac_condition_breakpoint(b);
138 error ("Junk at end of expression");
143 if (b->number == bnum)
145 ! if (from_tty && input_from_terminal_p ())
147 ! printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
148 End with a line saying just \"end\".\n", bnum);
151 l = read_command_lines ();
152 free_command_lines (&b->commands);
156 error ("No breakpoint number %d.", bnum);
159 if (b->number == bnum)
161 ! if ((from_tty && input_from_terminal_p ()) || cadillac)
162 ! printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
163 End with a line saying just \"end\".\n", bnum);
164 l = read_command_lines ();
165 free_command_lines (&b->commands);
168 + cadillac_commands_breakpoint(b);
171 error ("No breakpoint number %d.", bnum);
179 + cadillac_ignore_breakpoint(b);
187 struct breakpoint *b;
190 + cadillac_create_breakpoint(b);
198 register struct breakpoint *b;
202 + cadillac_delete_breakpoint(bpt);
205 target_remove_breakpoint(bpt->address, bpt->shadow_contents);
210 if (b->number == bptnum)
212 b->ignore_count = count;
214 + cadillac_ignore_breakpoint(b);
220 struct breakpoint *b;
223 ! b->ignore_count = 0;
226 /* Command to set ignore-count of breakpoint N to COUNT. */
228 struct breakpoint *b;
232 ! b->ignore_count = 0;
234 ! cadillac_ignore_breakpoint(b);
238 /* Command to set ignore-count of breakpoint N to COUNT. */
243 bpt->enable = enabled;
246 + cadillac_enable_breakpoint(bpt);
248 if (xgdb_verbose && bpt->type == bp_breakpoint)
249 printf ("breakpoint #%d enabled\n", bpt->number);
254 disable_breakpoint (bpt)
255 struct breakpoint *bpt;
258 + cadillac_disable_breakpoint(bpt);
260 bpt->enable = disabled;
262 if (xgdb_verbose && bpt->type == bp_breakpoint)
263 ===================================================================
264 RCS file: /local/cvsfiles/devo/gdb/command.c,v
265 retrieving revision 1.15
266 diff -c -r1.15 command.c
267 *** 1.15 1992/06/23 03:33:41
268 --- command.c 1992/06/23 04:19:26
274 ! while ((rc = wait (&status)) != pid && rc != -1)
277 error ("Fork failed");
282 ! while ((rc = cadillac ? cadillac_wait(&status) : wait (&status)) != pid && rc != -1)
285 error ("Fork failed");
286 ===================================================================
287 RCS file: /local/cvsfiles/devo/gdb/defs.h,v
288 retrieving revision 1.36
289 diff -c -r1.36 defs.h
290 *** 1.36 1992/06/15 14:26:55
291 --- defs.h 1992/06/16 01:24:19
298 + /* Energize/Cadillac stuff */
300 + /* Non-zero means that we're doing the cadillac interface. */
301 + extern int cadillac;
303 + /* Get a pty for use with cadillac */
304 + extern char *cadillac_getpty PARAMS ((void));
306 + /* Notify cadillac of new process creation */
307 + extern void cadillac_new_process PARAMS ((void));
309 + /* Low level wait routine for wait_for_inferior */
310 + extern int cadillac_wait PARAMS ((int *));
313 + extern void cadillac_initialize PARAMS ((char *, char *));
315 + /* Main loop for cadillac protocol driver */
316 + extern void cadillac_main_loop PARAMS ((void));
318 + struct cmd_list_element;
320 + /* Command hook for cadillac */
321 + extern void cadillac_call_command PARAMS ((struct cmd_list_element *,
324 + /* Read commands for the command command, and others */
325 + extern char *cadillac_command_line_input PARAMS ((void));
330 + extern void cadillac_start_variable_annotation PARAMS ((char *,
336 + extern void cadillac_end_variable_annotation PARAMS ((void));
338 + extern void cadillac_annotate_function PARAMS ((char *, int, int));
341 + extern void cadillac_symbol_file PARAMS ((struct objfile *));
343 + /*extern void cadillac_query PARAMS ((char *, ...));*/
344 + extern void cadillac_query (); /* Prototypes for varargs don't work */
346 + extern char *cadillac_command_line_input PARAMS ((void));
348 + extern void cadillac_acknowledge_query PARAMS ((char *));
350 + extern void cadillac_fputs PARAMS ((const char *));
353 + extern void cadillac_condition_breakpoint PARAMS ((struct breakpoint *));
355 + extern void cadillac_commands_breakpoint PARAMS ((struct breakpoint *));
357 + extern void cadillac_ignore_breakpoint PARAMS ((struct breakpoint *));
359 + extern void cadillac_create_breakpoint PARAMS ((struct breakpoint *));
361 + extern void cadillac_delete_breakpoint PARAMS ((struct breakpoint *));
363 + extern void cadillac_enable_breakpoint PARAMS ((struct breakpoint *));
365 + extern void cadillac_disable_breakpoint PARAMS ((struct breakpoint *));
367 #endif /* !defined (DEFS_H) */
368 ===================================================================
369 RCS file: /local/cvsfiles/devo/gdb/inflow.c,v
370 retrieving revision 1.25
371 diff -c -r1.25 inflow.c
372 *** 1.25 1992/05/17 23:54:22
373 --- inflow.c 1992/06/15 23:02:32
376 static short pgrp_inferior;
377 static short pgrp_ours;
378 # else /* not def SHORT_PGRP */
379 ! static int pgrp_inferior;
380 static int pgrp_ours;
381 # endif /* not def SHORT_PGRP */
382 #else /* not def TIOCGPGRP */
384 static short pgrp_inferior;
385 static short pgrp_ours;
386 # else /* not def SHORT_PGRP */
388 static int pgrp_ours;
389 # endif /* not def SHORT_PGRP */
390 #else /* not def TIOCGPGRP */
391 ===================================================================
392 RCS file: /local/cvsfiles/devo/gdb/infrun.c,v
393 retrieving revision 1.49
394 diff -c -r1.49 infrun.c
395 *** 1.49 1992/06/23 00:24:50
396 --- infrun.c 1992/06/23 04:19:35
400 Here we must get it up to actual execution of the real program. */
402 inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
404 + cadillac_new_process();
406 clear_proceed_status ();
415 + cadillac_new_process();
416 push_target (&child_ops);
418 mark_breakpoints_out ();
419 ===================================================================
420 RCS file: /local/cvsfiles/devo/gdb/inftarg.c,v
421 retrieving revision 1.11
422 diff -c -r1.11 inftarg.c
423 *** 1.11 1992/03/29 23:21:27
424 --- inftarg.c 1992/06/15 23:56:08
428 pid = proc_wait (status);
430 ! pid = wait (status);
432 if (pid == -1) /* No more children to wait for */
436 pid = proc_wait (status);
439 ! pid = cadillac_wait (status);
441 ! pid = wait (status);
443 if (pid == -1) /* No more children to wait for */
445 ===================================================================
446 RCS file: /local/cvsfiles/devo/gdb/main.c,v
447 retrieving revision 1.47
448 diff -c -r1.47 main.c
449 *** 1.47 1992/06/09 06:09:23
450 --- main.c 1992/06/13 03:32:16
454 char *corearg = NULL;
457 + char *cadillac_id = NULL;
459 /* Pointers to all arguments of +command option. */
464 {"tty", required_argument, 0, 't'},
465 {"baud", required_argument, 0, 'b'},
466 {"b", required_argument, 0, 'b'},
467 + {"context", required_argument, 0, 12},
468 /* Allow machine descriptions to add more options... */
469 #ifdef ADDITIONAL_OPTIONS
478 + cadillac_id = optarg;
487 do_cleanups (ALL_CLEANUPS);
490 + cadillac_initialize (cadillac_id, execarg);
494 && strcmp (execarg, symarg) == 0)
498 if (!setjmp (to_top_level))
499 symbol_file_command (symarg, 0);
502 do_cleanups (ALL_CLEANUPS);
504 /* After the symbol file has been read, print a newline to get us
507 if (!setjmp (to_top_level))
509 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
511 quit_command ((char *)0, instream == stdin);
515 if (!setjmp (to_top_level))
517 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
519 ! cadillac_main_loop();
522 quit_command ((char *)0, instream == stdin);
527 else if (c->function.cfunc == NO_FUNCTION)
528 error ("That is not a command, just a help topic.");
530 ! (*c->function.cfunc) (arg, from_tty & caution);
533 /* Tell the user if the language has changed (except first time). */
535 else if (c->function.cfunc == NO_FUNCTION)
536 error ("That is not a command, just a help topic.");
539 ! cadillac_call_command (c, arg, from_tty & caution);
541 ! (*c->function.cfunc) (arg, from_tty & caution);
544 /* Tell the user if the language has changed (except first time). */
550 ! p = command_line_input ((char *) NULL, instream == stdin);
552 /* Treat end of file like "end". */
559 ! p = cadillac_command_line_input();
561 ! p = command_line_input ((char *) NULL, instream == stdin);
563 /* Treat end of file like "end". */
570 ! printf ("%s", prompt);
578 ! printf_filtered ("%s", prompt);
582 ===================================================================
583 RCS file: /local/cvsfiles/devo/gdb/mipsread.c,v
584 retrieving revision 1.71
585 diff -c -r1.71 mipsread.c
586 *** 1.71 1992/06/17 18:14:19
587 --- mipsread.c 1992/06/23 04:19:41
591 #include <sys/param.h>
592 #include <sys/file.h>
593 #include <sys/stat.h>
594 + #include <strings.h>
596 #include "coff/mips.h" /* COFF-like aspects of ecoff files */
597 #include "coff/ecoff-ext.h" /* External forms of ecoff sym structures */
598 ===================================================================
599 RCS file: /local/cvsfiles/devo/gdb/printcmd.c,v
600 retrieving revision 1.28
601 diff -c -r1.28 printcmd.c
602 *** 1.28 1992/06/13 18:20:41
603 --- printcmd.c 1992/06/14 22:11:35
608 int histindex = record_latest_value (val);
614 + sprintf(buf, "$%d", histindex);
615 + cadillac_start_variable_annotation(buf, NULL, VALUE_TYPE(val),
616 + VALUE_ADDRESS(val), "");
620 printf ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
625 if (histindex >= 0) printf_filtered ("$%d = ", histindex);
627 print_formatted (val, format, fmt.size);
629 + cadillac_end_variable_annotation();
630 printf_filtered ("\n");
636 standard indentation here is 4 spaces, and val_print indents
637 2 for each recurse. */
638 val = read_var_value (sym, FRAME_INFO_ID (fi));
641 + cadillac_start_variable_annotation(SYMBOL_NAME(sym), sym,
643 + VALUE_ADDRESS(val), "");
646 val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
647 stream, 0, 0, 2, Val_no_prettyprint);
649 fputs_filtered ("???", stream);
652 + cadillac_end_variable_annotation();
657 ===================================================================
658 RCS file: /local/cvsfiles/devo/gdb/stack.c,v
659 retrieving revision 1.30
660 diff -c -r1.30 stack.c
661 *** 1.30 1992/06/20 23:30:33
662 --- stack.c 1992/06/23 04:19:48
666 printf_filtered ("%s in ", local_hex_string(fi->pc));
668 ! fputs_demangled (fname, stdout, 0);
669 fputs_filtered (" (...)\n", stdout);
674 printf_filtered ("%s in ", local_hex_string(fi->pc));
677 ! cadillac_annotate_function(fname, 0, level);
679 ! fputs_demangled (fname, stdout, 0);
680 fputs_filtered (" (...)\n", stdout);
686 if (fi->pc != sal.pc || !sal.symtab)
687 printf_filtered ("%s in ", local_hex_string(fi->pc));
688 ! fputs_demangled (funname ? funname : "??", stdout, 0);
690 fputs_filtered (" (", stdout);
694 if (fi->pc != sal.pc || !sal.symtab)
695 printf_filtered ("%s in ", local_hex_string(fi->pc));
697 ! cadillac_annotate_function(funname ? funname : "??", 0, level);
699 ! fputs_demangled (funname ? funname : "??", stdout, 0);
701 fputs_filtered (" (", stdout);
706 if (addressprint && mid_statement)
707 printf_filtered ("%s\t", local_hex_string(fi->pc));
708 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
710 current_source_line = max (sal.line - lines_to_list/2, 1);
714 if (addressprint && mid_statement)
715 printf_filtered ("%s\t", local_hex_string(fi->pc));
717 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
719 current_source_line = max (sal.line - lines_to_list/2, 1);
725 printf_filtered (" in ");
726 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
733 printf_filtered (" in ");
735 ! cadillac_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS,
736 ! selected_frame_level);
738 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
742 ===================================================================
743 RCS file: /local/cvsfiles/devo/gdb/symfile.c,v
744 retrieving revision 1.53
745 diff -c -r1.53 symfile.c
746 *** 1.53 1992/06/13 16:20:12
747 --- symfile.c 1992/06/14 22:11:39
755 + cadillac_symbol_file(objfile);
760 ===================================================================
761 RCS file: /local/cvsfiles/devo/gdb/utils.c,v
762 retrieving revision 1.50
763 diff -c -r1.50 utils.c
764 *** 1.50 1992/06/15 14:27:07
765 --- utils.c 1992/06/16 01:24:28
770 char *error_pre_print;
771 char *warning_pre_print = "\nwarning: ";
774 /* Add a new cleanup to the cleanup_chain,
775 and return the previous chain pointer
780 /* Automatically answer "yes" if input is not from a terminal. */
781 ! if (!input_from_terminal_p ())
788 /* Automatically answer "yes" if input is not from a terminal. */
789 ! if (!input_from_terminal_p () && !cadillac)
797 ctlstr = va_arg (args, char *);
798 vfprintf_filtered (stdout, ctlstr, args);
800 printf_filtered ("(y or n) ");
802 ! answer = fgetc (stdin);
803 ! clearerr (stdin); /* in case of C-d */
804 ! if (answer == EOF) /* C-d */
806 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
809 ! ans2 = fgetc (stdin);
812 ! while (ans2 != EOF && ans2 != '\n');
819 ctlstr = va_arg (args, char *);
821 + cadillac_query (ctlstr, args);
822 vfprintf_filtered (stdout, ctlstr, args);
823 printf_filtered ("(y or n) ");
828 ! buf = cadillac_command_line_input();
829 ! answer = buf ? *buf : 'Y';
830 ! cadillac_acknowledge_query(buf);
835 ! answer = fgetc (stdin);
836 ! clearerr (stdin); /* in case of C-d */
837 ! if (answer == EOF) /* C-d */
839 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
842 ! ans2 = fgetc (stdin);
845 ! while (ans2 != EOF && ans2 != '\n');
855 printf_filtered ("Please answer y or n.\n");
868 + cadillac_fputs(linebuffer);
872 /* Don't do any filtering if it is disabled. */
874 || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
875 ===================================================================
876 RCS file: /local/cvsfiles/devo/gdb/valprint.c,v
877 retrieving revision 1.42
878 diff -c -r1.42 valprint.c
879 *** 1.42 1992/06/23 03:33:47
880 --- valprint.c 1992/06/23 04:19:55
884 struct type **dont_print;
886 int i, len, n_baseclasses;
887 + char expr_tag[100]; /* Cadillac */
889 check_stub_type (type);
894 fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
895 fputs_filtered (" = ", stream);
898 + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i));
901 + cadillac_start_variable_annotation(expr_tag, NULL,
902 + TYPE_FIELD_TYPE(type, i),
903 + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8),
905 if (TYPE_FIELD_PACKED (type, i))
911 valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
912 0, stream, format, 0, recurse + 1, pretty);
915 + cadillac_end_variable_annotation();
923 /* Number of repetitions we have detected so far. */
925 + char expr_tag[100]; /* Cadillac */
935 + sprintf(expr_tag, "[%d]", i);
937 + cadillac_start_variable_annotation(expr_tag, NULL,
939 + (CORE_ADDR) (valaddr + i * eltlen),
941 if (reps > REPEAT_COUNT_THRESHOLD)
943 val_print (elttype, valaddr + i * eltlen,
947 recurse + 1, pretty);
951 + cadillac_end_variable_annotation();
954 fprintf_filtered (stream, "...");
955 ===================================================================
956 RCS file: /local/cvsfiles/devo/gdb/config/ncr3000.mh,v
957 retrieving revision 1.4
958 diff -c -r1.4 config/ncr3000.mh
959 *** 1.4 1992/06/15 19:25:13
960 --- ncr3000.mh 1992/06/16 01:28:40
964 # The /usr/ucb/install program is incompatible (complains about unknown
965 # group staff). Use good old cp...
968 + # These are the libs that are needed for the Cadillac version of gdb on
969 + # SVR4. Note that we MUST include the standard C library before libucb.a,
970 + # otherwise we get lots of broken stuff we don't want.
971 + CADILLAC_LIBS = ${srcdir}/deblib/connection/libconn.a -L/usr/lib -lm -lnet \
972 + -lresolv -lform -lsocket -lc /usr/ucblib/libucb.a -lnsl