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:22:03 1992
25 --- Makefile.in Wed Jul 15 12:15:34 1992
29 READLINE_DEP = $$(READLINE_DIR)
30 RL_LIB = ./../readline${subdir}/libreadline.a
32 + # Energize libraries
33 + ENERGIZE_DIR = ${srcdir}/../gdb/energize
34 + ENERGIZE_LIB = ./../gdb/energize${subdir}/libconn.a
36 # All the includes used for CFLAGS and for lint.
37 # -I. for config files.
38 # -I${srcdir} possibly for regex.h also.
41 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
42 # TERMCAP comes after readline, since readline depends on it.
43 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
44 ! ${XM_CLIBS} ${TM_CLIBS}
45 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
46 ${RL_LIB} ${MMALLOC_LIB}
48 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
49 ! ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES}
54 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
55 # TERMCAP comes after readline, since readline depends on it.
56 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
57 ! ${ENERGIZE_LIB} ${XM_CLIBS} ${TM_CLIBS}
58 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
59 ${RL_LIB} ${MMALLOC_LIB}
61 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
62 ! ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES} \
69 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
70 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
71 ieee-float.c language.c parse.c buildsym.c objfiles.c \
72 ! minsyms.c mipsread.c maint.c
74 # Source files in subdirectories (which will be handled separately by
77 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
78 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
79 ieee-float.c language.c parse.c buildsym.c objfiles.c \
80 ! minsyms.c mipsread.c maint.c energize.c
82 # Source files in subdirectories (which will be handled separately by
86 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
87 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
88 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
89 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o \
90 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
92 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
94 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
95 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
96 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
97 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o energize.o \
98 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
100 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
104 NTSSTART = kdb-start.o
108 # For now, shortcut the "configure GDB for fewer languages" stuff.
109 YYFILES = c-exp.tab.c m2-exp.tab.c
112 NTSSTART = kdb-start.o
114 ! SUBDIRS = doc ${ENERGIZE_DIR}
116 # For now, shortcut the "configure GDB for fewer languages" stuff.
117 YYFILES = c-exp.tab.c m2-exp.tab.c
121 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
122 echo "Load .c corresponding to:" $(DEPFILES)
125 + @(cd ${ENERGIZE_DIR}; \
127 + "against=$(against)" \
129 + "AR_FLAGS=$(AR_FLAGS)" \
131 + "CFLAGS=$(CFLAGS)" \
132 + "RANLIB=$(RANLIB)" \
133 + "MAKEINFO=$(MAKEINFO)" \
134 + "INSTALL=$(INSTALL)" \
135 + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
136 + "INSTALL_DATA=$(INSTALL_DATA)" \
139 # This is useful when debugging GDB, because some Unix's don't let you run GDB
140 # on itself without copying the executable. So "make gdb1" will make
145 xcoffexec.o: ${srcdir}/xcoffexec.c
146 ${CC} -c ${INTERNAL_CFLAGS} -I$(BFD_DIR) ${srcdir}/xcoffexec.c
148 + # Energize support has dependencies on ENERGIZE header files.
150 + energize.o: ${srcdir}/energize.c
151 + ${CC} -c ${INTERNAL_CFLAGS} -I$(ENERGIZE_DIR) ${srcdir}/energize.c
153 # Drag in the files that are in another directory.
155 ===================================================================
156 RCS file: /local/cvsfiles/devo/gdb/breakpoint.c,v
157 retrieving revision 1.38
158 diff -c -r1.38 breakpoint.c
159 *** 1.38 1992/07/04 03:20:43
160 --- breakpoint.c 1992/07/05 13:37:46
164 b->cond_string = NULL;
166 printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
167 + energize_condition_breakpoint(b);
174 typed in or the decompiled expression. */
175 b->cond_string = savestring (arg, strlen (arg));
176 b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
177 + energize_condition_breakpoint(b);
179 error ("Junk at end of expression");
184 if (b->number == bnum)
186 ! if (from_tty && input_from_terminal_p ())
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);
192 l = read_command_lines ();
193 free_command_lines (&b->commands);
197 error ("No breakpoint number %d.", bnum);
200 if (b->number == bnum)
202 ! if ((from_tty && input_from_terminal_p ()) || energize)
203 ! printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
204 End with a line saying just \"end\".\n", bnum);
205 l = read_command_lines ();
206 free_command_lines (&b->commands);
208 + energize_commands_breakpoint(b);
211 error ("No breakpoint number %d.", bnum);
218 + energize_ignore_breakpoint(b);
226 struct breakpoint *b;
228 + energize_create_breakpoint(b);
236 register struct breakpoint *b;
239 + energize_delete_breakpoint(bpt);
242 target_remove_breakpoint(bpt->address, bpt->shadow_contents);
247 if (b->number == bptnum)
249 b->ignore_count = count;
250 + energize_ignore_breakpoint(b);
256 struct breakpoint *b;
259 ! b->ignore_count = 0;
262 /* Command to set ignore-count of breakpoint N to COUNT. */
264 struct breakpoint *b;
268 ! b->ignore_count = 0;
269 ! energize_ignore_breakpoint(b);
273 /* Command to set ignore-count of breakpoint N to COUNT. */
278 bpt->enable = enabled;
280 + energize_enable_breakpoint(bpt);
282 if (xgdb_verbose && bpt->type == bp_breakpoint)
283 printf ("breakpoint #%d enabled\n", bpt->number);
288 disable_breakpoint (bpt)
289 struct breakpoint *bpt;
291 + energize_disable_breakpoint(bpt);
293 bpt->enable = disabled;
295 if (xgdb_verbose && bpt->type == bp_breakpoint)
296 ===================================================================
297 RCS file: /local/cvsfiles/devo/gdb/command.c,v
298 retrieving revision 1.17
299 diff -c -r1.17 command.c
300 *** 1.17 1992/07/04 03:20:54
301 --- command.c 1992/07/05 13:41:51
307 ! while ((rc = wait (&status)) != pid && rc != -1)
310 error ("Fork failed");
315 ! while ((rc = energize_wait (&status)) != pid && rc != -1)
318 error ("Fork failed");
319 ===================================================================
320 RCS file: /local/cvsfiles/devo/gdb/configure.in,v
321 retrieving revision 1.50
322 diff -c -r1.50 configure.in
323 *** 1.50 1992/06/23 00:25:00
324 --- configure.in 1992/07/05 17:50:08
330 target_dependent=true
332 ! configdirs="energize doc"
335 target_dependent=true
336 ===================================================================
337 RCS file: /local/cvsfiles/devo/gdb/defs.h,v
338 retrieving revision 1.41
339 diff -c -r1.41 defs.h
340 *** 1.41 1992/06/30 08:53:18
341 --- defs.h 1992/07/05 13:24:31
348 + #include "energize.h"
350 #endif /* !defined (DEFS_H) */
351 ===================================================================
352 RCS file: /local/cvsfiles/devo/gdb/inflow.c,v
353 retrieving revision 1.27
354 diff -c -r1.27 inflow.c
355 *** 1.27 1992/07/04 03:21:21
356 --- inflow.c 1992/07/05 12:58:31
359 static short pgrp_inferior;
360 static short pgrp_ours;
361 # else /* not def SHORT_PGRP */
362 ! static int pgrp_inferior;
363 static int pgrp_ours;
364 # endif /* not def SHORT_PGRP */
365 #else /* not def TIOCGPGRP */
367 static short pgrp_inferior;
368 static short pgrp_ours;
369 # else /* not def SHORT_PGRP */
371 static int pgrp_ours;
372 # endif /* not def SHORT_PGRP */
373 #else /* not def TIOCGPGRP */
374 ===================================================================
375 RCS file: /local/cvsfiles/devo/gdb/infrun.c,v
376 retrieving revision 1.52
377 diff -c -r1.52 infrun.c
378 *** 1.52 1992/07/04 03:21:24
379 --- infrun.c 1992/07/05 13:46:46
383 Here we must get it up to actual execution of the real program. */
385 inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
386 + energize_new_process();
388 clear_proceed_status ();
396 + energize_new_process();
397 push_target (&child_ops);
399 mark_breakpoints_out ();
400 ===================================================================
401 RCS file: /local/cvsfiles/devo/gdb/inftarg.c,v
402 retrieving revision 1.11
403 diff -c -r1.11 inftarg.c
404 *** 1.11 1992/03/29 23:21:27
405 --- inftarg.c 1992/07/05 13:48:05
409 pid = proc_wait (status);
411 ! pid = wait (status);
413 if (pid == -1) /* No more children to wait for */
417 pid = proc_wait (status);
419 ! pid = energize_wait (status);
421 if (pid == -1) /* No more children to wait for */
423 ===================================================================
424 RCS file: /local/cvsfiles/devo/gdb/main.c,v
425 retrieving revision 1.49
426 diff -c -r1.49 main.c
427 *** 1.49 1992/07/04 12:20:57
428 --- main.c 1992/07/05 14:08:32
432 char *corearg = NULL;
435 + char *energize_id = NULL;
437 /* Pointers to all arguments of +command option. */
442 {"tty", required_argument, 0, 't'},
443 {"baud", required_argument, 0, 'b'},
444 {"b", required_argument, 0, 'b'},
445 + {"context", required_argument, 0, 12},
446 /* Allow machine descriptions to add more options... */
447 #ifdef ADDITIONAL_OPTIONS
456 + energize_id = optarg;
465 do_cleanups (ALL_CLEANUPS);
467 + energize_initialize (energize_id, execarg);
471 && strcmp (execarg, symarg) == 0)
474 if (!setjmp (to_top_level))
476 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
478 quit_command ((char *)0, instream == stdin);
482 if (!setjmp (to_top_level))
484 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
486 ! energize_main_loop();
489 quit_command ((char *)0, instream == stdin);
494 else if (c->function.cfunc == NO_FUNCTION)
495 error ("That is not a command, just a help topic.");
497 ! (*c->function.cfunc) (arg, from_tty & caution);
500 /* Tell the user if the language has changed (except first time). */
502 else if (c->function.cfunc == NO_FUNCTION)
503 error ("That is not a command, just a help topic.");
505 ! energize_call_command (c, arg, from_tty & caution);
508 /* Tell the user if the language has changed (except first time). */
514 ! p = command_line_input ((char *) NULL, instream == stdin);
516 /* Treat end of file like "end". */
522 ! p = energize_command_line_input ((char *) NULL, instream == stdin);
524 /* Treat end of file like "end". */
531 ! printf ("%s", prompt);
539 ! printf_filtered ("%s", prompt);
543 ===================================================================
544 RCS file: /local/cvsfiles/devo/gdb/printcmd.c,v
545 retrieving revision 1.29
546 diff -c -r1.29 printcmd.c
547 *** 1.29 1992/06/25 10:58:47
548 --- printcmd.c 1992/07/05 14:09:25
553 int histindex = record_latest_value (val);
559 + sprintf(buf, "$%d", histindex);
560 + energize_start_variable_annotation(buf, NULL, VALUE_TYPE(val),
561 + VALUE_ADDRESS(val), "");
565 printf ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
570 if (histindex >= 0) printf_filtered ("$%d = ", histindex);
572 print_formatted (val, format, fmt.size);
573 + energize_end_variable_annotation();
574 printf_filtered ("\n");
580 standard indentation here is 4 spaces, and val_print indents
581 2 for each recurse. */
582 val = read_var_value (sym, FRAME_INFO_ID (fi));
584 + energize_start_variable_annotation(SYMBOL_NAME(sym), sym,
586 + VALUE_ADDRESS(val), "");
589 val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
590 stream, 0, 0, 2, Val_no_prettyprint);
592 fputs_filtered ("???", stream);
594 + energize_end_variable_annotation();
599 ===================================================================
600 RCS file: /local/cvsfiles/devo/gdb/stack.c,v
601 retrieving revision 1.33
602 diff -c -r1.33 stack.c
603 *** 1.33 1992/07/04 03:21:45
604 --- stack.c 1992/07/05 14:13:23
608 printf_filtered ("%s in ", local_hex_string(fi->pc));
610 ! fputs_demangled (fname, stdout, 0);
611 fputs_filtered (" (...)\n", stdout);
616 printf_filtered ("%s in ", local_hex_string(fi->pc));
619 ! energize_annotate_function(fname, 0, level);
621 ! fputs_demangled (fname, stdout, 0);
622 fputs_filtered (" (...)\n", stdout);
628 if (fi->pc != sal.pc || !sal.symtab)
629 printf_filtered ("%s in ", local_hex_string(fi->pc));
630 ! fputs_demangled (funname ? funname : "??", stdout, 0);
632 fputs_filtered (" (", stdout);
636 if (fi->pc != sal.pc || !sal.symtab)
637 printf_filtered ("%s in ", local_hex_string(fi->pc));
639 ! energize_annotate_function(funname ? funname : "??", 0, level);
641 ! fputs_demangled (funname ? funname : "??", stdout, 0);
643 fputs_filtered (" (", stdout);
648 if (addressprint && mid_statement)
649 printf_filtered ("%s\t", local_hex_string(fi->pc));
650 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
652 current_source_line = max (sal.line - lines_to_list/2, 1);
656 if (addressprint && mid_statement)
657 printf_filtered ("%s\t", local_hex_string(fi->pc));
659 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
661 current_source_line = max (sal.line - lines_to_list/2, 1);
667 printf_filtered (" in ");
668 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
675 printf_filtered (" in ");
677 ! energize_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS,
678 ! selected_frame_level);
680 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
684 ===================================================================
685 RCS file: /local/cvsfiles/devo/gdb/symfile.c,v
686 retrieving revision 1.55
687 diff -c -r1.55 symfile.c
688 *** 1.55 1992/07/04 13:58:46
689 --- symfile.c 1992/07/05 14:14:12
696 + energize_symbol_file(objfile);
701 ===================================================================
702 RCS file: /local/cvsfiles/devo/gdb/utils.c,v
703 retrieving revision 1.53
704 diff -c -r1.53 utils.c
705 *** 1.53 1992/07/04 03:21:59
706 --- utils.c 1992/07/05 17:32:13
711 /* Automatically answer "yes" if input is not from a terminal. */
712 ! if (!input_from_terminal_p ())
719 /* Automatically answer "yes" if input is not from a terminal. */
720 ! if (!input_from_terminal_p () && !energize)
728 ctlstr = va_arg (args, char *);
729 vfprintf_filtered (stdout, ctlstr, args);
731 printf_filtered ("(y or n) ");
733 ! answer = fgetc (stdin);
734 ! clearerr (stdin); /* in case of C-d */
735 ! if (answer == EOF) /* C-d */
737 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
740 ! ans2 = fgetc (stdin);
743 ! while (ans2 != EOF && ans2 != '\n');
750 ctlstr = va_arg (args, char *);
751 + energize_query (ctlstr, args);
752 vfprintf_filtered (stdout, ctlstr, args);
753 printf_filtered ("(y or n) ");
758 ! buf = energize_command_line_input(0, 0);
759 ! answer = buf ? *buf : 'Y';
760 ! energize_acknowledge_query(buf);
765 ! answer = fgetc (stdin);
766 ! clearerr (stdin); /* in case of C-d */
767 ! if (answer == EOF) /* C-d */
769 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
772 ! ans2 = fgetc (stdin);
775 ! while (ans2 != EOF && ans2 != '\n');
785 printf_filtered ("Please answer y or n.\n");
798 + energize_fputs(linebuffer);
802 /* Don't do any filtering if it is disabled. */
804 || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
805 ===================================================================
806 RCS file: /local/cvsfiles/devo/gdb/valprint.c,v
807 retrieving revision 1.45
808 diff -c -r1.45 valprint.c
809 *** 1.45 1992/07/04 03:22:04
810 --- valprint.c 1992/07/05 14:19:51
814 struct type **dont_print;
816 int i, len, n_baseclasses;
817 + char expr_tag[100]; /* Energize */
819 check_stub_type (type);
824 fprint_symbol (stream, TYPE_FIELD_NAME (type, i));
825 fputs_filtered (" = ", stream);
828 + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i));
830 + energize_start_variable_annotation(expr_tag, NULL,
831 + TYPE_FIELD_TYPE(type, i),
832 + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8),
834 if (TYPE_FIELD_PACKED (type, i))
840 valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
841 0, stream, format, 0, recurse + 1, pretty);
843 + energize_end_variable_annotation();
851 /* Number of repetitions we have detected so far. */
853 + char expr_tag[100]; /* Energize */
863 + sprintf(expr_tag, "[%d]", i);
864 + energize_start_variable_annotation(expr_tag, NULL,
866 + (CORE_ADDR) (valaddr + i * eltlen),
868 if (reps > REPEAT_COUNT_THRESHOLD)
870 val_print (elttype, valaddr + i * eltlen,
874 recurse + 1, pretty);
877 + energize_end_variable_annotation();
880 fprintf_filtered (stream, "...");
881 ===================================================================
882 RCS file: /local/cvsfiles/devo/gdb/config/amix.mh,v
883 retrieving revision 1.4
884 diff -c -r1.4 amix.mh
885 *** 1.4 1992/06/10 02:05:16
886 --- config/amix.mh 1992/07/05 17:47:19
891 # SVR4 puts the BSD compatible install in /usr/ucb.
892 INSTALL = /usr/ucb/install -c
894 + # These are the libs that are needed for the Energize version of gdb on
895 + # SVR4. Note that we MUST include the standard C library before libucb.a,
896 + # otherwise we get lots of broken stuff we don't want.
897 + XM_CLIBS = -L/usr/lib -lm -lnet -lresolv -lform -lsocket -lc \
898 + /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 + XM_CLIBS = -L/usr/lib -lm -lnet -lresolv -lform -lsocket -lc \
916 + /usr/ucblib/libucb.a -lnsl
917 ===================================================================
918 *** demangle.c Wed Jul 15 11:42:27 1992
919 --- demangle.c Wed Jul 15 11:25:14 1992
922 the appropriate target configuration file. */
924 #ifndef DEFAULT_DEMANGLING_STYLE
925 ! # define DEFAULT_DEMANGLING_STYLE AUTO_DEMANGLING_STYLE_STRING
928 /* The current demangling style in affect. Global so that the demangler
930 the appropriate target configuration file. */
932 #ifndef DEFAULT_DEMANGLING_STYLE
933 ! # define DEFAULT_DEMANGLING_STYLE LUCID_DEMANGLING_STYLE_STRING
936 /* The current demangling style in affect. Global so that the demangler