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 diff -rc Makefile.in.orig Makefile.in
5 *** Makefile.in.orig Tue Jun 23 08:59:44 1992
6 --- Makefile.in Tue Jun 23 12:00:54 1992
9 # demangling. For other demangling styles, such as the Annotated C++
10 # Reference Manual (section 7.2.1c) style, set this define in the target-
11 # dependent makefile fragment.
14 # Host and target-dependent makefile fragments come in here.
17 # demangling. For other demangling styles, such as the Annotated C++
18 # Reference Manual (section 7.2.1c) style, set this define in the target-
19 # dependent makefile fragment.
21 ! # For Energize, default to using style specified in the Annotated C++
22 ! # Reference Manual, section 7.2.1c, which is what is used by the Lucid C++
23 ! # compiler for most things. But there are places where Lucid varies from
24 ! # the ARM, so select the Lucid specific code also.
25 ! DEMANGLE_OPTS=-DARM_DEMANGLING -DLUCID_DEMANGLING
27 # Host and target-dependent makefile fragments come in here.
29 ===================================================================
30 RCS file: /local/cvsfiles/devo/gdb/.Sanitize,v
31 retrieving revision 2.55
32 diff -c -r2.55 .Sanitize
33 *** 2.55 1992/06/23 05:03:32
34 --- .Sanitize 1992/06/23 05:03:51
55 ===================================================================
56 RCS file: /local/cvsfiles/devo/gdb/Makefile.in,v
57 retrieving revision 1.158
58 diff -c -r1.158 Makefile.in
59 *** 1.158 1992/06/19 22:39:40
60 --- Makefile.in 1992/06/23 04:22:01
64 READLINE_DEP = $$(READLINE_DIR)
65 RL_LIB = ./../readline${subdir}/libreadline.a
67 + # Cadillac libraries
68 + CADILLAC_DIR = ${srcdir}/deblib
69 + CADILLAC_INCLUDES = -I${CADILLAC_DIR}/connection -I${CADILLAC_DIR}/debugger
70 + CADILLAC_LIBS = ${srcdir}/deblib/connection/libconn.a
72 # All the includes used for CFLAGS and for lint.
73 # -I. for config files.
74 # -I${srcdir} possibly for regex.h also.
77 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
78 # TERMCAP comes after readline, since readline depends on it.
79 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
80 ! ${XM_CLIBS} ${TM_CLIBS}
81 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
82 ${RL_LIB} ${MMALLOC_LIB}
85 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
86 # TERMCAP comes after readline, since readline depends on it.
87 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
88 ! ${XM_CLIBS} ${TM_CLIBS} ${CADILLAC_LIBS}
89 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
90 ${RL_LIB} ${MMALLOC_LIB}
94 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
95 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
96 ieee-float.c language.c parse.c buildsym.c objfiles.c \
97 ! minsyms.c mipsread.c
99 # Source files in subdirectories (which will be handled separately by
102 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
103 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
104 ieee-float.c language.c parse.c buildsym.c objfiles.c \
105 ! minsyms.c mipsread.c cadillac.c
107 # Source files in subdirectories (which will be handled separately by
111 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
112 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
113 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
114 ! buildsym.o objfiles.o minsyms.o \
115 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
117 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
119 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
120 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
121 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
122 ! buildsym.o objfiles.o minsyms.o cadillac.o \
123 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
125 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
130 ttyflush.o: ${srcdir}/nindy-share/ttyflush.c
131 ${CC} -c ${INTERNAL_CFLAGS} ${srcdir}/nindy-share/ttyflush.c
133 + cadillac.o: ${srcdir}/cadillac.c
134 + ${CC} -c ${INTERNAL_CFLAGS} ${CADILLAC_INCLUDES} ${srcdir}/cadillac.c
137 $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
138 ===================================================================
139 RCS file: /local/cvsfiles/devo/gdb/breakpoint.c,v
140 retrieving revision 1.36
141 diff -c -r1.36 breakpoint.c
142 *** 1.36 1992/06/17 21:53:28
143 --- breakpoint.c 1992/06/23 04:19:21
147 b->cond_string = NULL;
149 printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
151 + cadillac_condition_breakpoint(b);
158 typed in or the decompiled expression. */
159 b->cond_string = savestring (arg, strlen (arg));
160 b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
162 + cadillac_condition_breakpoint(b);
164 error ("Junk at end of expression");
169 if (b->number == bnum)
171 ! if (from_tty && input_from_terminal_p ())
173 ! printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
174 End with a line saying just \"end\".\n", bnum);
177 l = read_command_lines ();
178 free_command_lines (&b->commands);
182 error ("No breakpoint number %d.", bnum);
185 if (b->number == bnum)
187 ! if ((from_tty && input_from_terminal_p ()) || cadillac)
188 ! printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
189 End with a line saying just \"end\".\n", bnum);
190 l = read_command_lines ();
191 free_command_lines (&b->commands);
194 + cadillac_commands_breakpoint(b);
197 error ("No breakpoint number %d.", bnum);
205 + cadillac_ignore_breakpoint(b);
213 struct breakpoint *b;
216 + cadillac_create_breakpoint(b);
224 register struct breakpoint *b;
228 + cadillac_delete_breakpoint(bpt);
231 target_remove_breakpoint(bpt->address, bpt->shadow_contents);
236 if (b->number == bptnum)
238 b->ignore_count = count;
240 + cadillac_ignore_breakpoint(b);
246 struct breakpoint *b;
249 ! b->ignore_count = 0;
252 /* Command to set ignore-count of breakpoint N to COUNT. */
254 struct breakpoint *b;
258 ! b->ignore_count = 0;
260 ! cadillac_ignore_breakpoint(b);
264 /* Command to set ignore-count of breakpoint N to COUNT. */
269 bpt->enable = enabled;
272 + cadillac_enable_breakpoint(bpt);
274 if (xgdb_verbose && bpt->type == bp_breakpoint)
275 printf ("breakpoint #%d enabled\n", bpt->number);
280 disable_breakpoint (bpt)
281 struct breakpoint *bpt;
284 + cadillac_disable_breakpoint(bpt);
286 bpt->enable = disabled;
288 if (xgdb_verbose && bpt->type == bp_breakpoint)
289 ===================================================================
290 RCS file: /local/cvsfiles/devo/gdb/command.c,v
291 retrieving revision 1.15
292 diff -c -r1.15 command.c
293 *** 1.15 1992/06/23 03:33:41
294 --- command.c 1992/06/23 04:19:26
300 ! while ((rc = wait (&status)) != pid && rc != -1)
303 error ("Fork failed");
308 ! while ((rc = cadillac ? cadillac_wait(&status) : wait (&status)) != pid && rc != -1)
311 error ("Fork failed");
312 ===================================================================
313 RCS file: /local/cvsfiles/devo/gdb/defs.h,v
314 retrieving revision 1.36
315 diff -c -r1.36 defs.h
316 *** 1.36 1992/06/15 14:26:55
317 --- defs.h 1992/06/16 01:24:19
324 + /* Energize/Cadillac stuff */
326 + /* Non-zero means that we're doing the cadillac interface. */
327 + extern int cadillac;
329 + /* Get a pty for use with cadillac */
330 + extern char *cadillac_getpty PARAMS ((void));
332 + /* Notify cadillac of new process creation */
333 + extern void cadillac_new_process PARAMS ((void));
335 + /* Low level wait routine for wait_for_inferior */
336 + extern int cadillac_wait PARAMS ((int *));
339 + extern void cadillac_initialize PARAMS ((char *, char *));
341 + /* Main loop for cadillac protocol driver */
342 + extern void cadillac_main_loop PARAMS ((void));
344 + struct cmd_list_element;
346 + /* Command hook for cadillac */
347 + extern void cadillac_call_command PARAMS ((struct cmd_list_element *,
350 + /* Read commands for the command command, and others */
351 + extern char *cadillac_command_line_input PARAMS ((void));
356 + extern void cadillac_start_variable_annotation PARAMS ((char *,
362 + extern void cadillac_end_variable_annotation PARAMS ((void));
364 + extern void cadillac_annotate_function PARAMS ((char *, int, int));
367 + extern void cadillac_symbol_file PARAMS ((struct objfile *));
369 + /*extern void cadillac_query PARAMS ((char *, ...));*/
370 + extern void cadillac_query (); /* Prototypes for varargs don't work */
372 + extern char *cadillac_command_line_input PARAMS ((void));
374 + extern void cadillac_acknowledge_query PARAMS ((char *));
376 + extern void cadillac_fputs PARAMS ((const char *));
379 + extern void cadillac_condition_breakpoint PARAMS ((struct breakpoint *));
381 + extern void cadillac_commands_breakpoint PARAMS ((struct breakpoint *));
383 + extern void cadillac_ignore_breakpoint PARAMS ((struct breakpoint *));
385 + extern void cadillac_create_breakpoint PARAMS ((struct breakpoint *));
387 + extern void cadillac_delete_breakpoint PARAMS ((struct breakpoint *));
389 + extern void cadillac_enable_breakpoint PARAMS ((struct breakpoint *));
391 + extern void cadillac_disable_breakpoint PARAMS ((struct breakpoint *));
393 #endif /* !defined (DEFS_H) */
394 ===================================================================
395 RCS file: /local/cvsfiles/devo/gdb/inflow.c,v
396 retrieving revision 1.25
397 diff -c -r1.25 inflow.c
398 *** 1.25 1992/05/17 23:54:22
399 --- inflow.c 1992/06/15 23:02:32
402 static short pgrp_inferior;
403 static short pgrp_ours;
404 # else /* not def SHORT_PGRP */
405 ! static int pgrp_inferior;
406 static int pgrp_ours;
407 # endif /* not def SHORT_PGRP */
408 #else /* not def TIOCGPGRP */
410 static short pgrp_inferior;
411 static short pgrp_ours;
412 # else /* not def SHORT_PGRP */
414 static int pgrp_ours;
415 # endif /* not def SHORT_PGRP */
416 #else /* not def TIOCGPGRP */
417 ===================================================================
418 RCS file: /local/cvsfiles/devo/gdb/infrun.c,v
419 retrieving revision 1.49
420 diff -c -r1.49 infrun.c
421 *** 1.49 1992/06/23 00:24:50
422 --- infrun.c 1992/06/23 04:19:35
426 Here we must get it up to actual execution of the real program. */
428 inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
430 + cadillac_new_process();
432 clear_proceed_status ();
441 + cadillac_new_process();
442 push_target (&child_ops);
444 mark_breakpoints_out ();
445 ===================================================================
446 RCS file: /local/cvsfiles/devo/gdb/inftarg.c,v
447 retrieving revision 1.11
448 diff -c -r1.11 inftarg.c
449 *** 1.11 1992/03/29 23:21:27
450 --- inftarg.c 1992/06/15 23:56:08
454 pid = proc_wait (status);
456 ! pid = wait (status);
458 if (pid == -1) /* No more children to wait for */
462 pid = proc_wait (status);
465 ! pid = cadillac_wait (status);
467 ! pid = wait (status);
469 if (pid == -1) /* No more children to wait for */
471 ===================================================================
472 RCS file: /local/cvsfiles/devo/gdb/main.c,v
473 retrieving revision 1.47
474 diff -c -r1.47 main.c
475 *** 1.47 1992/06/09 06:09:23
476 --- main.c 1992/06/13 03:32:16
480 char *corearg = NULL;
483 + char *cadillac_id = NULL;
485 /* Pointers to all arguments of +command option. */
490 {"tty", required_argument, 0, 't'},
491 {"baud", required_argument, 0, 'b'},
492 {"b", required_argument, 0, 'b'},
493 + {"context", required_argument, 0, 12},
494 /* Allow machine descriptions to add more options... */
495 #ifdef ADDITIONAL_OPTIONS
504 + cadillac_id = optarg;
513 do_cleanups (ALL_CLEANUPS);
516 + cadillac_initialize (cadillac_id, execarg);
520 && strcmp (execarg, symarg) == 0)
524 if (!setjmp (to_top_level))
525 symbol_file_command (symarg, 0);
528 do_cleanups (ALL_CLEANUPS);
530 /* After the symbol file has been read, print a newline to get us
533 if (!setjmp (to_top_level))
535 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
537 quit_command ((char *)0, instream == stdin);
541 if (!setjmp (to_top_level))
543 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
545 ! cadillac_main_loop();
548 quit_command ((char *)0, instream == stdin);
553 else if (c->function.cfunc == NO_FUNCTION)
554 error ("That is not a command, just a help topic.");
556 ! (*c->function.cfunc) (arg, from_tty & caution);
559 /* Tell the user if the language has changed (except first time). */
561 else if (c->function.cfunc == NO_FUNCTION)
562 error ("That is not a command, just a help topic.");
565 ! cadillac_call_command (c, arg, from_tty & caution);
567 ! (*c->function.cfunc) (arg, from_tty & caution);
570 /* Tell the user if the language has changed (except first time). */
576 ! p = command_line_input ((char *) NULL, instream == stdin);
578 /* Treat end of file like "end". */
585 ! p = cadillac_command_line_input();
587 ! p = command_line_input ((char *) NULL, instream == stdin);
589 /* Treat end of file like "end". */
596 ! printf ("%s", prompt);
604 ! printf_filtered ("%s", prompt);
608 ===================================================================
609 RCS file: /local/cvsfiles/devo/gdb/printcmd.c,v
610 retrieving revision 1.28
611 diff -c -r1.28 printcmd.c
612 *** 1.28 1992/06/13 18:20:41
613 --- printcmd.c 1992/06/14 22:11:35
618 int histindex = record_latest_value (val);
624 + sprintf(buf, "$%d", histindex);
625 + cadillac_start_variable_annotation(buf, NULL, VALUE_TYPE(val),
626 + VALUE_ADDRESS(val), "");
630 printf ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
635 if (histindex >= 0) printf_filtered ("$%d = ", histindex);
637 print_formatted (val, format, fmt.size);
639 + cadillac_end_variable_annotation();
640 printf_filtered ("\n");
646 standard indentation here is 4 spaces, and val_print indents
647 2 for each recurse. */
648 val = read_var_value (sym, FRAME_INFO_ID (fi));
651 + cadillac_start_variable_annotation(SYMBOL_NAME(sym), sym,
653 + VALUE_ADDRESS(val), "");
656 val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
657 stream, 0, 0, 2, Val_no_prettyprint);
659 fputs_filtered ("???", stream);
662 + cadillac_end_variable_annotation();
667 ===================================================================
668 RCS file: /local/cvsfiles/devo/gdb/stack.c,v
669 retrieving revision 1.30
670 diff -c -r1.30 stack.c
671 *** 1.30 1992/06/20 23:30:33
672 --- stack.c 1992/06/23 04:19:48
676 printf_filtered ("%s in ", local_hex_string(fi->pc));
678 ! fputs_demangled (fname, stdout, 0);
679 fputs_filtered (" (...)\n", stdout);
684 printf_filtered ("%s in ", local_hex_string(fi->pc));
687 ! cadillac_annotate_function(fname, 0, level);
689 ! fputs_demangled (fname, stdout, 0);
690 fputs_filtered (" (...)\n", stdout);
696 if (fi->pc != sal.pc || !sal.symtab)
697 printf_filtered ("%s in ", local_hex_string(fi->pc));
698 ! fputs_demangled (funname ? funname : "??", stdout, 0);
700 fputs_filtered (" (", stdout);
704 if (fi->pc != sal.pc || !sal.symtab)
705 printf_filtered ("%s in ", local_hex_string(fi->pc));
707 ! cadillac_annotate_function(funname ? funname : "??", 0, level);
709 ! fputs_demangled (funname ? funname : "??", stdout, 0);
711 fputs_filtered (" (", stdout);
716 if (addressprint && mid_statement)
717 printf_filtered ("%s\t", local_hex_string(fi->pc));
718 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
720 current_source_line = max (sal.line - lines_to_list/2, 1);
724 if (addressprint && mid_statement)
725 printf_filtered ("%s\t", local_hex_string(fi->pc));
727 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
729 current_source_line = max (sal.line - lines_to_list/2, 1);
735 printf_filtered (" in ");
736 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
743 printf_filtered (" in ");
745 ! cadillac_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS,
746 ! selected_frame_level);
748 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
752 ===================================================================
753 RCS file: /local/cvsfiles/devo/gdb/symfile.c,v
754 retrieving revision 1.53
755 diff -c -r1.53 symfile.c
756 *** 1.53 1992/06/13 16:20:12
757 --- symfile.c 1992/06/14 22:11:39
765 + cadillac_symbol_file(objfile);
770 ===================================================================
771 RCS file: /local/cvsfiles/devo/gdb/utils.c,v
772 retrieving revision 1.50
773 diff -c -r1.50 utils.c
774 *** 1.50 1992/06/15 14:27:07
775 --- utils.c 1992/06/16 01:24:28
780 char *error_pre_print;
781 char *warning_pre_print = "\nwarning: ";
784 /* Add a new cleanup to the cleanup_chain,
785 and return the previous chain pointer
790 /* Automatically answer "yes" if input is not from a terminal. */
791 ! if (!input_from_terminal_p ())
798 /* Automatically answer "yes" if input is not from a terminal. */
799 ! if (!input_from_terminal_p () && !cadillac)
807 ctlstr = va_arg (args, char *);
808 vfprintf_filtered (stdout, ctlstr, args);
810 printf_filtered ("(y or n) ");
812 ! answer = fgetc (stdin);
813 ! clearerr (stdin); /* in case of C-d */
814 ! if (answer == EOF) /* C-d */
816 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
819 ! ans2 = fgetc (stdin);
822 ! while (ans2 != EOF && ans2 != '\n');
829 ctlstr = va_arg (args, char *);
831 + cadillac_query (ctlstr, args);
832 vfprintf_filtered (stdout, ctlstr, args);
833 printf_filtered ("(y or n) ");
838 ! buf = cadillac_command_line_input();
839 ! answer = buf ? *buf : 'Y';
840 ! cadillac_acknowledge_query(buf);
845 ! answer = fgetc (stdin);
846 ! clearerr (stdin); /* in case of C-d */
847 ! if (answer == EOF) /* C-d */
849 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
852 ! ans2 = fgetc (stdin);
855 ! while (ans2 != EOF && ans2 != '\n');
865 printf_filtered ("Please answer y or n.\n");
878 + cadillac_fputs(linebuffer);
882 /* Don't do any filtering if it is disabled. */
884 || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
885 ===================================================================
886 RCS file: /local/cvsfiles/devo/gdb/valprint.c,v
887 retrieving revision 1.42
888 diff -c -r1.42 valprint.c
889 *** 1.42 1992/06/23 03:33:47
890 --- valprint.c 1992/06/23 04:19:55
894 struct type **dont_print;
896 int i, len, n_baseclasses;
897 + char expr_tag[100]; /* Cadillac */
899 check_stub_type (type);
904 fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
905 fputs_filtered (" = ", stream);
908 + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i));
911 + cadillac_start_variable_annotation(expr_tag, NULL,
912 + TYPE_FIELD_TYPE(type, i),
913 + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8),
915 if (TYPE_FIELD_PACKED (type, i))
921 valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
922 0, stream, format, 0, recurse + 1, pretty);
925 + cadillac_end_variable_annotation();
933 /* Number of repetitions we have detected so far. */
935 + char expr_tag[100]; /* Cadillac */
945 + sprintf(expr_tag, "[%d]", i);
947 + cadillac_start_variable_annotation(expr_tag, NULL,
949 + (CORE_ADDR) (valaddr + i * eltlen),
951 if (reps > REPEAT_COUNT_THRESHOLD)
953 val_print (elttype, valaddr + i * eltlen,
957 recurse + 1, pretty);
961 + cadillac_end_variable_annotation();
964 fprintf_filtered (stream, "...");
965 ===================================================================
966 RCS file: /local/cvsfiles/devo/gdb/config/ncr3000.mh,v
967 retrieving revision 1.4
968 diff -c -r1.4 config/ncr3000.mh
969 *** 1.4 1992/06/15 19:25:13
970 --- config/ncr3000.mh 1992/06/16 01:28:40
974 # The /usr/ucb/install program is incompatible (complains about unknown
975 # group staff). Use good old cp...
978 + # These are the libs that are needed for the Cadillac version of gdb on
979 + # SVR4. Note that we MUST include the standard C library before libucb.a,
980 + # otherwise we get lots of broken stuff we don't want.
981 + CADILLAC_LIBS = ${srcdir}/deblib/connection/libconn.a -L/usr/lib -lm -lnet \
982 + -lresolv -lform -lsocket -lc /usr/ucblib/libucb.a -lnsl