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.63
8 diff -c -r2.63 .Sanitize
9 *** 2.63 1992/07/14 07:51:45
10 --- .Sanitize 1992/07/16 22:43:53
23 ===================================================================
24 RCS file: /local/cvsfiles/devo/gdb/Makefile.in,v
25 retrieving revision 1.172
26 diff -c -r1.172 Makefile.in
27 *** 1.172 1992/07/17 23:53:54
28 --- Makefile.in 1992/07/18 00:11:14
32 READLINE_DEP = $$(READLINE_DIR)
33 RL_LIB = ./../readline${subdir}/libreadline.a
35 + # Energize libraries. Works slightly differently than other libraries
36 + # because it is a gdb subdir and we try to build the energize library
37 + # if it doesn't exist, unlike readline, bfd, mmalloc, etc. Note
38 + # that SDIR and BDIR will be different if we configured with -srcdir.
39 + ENERGIZE_DIR = energize
40 + ENERGIZE_LIB = ${ENERGIZE_DIR}/libconn.a
42 # All the includes used for CFLAGS and for lint.
43 # -I. for config files.
44 # -I${srcdir} possibly for regex.h also.
47 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
48 # TERMCAP comes after readline, since readline depends on it.
49 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
50 ! ${XM_CLIBS} ${TM_CLIBS}
51 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
52 ${RL_LIB} ${MMALLOC_LIB}
54 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
55 ! ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES}
60 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
61 # TERMCAP comes after readline, since readline depends on it.
62 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
63 ! ${ENERGIZE_LIB} ${XM_CLIBS} ${TM_CLIBS}
64 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
65 ${RL_LIB} ${MMALLOC_LIB}
67 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
68 ! ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES} \
75 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
76 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
77 ieee-float.c language.c parse.c buildsym.c objfiles.c \
78 ! minsyms.c mipsread.c maint.c
80 # Source files in subdirectories (which will be handled separately by
83 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
84 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
85 ieee-float.c language.c parse.c buildsym.c objfiles.c \
86 ! minsyms.c mipsread.c maint.c energize.c
88 # Source files in subdirectories (which will be handled separately by
92 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
93 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
94 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
95 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o \
96 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
98 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
100 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
101 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
102 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
103 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o energize.o \
104 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
106 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
110 NTSSTART = kdb-start.o
114 # For now, shortcut the "configure GDB for fewer languages" stuff.
115 YYFILES = c-exp.tab.c m2-exp.tab.c
118 NTSSTART = kdb-start.o
120 ! SUBDIRS = doc ${ENERGIZE_DIR}
122 # For now, shortcut the "configure GDB for fewer languages" stuff.
123 YYFILES = c-exp.tab.c m2-exp.tab.c
127 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
128 echo "Load .c corresponding to:" $(DEPFILES)
131 + @(cd ${ENERGIZE_DIR}; \
133 + "against=$(against)" \
135 + "AR_FLAGS=$(AR_FLAGS)" \
137 + "CFLAGS=$(CFLAGS)" \
138 + "RANLIB=$(RANLIB)" \
139 + "MAKEINFO=$(MAKEINFO)" \
140 + "INSTALL=$(INSTALL)" \
141 + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
142 + "INSTALL_DATA=$(INSTALL_DATA)" \
145 # This is useful when debugging GDB, because some Unix's don't let you run GDB
146 # on itself without copying the executable. So "make gdb1" will make
149 -e '/extern.*free/d' \
150 < y.tab.c > m2-exp.tab.c
154 main.o: ${srcdir}/main.c
155 ${CC} -c ${INTERNAL_CFLAGS} -I${READLINE_DIR} $<
157 ===================================================================
158 RCS file: /local/cvsfiles/devo/gdb/breakpoint.c,v
159 retrieving revision 1.40
160 diff -c -r1.40 breakpoint.c
161 *** 1.40 1992/07/16 23:23:02
162 --- breakpoint.c 1992/07/16 23:23:58
166 b->cond_string = NULL;
168 printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
169 + energize_condition_breakpoint(b);
176 typed in or the decompiled expression. */
177 b->cond_string = savestring (arg, strlen (arg));
178 b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
179 + energize_condition_breakpoint(b);
181 error ("Junk at end of expression");
186 if (b->number == bnum)
188 ! if (from_tty && input_from_terminal_p ())
189 printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
190 End with a line saying just \"end\".\n", bnum);
191 l = read_command_lines ();
192 free_command_lines (&b->commands);
196 error ("No breakpoint number %d.", bnum);
199 if (b->number == bnum)
201 ! if ((from_tty && input_from_terminal_p ()) || energize)
202 printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
203 End with a line saying just \"end\".\n", bnum);
204 l = read_command_lines ();
205 free_command_lines (&b->commands);
207 + energize_commands_breakpoint(b);
210 error ("No breakpoint number %d.", bnum);
217 + energize_ignore_breakpoint(b);
225 struct breakpoint *b;
227 + energize_create_breakpoint(b);
235 register struct breakpoint *b;
238 + energize_delete_breakpoint(bpt);
241 target_remove_breakpoint(bpt->address, bpt->shadow_contents);
246 if (b->number == bptnum)
248 b->ignore_count = count;
249 + energize_ignore_breakpoint(b);
255 struct breakpoint *b;
258 ! b->ignore_count = 0;
261 /* Command to set ignore-count of breakpoint N to COUNT. */
263 struct breakpoint *b;
267 ! b->ignore_count = 0;
268 ! energize_ignore_breakpoint(b);
272 /* Command to set ignore-count of breakpoint N to COUNT. */
277 bpt->enable = enabled;
279 + energize_enable_breakpoint(bpt);
281 if (xgdb_verbose && bpt->type == bp_breakpoint)
282 printf ("breakpoint #%d enabled\n", bpt->number);
287 disable_breakpoint (bpt)
288 struct breakpoint *bpt;
290 + energize_disable_breakpoint(bpt);
292 bpt->enable = disabled;
294 if (xgdb_verbose && bpt->type == bp_breakpoint)
295 ===================================================================
296 RCS file: /local/cvsfiles/devo/gdb/command.c,v
297 retrieving revision 1.18
298 diff -c -r1.18 command.c
299 *** 1.18 1992/07/10 17:22:30
300 --- command.c 1992/07/16 22:44:12
306 ! while ((rc = wait (&status)) != pid && rc != -1)
309 error ("Fork failed");
314 ! while ((rc = energize_wait (&status)) != pid && rc != -1)
317 error ("Fork failed");
318 ===================================================================
319 RCS file: /local/cvsfiles/devo/gdb/configure.in,v
320 retrieving revision 1.51
321 diff -c -r1.51 configure.in
322 *** 1.51 1992/07/07 07:22:33
323 --- configure.in 1992/07/16 22:44:14
329 target_dependent=true
331 ! configdirs="energize doc"
334 target_dependent=true
335 ===================================================================
336 RCS file: /local/cvsfiles/devo/gdb/defs.h,v
337 retrieving revision 1.43
338 diff -c -r1.43 defs.h
339 *** 1.43 1992/07/09 04:40:24
340 --- defs.h 1992/07/16 22:48:44
344 #define MAINTENANCE_CMDS 1
347 + #include "energize.h"
349 #endif /* !defined (DEFS_H) */
350 ===================================================================
351 RCS file: /local/cvsfiles/devo/gdb/inflow.c,v
352 retrieving revision 1.27
353 diff -c -r1.27 inflow.c
354 *** 1.27 1992/07/04 03:21:21
355 --- inflow.c 1992/07/05 12:58:31
358 static short pgrp_inferior;
359 static short pgrp_ours;
360 # else /* not def SHORT_PGRP */
361 ! static int pgrp_inferior;
362 static int pgrp_ours;
363 # endif /* not def SHORT_PGRP */
364 #else /* not def TIOCGPGRP */
366 static short pgrp_inferior;
367 static short pgrp_ours;
368 # else /* not def SHORT_PGRP */
370 static int pgrp_ours;
371 # endif /* not def SHORT_PGRP */
372 #else /* not def TIOCGPGRP */
373 ===================================================================
374 RCS file: /local/cvsfiles/devo/gdb/infrun.c,v
375 retrieving revision 1.52
376 diff -c -r1.52 infrun.c
377 *** 1.52 1992/07/04 03:21:24
378 --- infrun.c 1992/07/05 13:46:46
382 Here we must get it up to actual execution of the real program. */
384 inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
385 + energize_new_process();
387 clear_proceed_status ();
395 + energize_new_process();
396 push_target (&child_ops);
398 mark_breakpoints_out ();
399 ===================================================================
400 RCS file: /local/cvsfiles/devo/gdb/inftarg.c,v
401 retrieving revision 1.11
402 diff -c -r1.11 inftarg.c
403 *** 1.11 1992/03/29 23:21:27
404 --- inftarg.c 1992/07/05 13:48:05
408 pid = proc_wait (status);
410 ! pid = wait (status);
412 if (pid == -1) /* No more children to wait for */
416 pid = proc_wait (status);
418 ! pid = energize_wait (status);
420 if (pid == -1) /* No more children to wait for */
422 ===================================================================
423 RCS file: /local/cvsfiles/devo/gdb/main.c,v
424 retrieving revision 1.51
425 diff -c -r1.51 main.c
426 *** 1.51 1992/07/10 17:22:33
427 --- main.c 1992/07/17 23:22:19
431 char *corearg = NULL;
434 + char *energize_id = NULL;
436 /* Pointers to all arguments of +command option. */
441 {"tty", required_argument, 0, 't'},
442 {"baud", required_argument, 0, 'b'},
443 {"b", required_argument, 0, 'b'},
444 + {"context", required_argument, 0, 12},
445 /* Allow machine descriptions to add more options... */
446 #ifdef ADDITIONAL_OPTIONS
455 + energize_id = optarg;
464 do_cleanups (ALL_CLEANUPS);
466 + energize_initialize (energize_id, execarg);
470 && strcmp (execarg, symarg) == 0)
473 if (!setjmp (to_top_level))
475 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
477 quit_command ((char *)0, instream == stdin);
481 if (!setjmp (to_top_level))
483 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
485 ! energize_main_loop();
488 quit_command ((char *)0, instream == stdin);
493 else if (c->function.cfunc == NO_FUNCTION)
494 error ("That is not a command, just a help topic.");
496 ! (*c->function.cfunc) (arg, from_tty & caution);
499 /* Tell the user if the language has changed (except first time). */
501 else if (c->function.cfunc == NO_FUNCTION)
502 error ("That is not a command, just a help topic.");
504 ! energize_call_command (c, arg, from_tty & caution);
507 /* Tell the user if the language has changed (except first time). */
513 ! p = command_line_input ((char *) NULL, instream == stdin);
515 /* Treat end of file like "end". */
521 ! p = energize_command_line_input ((char *) NULL, instream == stdin);
523 /* Treat end of file like "end". */
530 ! printf ("%s", prompt);
538 ! printf_filtered ("%s", prompt);
542 ===================================================================
543 RCS file: /local/cvsfiles/devo/gdb/printcmd.c,v
544 retrieving revision 1.30
545 diff -c -r1.30 printcmd.c
546 *** 1.30 1992/07/06 00:22:52
547 --- printcmd.c 1992/07/16 22:44:42
552 int histindex = record_latest_value (val);
558 + sprintf(buf, "$%d", histindex);
559 + energize_start_variable_annotation(buf, NULL, VALUE_TYPE(val),
560 + VALUE_ADDRESS(val), "");
564 printf ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
569 if (histindex >= 0) printf_filtered ("$%d = ", histindex);
571 print_formatted (val, format, fmt.size);
572 + energize_end_variable_annotation();
573 printf_filtered ("\n");
579 standard indentation here is 4 spaces, and val_print indents
580 2 for each recurse. */
581 val = read_var_value (sym, FRAME_INFO_ID (fi));
583 + energize_start_variable_annotation(SYMBOL_NAME(sym), sym,
585 + VALUE_ADDRESS(val), "");
588 val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
589 stream, 0, 0, 2, Val_no_prettyprint);
591 fputs_filtered ("???", stream);
593 + energize_end_variable_annotation();
598 ===================================================================
599 RCS file: /local/cvsfiles/devo/gdb/stack.c,v
600 retrieving revision 1.33
601 diff -c -r1.33 stack.c
602 *** 1.33 1992/07/04 03:21:45
603 --- stack.c 1992/07/05 14:13:23
607 printf_filtered ("%s in ", local_hex_string(fi->pc));
609 ! fputs_demangled (fname, stdout, 0);
610 fputs_filtered (" (...)\n", stdout);
615 printf_filtered ("%s in ", local_hex_string(fi->pc));
618 ! energize_annotate_function(fname, 0, level);
620 ! fputs_demangled (fname, stdout, 0);
621 fputs_filtered (" (...)\n", stdout);
627 if (fi->pc != sal.pc || !sal.symtab)
628 printf_filtered ("%s in ", local_hex_string(fi->pc));
629 ! fputs_demangled (funname ? funname : "??", stdout, 0);
631 fputs_filtered (" (", stdout);
635 if (fi->pc != sal.pc || !sal.symtab)
636 printf_filtered ("%s in ", local_hex_string(fi->pc));
638 ! energize_annotate_function(funname ? funname : "??", 0, level);
640 ! fputs_demangled (funname ? funname : "??", stdout, 0);
642 fputs_filtered (" (", stdout);
647 if (addressprint && mid_statement)
648 printf_filtered ("%s\t", local_hex_string(fi->pc));
649 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
651 current_source_line = max (sal.line - lines_to_list/2, 1);
655 if (addressprint && mid_statement)
656 printf_filtered ("%s\t", local_hex_string(fi->pc));
658 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
660 current_source_line = max (sal.line - lines_to_list/2, 1);
666 printf_filtered (" in ");
667 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
674 printf_filtered (" in ");
676 ! energize_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS,
677 ! selected_frame_level);
679 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
683 ===================================================================
684 RCS file: /local/cvsfiles/devo/gdb/symfile.c,v
685 retrieving revision 1.55
686 diff -c -r1.55 symfile.c
687 *** 1.55 1992/07/04 13:58:46
688 --- symfile.c 1992/07/05 14:14:12
695 + energize_symbol_file(objfile);
700 ===================================================================
701 RCS file: /local/cvsfiles/devo/gdb/utils.c,v
702 retrieving revision 1.54
703 diff -c -r1.54 utils.c
704 *** 1.54 1992/07/09 04:40:35
705 --- utils.c 1992/07/16 22:44:50
710 /* Automatically answer "yes" if input is not from a terminal. */
711 ! if (!input_from_terminal_p ())
718 /* Automatically answer "yes" if input is not from a terminal. */
719 ! if (!input_from_terminal_p () && !energize)
727 ctlstr = va_arg (args, char *);
728 vfprintf_filtered (stdout, ctlstr, args);
730 printf_filtered ("(y or n) ");
732 ! answer = fgetc (stdin);
733 ! clearerr (stdin); /* in case of C-d */
734 ! if (answer == EOF) /* C-d */
736 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
739 ! ans2 = fgetc (stdin);
742 ! while (ans2 != EOF && ans2 != '\n');
749 ctlstr = va_arg (args, char *);
750 + energize_query (ctlstr, args);
751 vfprintf_filtered (stdout, ctlstr, args);
752 printf_filtered ("(y or n) ");
757 ! buf = energize_command_line_input(0, 0);
758 ! answer = buf ? *buf : 'Y';
759 ! energize_acknowledge_query(buf);
764 ! answer = fgetc (stdin);
765 ! clearerr (stdin); /* in case of C-d */
766 ! if (answer == EOF) /* C-d */
768 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
771 ! ans2 = fgetc (stdin);
774 ! while (ans2 != EOF && ans2 != '\n');
784 printf_filtered ("Please answer y or n.\n");
797 + energize_fputs(linebuffer);
801 /* Don't do any filtering if it is disabled. */
803 || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
804 ===================================================================
805 RCS file: /local/cvsfiles/devo/gdb/valprint.c,v
806 retrieving revision 1.48
807 diff -c -r1.48 valprint.c
808 *** 1.48 1992/07/10 03:56:06
809 --- valprint.c 1992/07/16 22:44:53
813 struct type **dont_print;
815 int i, len, n_baseclasses;
816 + char expr_tag[100]; /* Energize */
818 check_stub_type (type);
823 fprint_symbol (stream, TYPE_FIELD_NAME (type, i));
824 fputs_filtered (" = ", stream);
827 + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i));
829 + energize_start_variable_annotation(expr_tag, NULL,
830 + TYPE_FIELD_TYPE(type, i),
831 + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8),
833 if (TYPE_FIELD_PACKED (type, i))
839 valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
840 0, stream, format, 0, recurse + 1, pretty);
842 + energize_end_variable_annotation();
850 /* Number of repetitions we have detected so far. */
852 + char expr_tag[100]; /* Energize */
862 + sprintf(expr_tag, "[%d]", i);
863 + energize_start_variable_annotation(expr_tag, NULL,
865 + (CORE_ADDR) (valaddr + i * eltlen),
867 if (reps > REPEAT_COUNT_THRESHOLD)
869 val_print (elttype, valaddr + i * eltlen,
873 recurse + 1, pretty);
876 + energize_end_variable_annotation();
879 fprintf_filtered (stream, "...");
880 ===================================================================
881 RCS file: /local/cvsfiles/devo/gdb/config/amix.mh,v
882 retrieving revision 1.4
883 diff -c -r1.4 amix.mh
884 *** 1.4 1992/06/10 02:05:16
885 --- config/amix.mh 1992/07/05 17:47:19
890 # SVR4 puts the BSD compatible install in /usr/ucb.
891 INSTALL = /usr/ucb/install -c
893 + # These are the libs that are needed for the Energize version of gdb on
894 + # SVR4. Note that we MUST include the standard C library before libucb.a,
895 + # otherwise we get lots of broken stuff we don't want.
896 + ENERGIZE_LIB = energize/libconn.a
897 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
898 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
899 ===================================================================
900 RCS file: /local/cvsfiles/devo/gdb/config/ncr3000.mh,v
901 retrieving revision 1.4
902 diff -c -r1.4 ncr3000.mh
903 *** 1.4 1992/06/15 19:25:13
904 --- config/ncr3000.mh 1992/07/05 17:49:34
908 # The /usr/ucb/install program is incompatible (complains about unknown
909 # group staff). Use good old cp...
912 + # These are the libs that are needed for the Energize version of gdb on
913 + # SVR4. Note that we MUST include the standard C library before libucb.a,
914 + # otherwise we get lots of broken stuff we don't want.
915 + ENERGIZE_LIB = energize/libconn.a
916 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
917 + -lsocket -lc /usr/ucblib/libucb.a -lnsl