1 # Apply these patches to GDB to produce an Energize GDB.
2 # To apply these patches, first cd to gdb-XX/gdb, run "patch -p0 <thisfile",
5 ===================================================================
6 RCS file: /local/cvsfiles/devo/gdb/.Sanitize,v
7 retrieving revision 2.56
8 diff -c -r2.56 .Sanitize
9 *** 2.56 1992/06/23 06:26:00
10 --- .Sanitize 1992/07/05 18:39:47
23 ===================================================================
24 RCS file: /local/cvsfiles/devo/gdb/Makefile.in,v
25 retrieving revision 1.162
26 diff -c -r1.162 Makefile.in
27 *** 1.162 1992/07/05 17:21:11
28 --- Makefile.in 1992/07/05 18:46:03
32 READLINE_DEP = $$(READLINE_DIR)
33 RL_LIB = ./../readline${subdir}/libreadline.a
35 + # Energize libraries
36 + ENERGIZE_DIR = ${srcdir}/energize
37 + ENERGIZE_INCLUDES = -I${ENERGIZE_DIR}
38 + ENERGIZE_LIB = ${ENERGIZE_DIR}/libconn.a
40 # All the includes used for CFLAGS and for lint.
41 # -I. for config files.
42 # -I${srcdir} possibly for regex.h also.
45 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
46 # TERMCAP comes after readline, since readline depends on it.
47 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
48 ! ${XM_CLIBS} ${TM_CLIBS}
49 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
50 ${RL_LIB} ${MMALLOC_LIB}
52 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
53 ! ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES}
58 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
59 # TERMCAP comes after readline, since readline depends on it.
60 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
61 ! ${XM_CLIBS} ${TM_CLIBS} ${ENERGIZE_LIB}
62 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
63 ${RL_LIB} ${MMALLOC_LIB}
65 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
66 ! ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES} \
73 # selection of the style unless you do an explicit "set demangle auto".
74 # To select one of these as the default, set DEMANGLING_STYLE in the
75 # appropriate target dependent makefile fragment.
76 ! DEMANGLING_STYLE = "gnu"
78 # Select demangler to use.
81 # selection of the style unless you do an explicit "set demangle auto".
82 # To select one of these as the default, set DEMANGLING_STYLE in the
83 # appropriate target dependent makefile fragment.
84 ! DEMANGLING_STYLE = "lucid"
86 # Select demangler to use.
90 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
91 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
92 ieee-float.c language.c parse.c buildsym.c objfiles.c \
93 ! minsyms.c mipsread.c maint.c
95 # Source files in subdirectories (which will be handled separately by
98 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
99 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
100 ieee-float.c language.c parse.c buildsym.c objfiles.c \
101 ! minsyms.c mipsread.c maint.c energize.c
103 # Source files in subdirectories (which will be handled separately by
107 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
108 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
109 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
110 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o \
111 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
113 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
115 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
116 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
117 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
118 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o energize.o \
119 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
121 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
125 NTSSTART = kdb-start.o
129 # For now, shortcut the "configure GDB for fewer languages" stuff.
130 YYFILES = c-exp.tab.c m2-exp.tab.c
133 NTSSTART = kdb-start.o
135 ! SUBDIRS = doc ${ENERGIZE_DIR}
137 # For now, shortcut the "configure GDB for fewer languages" stuff.
138 YYFILES = c-exp.tab.c m2-exp.tab.c
142 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
143 echo "Load .c corresponding to:" $(DEPFILES)
146 + @(cd ${ENERGIZE_DIR}; \
148 + "against=$(against)" \
150 + "AR_FLAGS=$(AR_FLAGS)" \
152 + "CFLAGS=$(CFLAGS)" \
153 + "RANLIB=$(RANLIB)" \
154 + "MAKEINFO=$(MAKEINFO)" \
155 + "INSTALL=$(INSTALL)" \
156 + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
157 + "INSTALL_DATA=$(INSTALL_DATA)" \
160 # This is useful when debugging GDB, because some Unix's don't let you run GDB
161 # on itself without copying the executable. So "make gdb1" will make
166 ttyflush.o: ${srcdir}/nindy-share/ttyflush.c
167 ${CC} -c ${INTERNAL_CFLAGS} ${srcdir}/nindy-share/ttyflush.c
169 + energize.o: ${srcdir}/energize.c
170 + ${CC} -c ${INTERNAL_CFLAGS} ${ENERGIZE_INCLUDES} ${srcdir}/energize.c
173 $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
174 ===================================================================
175 RCS file: /local/cvsfiles/devo/gdb/breakpoint.c,v
176 retrieving revision 1.38
177 diff -c -r1.38 breakpoint.c
178 *** 1.38 1992/07/04 03:20:43
179 --- breakpoint.c 1992/07/05 13:37:46
183 b->cond_string = NULL;
185 printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
186 + energize_condition_breakpoint(b);
193 typed in or the decompiled expression. */
194 b->cond_string = savestring (arg, strlen (arg));
195 b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
196 + energize_condition_breakpoint(b);
198 error ("Junk at end of expression");
203 if (b->number == bnum)
205 ! if (from_tty && input_from_terminal_p ())
207 ! printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
208 End with a line saying just \"end\".\n", bnum);
211 l = read_command_lines ();
212 free_command_lines (&b->commands);
216 error ("No breakpoint number %d.", bnum);
219 if (b->number == bnum)
221 ! if ((from_tty && input_from_terminal_p ()) || energize)
222 ! printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
223 End with a line saying just \"end\".\n", bnum);
224 l = read_command_lines ();
225 free_command_lines (&b->commands);
227 + energize_commands_breakpoint(b);
230 error ("No breakpoint number %d.", bnum);
237 + energize_ignore_breakpoint(b);
245 struct breakpoint *b;
247 + energize_create_breakpoint(b);
255 register struct breakpoint *b;
258 + energize_delete_breakpoint(bpt);
261 target_remove_breakpoint(bpt->address, bpt->shadow_contents);
266 if (b->number == bptnum)
268 b->ignore_count = count;
269 + energize_ignore_breakpoint(b);
275 struct breakpoint *b;
278 ! b->ignore_count = 0;
281 /* Command to set ignore-count of breakpoint N to COUNT. */
283 struct breakpoint *b;
287 ! b->ignore_count = 0;
288 ! energize_ignore_breakpoint(b);
292 /* Command to set ignore-count of breakpoint N to COUNT. */
297 bpt->enable = enabled;
299 + energize_enable_breakpoint(bpt);
301 if (xgdb_verbose && bpt->type == bp_breakpoint)
302 printf ("breakpoint #%d enabled\n", bpt->number);
307 disable_breakpoint (bpt)
308 struct breakpoint *bpt;
310 + energize_disable_breakpoint(bpt);
312 bpt->enable = disabled;
314 if (xgdb_verbose && bpt->type == bp_breakpoint)
315 ===================================================================
316 RCS file: /local/cvsfiles/devo/gdb/command.c,v
317 retrieving revision 1.17
318 diff -c -r1.17 command.c
319 *** 1.17 1992/07/04 03:20:54
320 --- command.c 1992/07/05 13:41:51
326 ! while ((rc = wait (&status)) != pid && rc != -1)
329 error ("Fork failed");
334 ! while ((rc = energize_wait (&status)) != pid && rc != -1)
337 error ("Fork failed");
338 ===================================================================
339 RCS file: /local/cvsfiles/devo/gdb/configure.in,v
340 retrieving revision 1.50
341 diff -c -r1.50 configure.in
342 *** 1.50 1992/06/23 00:25:00
343 --- configure.in 1992/07/05 17:50:08
349 target_dependent=true
351 ! configdirs="energize doc"
354 target_dependent=true
355 ===================================================================
356 RCS file: /local/cvsfiles/devo/gdb/defs.h,v
357 retrieving revision 1.41
358 diff -c -r1.41 defs.h
359 *** 1.41 1992/06/30 08:53:18
360 --- defs.h 1992/07/05 13:24:31
367 + #include "energize.h"
369 #endif /* !defined (DEFS_H) */
370 ===================================================================
371 RCS file: /local/cvsfiles/devo/gdb/inflow.c,v
372 retrieving revision 1.27
373 diff -c -r1.27 inflow.c
374 *** 1.27 1992/07/04 03:21:21
375 --- inflow.c 1992/07/05 12:58:31
378 static short pgrp_inferior;
379 static short pgrp_ours;
380 # else /* not def SHORT_PGRP */
381 ! static int pgrp_inferior;
382 static int pgrp_ours;
383 # endif /* not def SHORT_PGRP */
384 #else /* not def TIOCGPGRP */
386 static short pgrp_inferior;
387 static short pgrp_ours;
388 # else /* not def SHORT_PGRP */
390 static int pgrp_ours;
391 # endif /* not def SHORT_PGRP */
392 #else /* not def TIOCGPGRP */
393 ===================================================================
394 RCS file: /local/cvsfiles/devo/gdb/infrun.c,v
395 retrieving revision 1.52
396 diff -c -r1.52 infrun.c
397 *** 1.52 1992/07/04 03:21:24
398 --- infrun.c 1992/07/05 13:46:46
402 Here we must get it up to actual execution of the real program. */
404 inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
405 + energize_new_process();
407 clear_proceed_status ();
415 + energize_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/07/05 13:48:05
428 pid = proc_wait (status);
430 ! pid = wait (status);
432 if (pid == -1) /* No more children to wait for */
436 pid = proc_wait (status);
438 ! pid = energize_wait (status);
440 if (pid == -1) /* No more children to wait for */
442 ===================================================================
443 RCS file: /local/cvsfiles/devo/gdb/main.c,v
444 retrieving revision 1.49
445 diff -c -r1.49 main.c
446 *** 1.49 1992/07/04 12:20:57
447 --- main.c 1992/07/05 14:08:32
451 char *corearg = NULL;
454 + char *energize_id = NULL;
456 /* Pointers to all arguments of +command option. */
461 {"tty", required_argument, 0, 't'},
462 {"baud", required_argument, 0, 'b'},
463 {"b", required_argument, 0, 'b'},
464 + {"context", required_argument, 0, 12},
465 /* Allow machine descriptions to add more options... */
466 #ifdef ADDITIONAL_OPTIONS
475 + energize_id = optarg;
484 do_cleanups (ALL_CLEANUPS);
486 + energize_initialize (energize_id, execarg);
490 && strcmp (execarg, symarg) == 0)
493 if (!setjmp (to_top_level))
495 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
497 quit_command ((char *)0, instream == stdin);
501 if (!setjmp (to_top_level))
503 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
505 ! energize_main_loop();
508 quit_command ((char *)0, instream == stdin);
513 else if (c->function.cfunc == NO_FUNCTION)
514 error ("That is not a command, just a help topic.");
516 ! (*c->function.cfunc) (arg, from_tty & caution);
519 /* Tell the user if the language has changed (except first time). */
521 else if (c->function.cfunc == NO_FUNCTION)
522 error ("That is not a command, just a help topic.");
524 ! energize_call_command (c, arg, from_tty & caution);
527 /* Tell the user if the language has changed (except first time). */
533 ! p = command_line_input ((char *) NULL, instream == stdin);
535 /* Treat end of file like "end". */
541 ! p = energize_command_line_input ((char *) NULL, instream == stdin);
543 /* Treat end of file like "end". */
550 ! printf ("%s", prompt);
558 ! printf_filtered ("%s", prompt);
562 ===================================================================
563 RCS file: /local/cvsfiles/devo/gdb/printcmd.c,v
564 retrieving revision 1.29
565 diff -c -r1.29 printcmd.c
566 *** 1.29 1992/06/25 10:58:47
567 --- printcmd.c 1992/07/05 14:09:25
572 int histindex = record_latest_value (val);
578 + sprintf(buf, "$%d", histindex);
579 + energize_start_variable_annotation(buf, NULL, VALUE_TYPE(val),
580 + VALUE_ADDRESS(val), "");
584 printf ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
589 if (histindex >= 0) printf_filtered ("$%d = ", histindex);
591 print_formatted (val, format, fmt.size);
592 + energize_end_variable_annotation();
593 printf_filtered ("\n");
599 standard indentation here is 4 spaces, and val_print indents
600 2 for each recurse. */
601 val = read_var_value (sym, FRAME_INFO_ID (fi));
603 + energize_start_variable_annotation(SYMBOL_NAME(sym), sym,
605 + VALUE_ADDRESS(val), "");
608 val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
609 stream, 0, 0, 2, Val_no_prettyprint);
611 fputs_filtered ("???", stream);
613 + energize_end_variable_annotation();
618 ===================================================================
619 RCS file: /local/cvsfiles/devo/gdb/stack.c,v
620 retrieving revision 1.33
621 diff -c -r1.33 stack.c
622 *** 1.33 1992/07/04 03:21:45
623 --- stack.c 1992/07/05 14:13:23
627 printf_filtered ("%s in ", local_hex_string(fi->pc));
629 ! fputs_demangled (fname, stdout, 0);
630 fputs_filtered (" (...)\n", stdout);
635 printf_filtered ("%s in ", local_hex_string(fi->pc));
638 ! energize_annotate_function(fname, 0, level);
640 ! fputs_demangled (fname, stdout, 0);
641 fputs_filtered (" (...)\n", stdout);
647 if (fi->pc != sal.pc || !sal.symtab)
648 printf_filtered ("%s in ", local_hex_string(fi->pc));
649 ! fputs_demangled (funname ? funname : "??", stdout, 0);
651 fputs_filtered (" (", stdout);
655 if (fi->pc != sal.pc || !sal.symtab)
656 printf_filtered ("%s in ", local_hex_string(fi->pc));
658 ! energize_annotate_function(funname ? funname : "??", 0, level);
660 ! fputs_demangled (funname ? funname : "??", stdout, 0);
662 fputs_filtered (" (", stdout);
667 if (addressprint && mid_statement)
668 printf_filtered ("%s\t", local_hex_string(fi->pc));
669 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
671 current_source_line = max (sal.line - lines_to_list/2, 1);
675 if (addressprint && mid_statement)
676 printf_filtered ("%s\t", local_hex_string(fi->pc));
678 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
680 current_source_line = max (sal.line - lines_to_list/2, 1);
686 printf_filtered (" in ");
687 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
694 printf_filtered (" in ");
696 ! energize_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS,
697 ! selected_frame_level);
699 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
703 ===================================================================
704 RCS file: /local/cvsfiles/devo/gdb/symfile.c,v
705 retrieving revision 1.55
706 diff -c -r1.55 symfile.c
707 *** 1.55 1992/07/04 13:58:46
708 --- symfile.c 1992/07/05 14:14:12
715 + energize_symbol_file(objfile);
720 ===================================================================
721 RCS file: /local/cvsfiles/devo/gdb/utils.c,v
722 retrieving revision 1.53
723 diff -c -r1.53 utils.c
724 *** 1.53 1992/07/04 03:21:59
725 --- utils.c 1992/07/05 17:32:13
730 /* Automatically answer "yes" if input is not from a terminal. */
731 ! if (!input_from_terminal_p ())
738 /* Automatically answer "yes" if input is not from a terminal. */
739 ! if (!input_from_terminal_p () && !energize)
747 ctlstr = va_arg (args, char *);
748 vfprintf_filtered (stdout, ctlstr, args);
750 printf_filtered ("(y or n) ");
752 ! answer = fgetc (stdin);
753 ! clearerr (stdin); /* in case of C-d */
754 ! if (answer == EOF) /* C-d */
756 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
759 ! ans2 = fgetc (stdin);
762 ! while (ans2 != EOF && ans2 != '\n');
769 ctlstr = va_arg (args, char *);
770 + energize_query (ctlstr, args);
771 vfprintf_filtered (stdout, ctlstr, args);
772 printf_filtered ("(y or n) ");
777 ! buf = energize_command_line_input(0, 0);
778 ! answer = buf ? *buf : 'Y';
779 ! energize_acknowledge_query(buf);
784 ! answer = fgetc (stdin);
785 ! clearerr (stdin); /* in case of C-d */
786 ! if (answer == EOF) /* C-d */
788 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
791 ! ans2 = fgetc (stdin);
794 ! while (ans2 != EOF && ans2 != '\n');
804 printf_filtered ("Please answer y or n.\n");
817 + energize_fputs(linebuffer);
821 /* Don't do any filtering if it is disabled. */
823 || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
824 ===================================================================
825 RCS file: /local/cvsfiles/devo/gdb/valprint.c,v
826 retrieving revision 1.45
827 diff -c -r1.45 valprint.c
828 *** 1.45 1992/07/04 03:22:04
829 --- valprint.c 1992/07/05 14:19:51
833 struct type **dont_print;
835 int i, len, n_baseclasses;
836 + char expr_tag[100]; /* Energize */
838 check_stub_type (type);
843 fprint_symbol (stream, TYPE_FIELD_NAME (type, i));
844 fputs_filtered (" = ", stream);
847 + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i));
849 + energize_start_variable_annotation(expr_tag, NULL,
850 + TYPE_FIELD_TYPE(type, i),
851 + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8),
853 if (TYPE_FIELD_PACKED (type, i))
859 valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
860 0, stream, format, 0, recurse + 1, pretty);
862 + energize_end_variable_annotation();
870 /* Number of repetitions we have detected so far. */
872 + char expr_tag[100]; /* Energize */
882 + sprintf(expr_tag, "[%d]", i);
883 + energize_start_variable_annotation(expr_tag, NULL,
885 + (CORE_ADDR) (valaddr + i * eltlen),
887 if (reps > REPEAT_COUNT_THRESHOLD)
889 val_print (elttype, valaddr + i * eltlen,
893 recurse + 1, pretty);
896 + energize_end_variable_annotation();
899 fprintf_filtered (stream, "...");
900 ===================================================================
901 RCS file: /local/cvsfiles/devo/gdb/config/amix.mh,v
902 retrieving revision 1.4
903 diff -c -r1.4 amix.mh
904 *** 1.4 1992/06/10 02:05:16
905 --- config/amix.mh 1992/07/05 17:47:19
910 # SVR4 puts the BSD compatible install in /usr/ucb.
911 INSTALL = /usr/ucb/install -c
913 + # These are the libs that are needed for the Energize version of gdb on
914 + # SVR4. Note that we MUST include the standard C library before libucb.a,
915 + # otherwise we get lots of broken stuff we don't want.
916 + ENERGIZE_LIB = energize/libconn.a
917 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
918 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
919 ===================================================================
920 RCS file: /local/cvsfiles/devo/gdb/config/ncr3000.mh,v
921 retrieving revision 1.4
922 diff -c -r1.4 ncr3000.mh
923 *** 1.4 1992/06/15 19:25:13
924 --- config/ncr3000.mh 1992/07/05 17:49:34
928 # The /usr/ucb/install program is incompatible (complains about unknown
929 # group staff). Use good old cp...
932 + # These are the libs that are needed for the Energize version of gdb on
933 + # SVR4. Note that we MUST include the standard C library before libucb.a,
934 + # otherwise we get lots of broken stuff we don't want.
935 + ENERGIZE_LIB = energize/libconn.a
936 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
937 + -lsocket -lc /usr/ucblib/libucb.a -lnsl