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 *** Makefile.in Wed Jul 15 12:33:12 1992
25 --- Makefile.in Thu Jul 16 12:03:36 1992
29 READLINE_DEP = $$(READLINE_DIR)
30 RL_LIB = ./../readline${subdir}/libreadline.a
32 + # Energize libraries. Works slightly differently than other libraries
33 + # because it is a gdb subdir and we try to build the energize library
34 + # if it doesn't exist, unlike readline, bfd, mmalloc, etc. Note
35 + # that SDIR and BDIR will be different if we configured with -srcdir.
36 + ENERGIZE_SDIR = ${srcdir}/../gdb/energize
37 + ENERGIZE_BDIR = ./../gdb/energize${subdir}
38 + ENERGIZE_LIB = ${ENERGIZE_BDIR}/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 ! ${ENERGIZE_LIB} ${XM_CLIBS} ${TM_CLIBS}
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 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
74 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
75 ieee-float.c language.c parse.c buildsym.c objfiles.c \
76 ! minsyms.c mipsread.c maint.c
78 # Source files in subdirectories (which will be handled separately by
81 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
82 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
83 ieee-float.c language.c parse.c buildsym.c objfiles.c \
84 ! minsyms.c mipsread.c maint.c energize.c
86 # Source files in subdirectories (which will be handled separately by
90 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
91 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
92 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
93 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o \
94 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
96 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
98 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
99 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
100 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
101 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o energize.o \
102 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
104 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
108 NTSSTART = kdb-start.o
112 # For now, shortcut the "configure GDB for fewer languages" stuff.
113 YYFILES = c-exp.tab.c m2-exp.tab.c
116 NTSSTART = kdb-start.o
118 ! SUBDIRS = doc ${ENERGIZE_BDIR}
120 # For now, shortcut the "configure GDB for fewer languages" stuff.
121 YYFILES = c-exp.tab.c m2-exp.tab.c
125 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
126 echo "Load .c corresponding to:" $(DEPFILES)
129 + @(cd ${ENERGIZE_BDIR}; \
131 + "against=$(against)" \
133 + "AR_FLAGS=$(AR_FLAGS)" \
135 + "CFLAGS=$(CFLAGS)" \
136 + "RANLIB=$(RANLIB)" \
137 + "MAKEINFO=$(MAKEINFO)" \
138 + "INSTALL=$(INSTALL)" \
139 + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
140 + "INSTALL_DATA=$(INSTALL_DATA)" \
143 # This is useful when debugging GDB, because some Unix's don't let you run GDB
144 # on itself without copying the executable. So "make gdb1" will make
149 xcoffexec.o: ${srcdir}/xcoffexec.c
150 ${CC} -c ${INTERNAL_CFLAGS} -I$(BFD_DIR) ${srcdir}/xcoffexec.c
152 + # Energize support has dependencies on ENERGIZE header files.
154 + energize.o: ${srcdir}/energize.c
155 + ${CC} -c ${INTERNAL_CFLAGS} -I$(ENERGIZE_SDIR) ${srcdir}/energize.c
157 # Drag in the files that are in another directory.
159 ===================================================================
160 RCS file: /local/cvsfiles/devo/gdb/breakpoint.c,v
161 retrieving revision 1.38
162 diff -c -r1.38 breakpoint.c
163 *** 1.38 1992/07/04 03:20:43
164 --- breakpoint.c 1992/07/05 13:37:46
168 b->cond_string = NULL;
170 printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
171 + energize_condition_breakpoint(b);
178 typed in or the decompiled expression. */
179 b->cond_string = savestring (arg, strlen (arg));
180 b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
181 + energize_condition_breakpoint(b);
183 error ("Junk at end of expression");
188 if (b->number == bnum)
190 ! if (from_tty && input_from_terminal_p ())
192 ! printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
193 End with a line saying just \"end\".\n", bnum);
196 l = read_command_lines ();
197 free_command_lines (&b->commands);
201 error ("No breakpoint number %d.", bnum);
204 if (b->number == bnum)
206 ! if ((from_tty && input_from_terminal_p ()) || energize)
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);
209 l = read_command_lines ();
210 free_command_lines (&b->commands);
212 + energize_commands_breakpoint(b);
215 error ("No breakpoint number %d.", bnum);
222 + energize_ignore_breakpoint(b);
230 struct breakpoint *b;
232 + energize_create_breakpoint(b);
240 register struct breakpoint *b;
243 + energize_delete_breakpoint(bpt);
246 target_remove_breakpoint(bpt->address, bpt->shadow_contents);
251 if (b->number == bptnum)
253 b->ignore_count = count;
254 + energize_ignore_breakpoint(b);
260 struct breakpoint *b;
263 ! b->ignore_count = 0;
266 /* Command to set ignore-count of breakpoint N to COUNT. */
268 struct breakpoint *b;
272 ! b->ignore_count = 0;
273 ! energize_ignore_breakpoint(b);
277 /* Command to set ignore-count of breakpoint N to COUNT. */
282 bpt->enable = enabled;
284 + energize_enable_breakpoint(bpt);
286 if (xgdb_verbose && bpt->type == bp_breakpoint)
287 printf ("breakpoint #%d enabled\n", bpt->number);
292 disable_breakpoint (bpt)
293 struct breakpoint *bpt;
295 + energize_disable_breakpoint(bpt);
297 bpt->enable = disabled;
299 if (xgdb_verbose && bpt->type == bp_breakpoint)
300 ===================================================================
301 RCS file: /local/cvsfiles/devo/gdb/command.c,v
302 retrieving revision 1.17
303 diff -c -r1.17 command.c
304 *** 1.17 1992/07/04 03:20:54
305 --- command.c 1992/07/05 13:41:51
311 ! while ((rc = wait (&status)) != pid && rc != -1)
314 error ("Fork failed");
319 ! while ((rc = energize_wait (&status)) != pid && rc != -1)
322 error ("Fork failed");
323 ===================================================================
324 RCS file: /local/cvsfiles/devo/gdb/configure.in,v
325 retrieving revision 1.50
326 diff -c -r1.50 configure.in
327 *** 1.50 1992/06/23 00:25:00
328 --- configure.in 1992/07/05 17:50:08
334 target_dependent=true
336 ! configdirs="energize doc"
339 target_dependent=true
340 ===================================================================
341 RCS file: /local/cvsfiles/devo/gdb/defs.h,v
342 retrieving revision 1.41
343 diff -c -r1.41 defs.h
344 *** 1.41 1992/06/30 08:53:18
345 --- defs.h 1992/07/05 13:24:31
352 + #include "energize.h"
354 #endif /* !defined (DEFS_H) */
355 ===================================================================
356 RCS file: /local/cvsfiles/devo/gdb/inflow.c,v
357 retrieving revision 1.27
358 diff -c -r1.27 inflow.c
359 *** 1.27 1992/07/04 03:21:21
360 --- inflow.c 1992/07/05 12:58:31
363 static short pgrp_inferior;
364 static short pgrp_ours;
365 # else /* not def SHORT_PGRP */
366 ! static int pgrp_inferior;
367 static int pgrp_ours;
368 # endif /* not def SHORT_PGRP */
369 #else /* not def TIOCGPGRP */
371 static short pgrp_inferior;
372 static short pgrp_ours;
373 # else /* not def SHORT_PGRP */
375 static int pgrp_ours;
376 # endif /* not def SHORT_PGRP */
377 #else /* not def TIOCGPGRP */
378 ===================================================================
379 RCS file: /local/cvsfiles/devo/gdb/infrun.c,v
380 retrieving revision 1.52
381 diff -c -r1.52 infrun.c
382 *** 1.52 1992/07/04 03:21:24
383 --- infrun.c 1992/07/05 13:46:46
387 Here we must get it up to actual execution of the real program. */
389 inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
390 + energize_new_process();
392 clear_proceed_status ();
400 + energize_new_process();
401 push_target (&child_ops);
403 mark_breakpoints_out ();
404 ===================================================================
405 RCS file: /local/cvsfiles/devo/gdb/inftarg.c,v
406 retrieving revision 1.11
407 diff -c -r1.11 inftarg.c
408 *** 1.11 1992/03/29 23:21:27
409 --- inftarg.c 1992/07/05 13:48:05
413 pid = proc_wait (status);
415 ! pid = wait (status);
417 if (pid == -1) /* No more children to wait for */
421 pid = proc_wait (status);
423 ! pid = energize_wait (status);
425 if (pid == -1) /* No more children to wait for */
427 ===================================================================
428 RCS file: /local/cvsfiles/devo/gdb/main.c,v
429 retrieving revision 1.49
430 diff -c -r1.49 main.c
431 *** 1.49 1992/07/04 12:20:57
432 --- main.c 1992/07/05 14:08:32
436 char *corearg = NULL;
439 + char *energize_id = NULL;
441 /* Pointers to all arguments of +command option. */
446 {"tty", required_argument, 0, 't'},
447 {"baud", required_argument, 0, 'b'},
448 {"b", required_argument, 0, 'b'},
449 + {"context", required_argument, 0, 12},
450 /* Allow machine descriptions to add more options... */
451 #ifdef ADDITIONAL_OPTIONS
460 + energize_id = optarg;
469 do_cleanups (ALL_CLEANUPS);
471 + energize_initialize (energize_id, execarg);
475 && strcmp (execarg, symarg) == 0)
478 if (!setjmp (to_top_level))
480 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
482 quit_command ((char *)0, instream == stdin);
486 if (!setjmp (to_top_level))
488 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
490 ! energize_main_loop();
493 quit_command ((char *)0, instream == stdin);
498 else if (c->function.cfunc == NO_FUNCTION)
499 error ("That is not a command, just a help topic.");
501 ! (*c->function.cfunc) (arg, from_tty & caution);
504 /* Tell the user if the language has changed (except first time). */
506 else if (c->function.cfunc == NO_FUNCTION)
507 error ("That is not a command, just a help topic.");
509 ! energize_call_command (c, arg, from_tty & caution);
512 /* Tell the user if the language has changed (except first time). */
518 ! p = command_line_input ((char *) NULL, instream == stdin);
520 /* Treat end of file like "end". */
526 ! p = energize_command_line_input ((char *) NULL, instream == stdin);
528 /* Treat end of file like "end". */
535 ! printf ("%s", prompt);
543 ! printf_filtered ("%s", prompt);
547 ===================================================================
548 RCS file: /local/cvsfiles/devo/gdb/printcmd.c,v
549 retrieving revision 1.29
550 diff -c -r1.29 printcmd.c
551 *** 1.29 1992/06/25 10:58:47
552 --- printcmd.c 1992/07/05 14:09:25
557 int histindex = record_latest_value (val);
563 + sprintf(buf, "$%d", histindex);
564 + energize_start_variable_annotation(buf, NULL, VALUE_TYPE(val),
565 + VALUE_ADDRESS(val), "");
569 printf ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
574 if (histindex >= 0) printf_filtered ("$%d = ", histindex);
576 print_formatted (val, format, fmt.size);
577 + energize_end_variable_annotation();
578 printf_filtered ("\n");
584 standard indentation here is 4 spaces, and val_print indents
585 2 for each recurse. */
586 val = read_var_value (sym, FRAME_INFO_ID (fi));
588 + energize_start_variable_annotation(SYMBOL_NAME(sym), sym,
590 + VALUE_ADDRESS(val), "");
593 val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
594 stream, 0, 0, 2, Val_no_prettyprint);
596 fputs_filtered ("???", stream);
598 + energize_end_variable_annotation();
603 ===================================================================
604 RCS file: /local/cvsfiles/devo/gdb/stack.c,v
605 retrieving revision 1.33
606 diff -c -r1.33 stack.c
607 *** 1.33 1992/07/04 03:21:45
608 --- stack.c 1992/07/05 14:13:23
612 printf_filtered ("%s in ", local_hex_string(fi->pc));
614 ! fputs_demangled (fname, stdout, 0);
615 fputs_filtered (" (...)\n", stdout);
620 printf_filtered ("%s in ", local_hex_string(fi->pc));
623 ! energize_annotate_function(fname, 0, level);
625 ! fputs_demangled (fname, stdout, 0);
626 fputs_filtered (" (...)\n", stdout);
632 if (fi->pc != sal.pc || !sal.symtab)
633 printf_filtered ("%s in ", local_hex_string(fi->pc));
634 ! fputs_demangled (funname ? funname : "??", stdout, 0);
636 fputs_filtered (" (", stdout);
640 if (fi->pc != sal.pc || !sal.symtab)
641 printf_filtered ("%s in ", local_hex_string(fi->pc));
643 ! energize_annotate_function(funname ? funname : "??", 0, level);
645 ! fputs_demangled (funname ? funname : "??", stdout, 0);
647 fputs_filtered (" (", stdout);
652 if (addressprint && mid_statement)
653 printf_filtered ("%s\t", local_hex_string(fi->pc));
654 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
656 current_source_line = max (sal.line - lines_to_list/2, 1);
660 if (addressprint && mid_statement)
661 printf_filtered ("%s\t", local_hex_string(fi->pc));
663 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
665 current_source_line = max (sal.line - lines_to_list/2, 1);
671 printf_filtered (" in ");
672 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
679 printf_filtered (" in ");
681 ! energize_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS,
682 ! selected_frame_level);
684 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
688 ===================================================================
689 RCS file: /local/cvsfiles/devo/gdb/symfile.c,v
690 retrieving revision 1.55
691 diff -c -r1.55 symfile.c
692 *** 1.55 1992/07/04 13:58:46
693 --- symfile.c 1992/07/05 14:14:12
700 + energize_symbol_file(objfile);
705 ===================================================================
706 RCS file: /local/cvsfiles/devo/gdb/utils.c,v
707 retrieving revision 1.53
708 diff -c -r1.53 utils.c
709 *** 1.53 1992/07/04 03:21:59
710 --- utils.c 1992/07/05 17:32:13
715 /* Automatically answer "yes" if input is not from a terminal. */
716 ! if (!input_from_terminal_p ())
723 /* Automatically answer "yes" if input is not from a terminal. */
724 ! if (!input_from_terminal_p () && !energize)
732 ctlstr = va_arg (args, char *);
733 vfprintf_filtered (stdout, ctlstr, args);
735 printf_filtered ("(y or n) ");
737 ! answer = fgetc (stdin);
738 ! clearerr (stdin); /* in case of C-d */
739 ! if (answer == EOF) /* C-d */
741 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
744 ! ans2 = fgetc (stdin);
747 ! while (ans2 != EOF && ans2 != '\n');
754 ctlstr = va_arg (args, char *);
755 + energize_query (ctlstr, args);
756 vfprintf_filtered (stdout, ctlstr, args);
757 printf_filtered ("(y or n) ");
762 ! buf = energize_command_line_input(0, 0);
763 ! answer = buf ? *buf : 'Y';
764 ! energize_acknowledge_query(buf);
769 ! answer = fgetc (stdin);
770 ! clearerr (stdin); /* in case of C-d */
771 ! if (answer == EOF) /* C-d */
773 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
776 ! ans2 = fgetc (stdin);
779 ! while (ans2 != EOF && ans2 != '\n');
789 printf_filtered ("Please answer y or n.\n");
802 + energize_fputs(linebuffer);
806 /* Don't do any filtering if it is disabled. */
808 || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
809 ===================================================================
810 RCS file: /local/cvsfiles/devo/gdb/valprint.c,v
811 retrieving revision 1.45
812 diff -c -r1.45 valprint.c
813 *** 1.45 1992/07/04 03:22:04
814 --- valprint.c 1992/07/05 14:19:51
818 struct type **dont_print;
820 int i, len, n_baseclasses;
821 + char expr_tag[100]; /* Energize */
823 check_stub_type (type);
828 fprint_symbol (stream, TYPE_FIELD_NAME (type, i));
829 fputs_filtered (" = ", stream);
832 + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i));
834 + energize_start_variable_annotation(expr_tag, NULL,
835 + TYPE_FIELD_TYPE(type, i),
836 + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8),
838 if (TYPE_FIELD_PACKED (type, i))
844 valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
845 0, stream, format, 0, recurse + 1, pretty);
847 + energize_end_variable_annotation();
855 /* Number of repetitions we have detected so far. */
857 + char expr_tag[100]; /* Energize */
867 + sprintf(expr_tag, "[%d]", i);
868 + energize_start_variable_annotation(expr_tag, NULL,
870 + (CORE_ADDR) (valaddr + i * eltlen),
872 if (reps > REPEAT_COUNT_THRESHOLD)
874 val_print (elttype, valaddr + i * eltlen,
878 recurse + 1, pretty);
881 + energize_end_variable_annotation();
884 fprintf_filtered (stream, "...");
885 ===================================================================
886 *** config/amix.mh Tue Jun 9 19:05:16 1992
887 --- config/amix.mh Wed Jul 15 12:37:29 1992
892 # SVR4 puts the BSD compatible install in /usr/ucb.
893 INSTALL = /usr/ucb/install -c
895 + # These are the libs that are needed for the Energize version of gdb on
896 + # SVR4. Note that we MUST include the standard C library before libucb.a,
897 + # otherwise we get lots of broken stuff we don't want.
898 + XM_CLIBS = -L/usr/lib -lm -lnet -lresolv -lform -lsocket -lc \
899 + /usr/ucblib/libucb.a -lnsl
900 ===================================================================
901 RCS file: /local/cvsfiles/devo/gdb/config/ncr3000.mh,v
902 retrieving revision 1.4
903 diff -c -r1.4 ncr3000.mh
904 *** 1.4 1992/06/15 19:25:13
905 --- config/ncr3000.mh 1992/07/05 17:49:34
909 # The /usr/ucb/install program is incompatible (complains about unknown
910 # group staff). Use good old cp...
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 + XM_CLIBS = -L/usr/lib -lm -lnet -lresolv -lform -lsocket -lc \
917 + /usr/ucblib/libucb.a -lnsl
918 ===================================================================
919 *** demangle.c Wed Jul 15 11:42:27 1992
920 --- demangle.c Wed Jul 15 11:25:14 1992
923 the appropriate target configuration file. */
925 #ifndef DEFAULT_DEMANGLING_STYLE
926 ! # define DEFAULT_DEMANGLING_STYLE AUTO_DEMANGLING_STYLE_STRING
929 /* The current demangling style in affect. Global so that the demangler
931 the appropriate target configuration file. */
933 #ifndef DEFAULT_DEMANGLING_STYLE
934 ! # define DEFAULT_DEMANGLING_STYLE LUCID_DEMANGLING_STYLE_STRING
937 /* The current demangling style in affect. Global so that the demangler