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 *** config/ncr3000.mh.orig Mon Jun 15 12:25:13 1992
7 --- config/ncr3000.mh Mon Aug 24 19:22:31 1992
11 # The /usr/ucb/install program is incompatible (complains about unknown
12 # group staff). Use good old cp...
15 + # These are the libs that are needed for the Energize version of gdb on
16 + # SVR4. Note that we MUST include the standard C library before libucb.a,
17 + # otherwise we get lots of broken stuff we don't want.
18 + XM_CLIBS = -L/usr/lib -lm -lnet -lresolv -lform -lsocket -lc \
19 + /usr/ucblib/libucb.a -lnsl
20 *** Makefile.in.orig Tue Aug 18 14:59:22 1992
21 --- Makefile.in Mon Aug 24 19:24:01 1992
25 READLINE_DEP = $$(READLINE_DIR)
26 RL_LIB = ./../readline${subdir}/libreadline.a
28 + # Energize libraries. Works slightly differently than other libraries
29 + # because it is a gdb subdir and we try to build the energize library
30 + # if it doesn't exist, unlike readline, bfd, mmalloc, etc. Note
31 + # that SDIR and BDIR will be different if we configured with -srcdir.
32 + ENERGIZE_DIR = energize
33 + ENERGIZE_LIB = ${ENERGIZE_DIR}/libconn.a
35 # All the includes used for CFLAGS and for lint.
36 # -I. for config files.
37 # -I${srcdir} possibly for regex.h also.
40 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
41 # TERMCAP comes after readline, since readline depends on it.
42 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
43 ! ${XM_CLIBS} ${TM_CLIBS}
44 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
45 ${RL_LIB} ${MMALLOC_LIB}
47 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
48 ! ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES}
53 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
54 # TERMCAP comes after readline, since readline depends on it.
55 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
56 ! ${ENERGIZE_LIB} ${XM_CLIBS} ${TM_CLIBS}
57 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
58 ${RL_LIB} ${MMALLOC_LIB}
60 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
61 ! ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES} \
68 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
69 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c stabsread.c \
70 ieee-float.c language.c parse.c buildsym.c objfiles.c \
71 ! minsyms.c mipsread.c maint.c
73 # Source files in subdirectories (which will be handled separately by
76 ${DEMANGLER}.c mem-break.c target.c inftarg.c \
77 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c stabsread.c \
78 ieee-float.c language.c parse.c buildsym.c objfiles.c \
79 ! minsyms.c mipsread.c maint.c energize.c
81 # Source files in subdirectories (which will be handled separately by
85 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
86 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
87 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
88 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o \
89 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o \
93 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
94 copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \
95 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
96 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o energize.o \
97 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o \
103 NTSSTART = kdb-start.o
107 # For now, shortcut the "configure GDB for fewer languages" stuff.
108 YYFILES = c-exp.tab.c m2-exp.tab.c
111 NTSSTART = kdb-start.o
113 ! SUBDIRS = doc ${ENERGIZE_DIR}
115 # For now, shortcut the "configure GDB for fewer languages" stuff.
116 YYFILES = c-exp.tab.c m2-exp.tab.c
120 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
121 echo "Load .c corresponding to:" $(DEPFILES)
124 + @(cd ${ENERGIZE_DIR}; \
126 + "against=$(against)" \
128 + "AR_FLAGS=$(AR_FLAGS)" \
130 + "CFLAGS=$(CFLAGS)" \
131 + "RANLIB=$(RANLIB)" \
132 + "MAKEINFO=$(MAKEINFO)" \
133 + "INSTALL=$(INSTALL)" \
134 + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
135 + "INSTALL_DATA=$(INSTALL_DATA)" \
138 # This is useful when debugging GDB, because some Unix's don't let you run GDB
139 # on itself without copying the executable. So "make gdb1" will make
142 -e '/extern.*free/d' \
143 < y.tab.c > m2-exp.tab.c
147 main.o: ${srcdir}/main.c
148 ${CC} -c ${INTERNAL_CFLAGS} -I${READLINE_DIR} $<
150 *** breakpoint.c.orig Sun Aug 23 11:09:10 1992
151 --- breakpoint.c Mon Aug 24 19:22:26 1992
155 b->cond_string = NULL;
157 printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
158 + energize_condition_breakpoint(b);
165 typed in or the decompiled expression. */
166 b->cond_string = savestring (arg, strlen (arg));
167 b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
168 + energize_condition_breakpoint(b);
170 error ("Junk at end of expression");
175 if (b->number == bnum)
177 ! if (from_tty && input_from_terminal_p ())
178 printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
179 End with a line saying just \"end\".\n", bnum);
180 l = read_command_lines ();
181 free_command_lines (&b->commands);
185 error ("No breakpoint number %d.", bnum);
188 if (b->number == bnum)
190 ! if ((from_tty && input_from_terminal_p ()) || energize)
191 printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
192 End with a line saying just \"end\".\n", bnum);
193 l = read_command_lines ();
194 free_command_lines (&b->commands);
196 + energize_commands_breakpoint(b);
199 error ("No breakpoint number %d.", bnum);
206 + energize_ignore_breakpoint(b);
214 struct breakpoint *b;
216 + energize_create_breakpoint(b);
224 register struct breakpoint *b;
227 + energize_delete_breakpoint(bpt);
230 target_remove_breakpoint(bpt->address, bpt->shadow_contents);
235 if (b->number == bptnum)
237 b->ignore_count = count;
238 + energize_ignore_breakpoint(b);
244 struct breakpoint *b;
247 ! b->ignore_count = 0;
250 /* Command to set ignore-count of breakpoint N to COUNT. */
252 struct breakpoint *b;
256 ! b->ignore_count = 0;
257 ! energize_ignore_breakpoint(b);
261 /* Command to set ignore-count of breakpoint N to COUNT. */
266 bpt->enable = enabled;
268 + energize_enable_breakpoint(bpt);
270 if (xgdb_verbose && bpt->type == bp_breakpoint)
271 printf ("breakpoint #%d enabled\n", bpt->number);
276 disable_breakpoint (bpt)
277 struct breakpoint *bpt;
279 + energize_disable_breakpoint(bpt);
281 bpt->enable = disabled;
283 if (xgdb_verbose && bpt->type == bp_breakpoint)
284 *** command.c.orig Fri Jul 10 10:22:30 1992
285 --- command.c Mon Aug 24 19:22:26 1992
291 ! while ((rc = wait (&status)) != pid && rc != -1)
294 error ("Fork failed");
299 ! while ((rc = energize_wait (&status)) != pid && rc != -1)
302 error ("Fork failed");
303 *** configure.in.orig Tue Aug 18 11:35:50 1992
304 --- configure.in Mon Aug 24 19:22:26 1992
310 target_dependent=true
312 ! configdirs="energize doc"
315 target_dependent=true
316 *** defs.h.orig Mon Jul 20 21:14:28 1992
317 --- defs.h Mon Aug 24 19:22:27 1992
321 #define MAINTENANCE_CMDS 1
324 + #include "energize.h"
326 #endif /* !defined (DEFS_H) */
327 *** inflow.c.orig Wed Jul 22 21:41:45 1992
328 --- inflow.c Mon Aug 24 19:22:27 1992
331 static short pgrp_inferior;
332 static short pgrp_ours;
333 # else /* not def SHORT_PGRP */
334 ! static int pgrp_inferior;
335 static int pgrp_ours;
336 # endif /* not def SHORT_PGRP */
337 #else /* not def TIOCGPGRP */
339 static short pgrp_inferior;
340 static short pgrp_ours;
341 # else /* not def SHORT_PGRP */
343 static int pgrp_ours;
344 # endif /* not def SHORT_PGRP */
345 #else /* not def TIOCGPGRP */
346 *** infrun.c.orig Mon Aug 24 12:00:30 1992
347 --- infrun.c Mon Aug 24 19:22:28 1992
351 Here we must get it up to actual execution of the real program. */
353 inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
354 + energize_new_process();
356 clear_proceed_status ();
364 + energize_new_process();
365 push_target (&child_ops);
367 mark_breakpoints_out ();
368 *** inftarg.c.orig Sun Mar 29 15:21:27 1992
369 --- inftarg.c Mon Aug 24 19:22:28 1992
373 pid = proc_wait (status);
375 ! pid = wait (status);
377 if (pid == -1) /* No more children to wait for */
381 pid = proc_wait (status);
383 ! pid = energize_wait (status);
385 if (pid == -1) /* No more children to wait for */
387 *** main.c.orig Fri Jul 10 10:22:33 1992
388 --- main.c Mon Aug 24 19:22:29 1992
392 char *corearg = NULL;
395 + char *energize_id = NULL;
397 /* Pointers to all arguments of +command option. */
402 {"tty", required_argument, 0, 't'},
403 {"baud", required_argument, 0, 'b'},
404 {"b", required_argument, 0, 'b'},
405 + {"context", required_argument, 0, 12},
406 /* Allow machine descriptions to add more options... */
407 #ifdef ADDITIONAL_OPTIONS
416 + energize_id = optarg;
425 do_cleanups (ALL_CLEANUPS);
427 + energize_initialize (energize_id, execarg);
431 && strcmp (execarg, symarg) == 0)
434 if (!setjmp (to_top_level))
436 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
438 quit_command ((char *)0, instream == stdin);
442 if (!setjmp (to_top_level))
444 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
446 ! energize_main_loop();
449 quit_command ((char *)0, instream == stdin);
454 else if (c->function.cfunc == NO_FUNCTION)
455 error ("That is not a command, just a help topic.");
457 ! (*c->function.cfunc) (arg, from_tty & caution);
460 /* Tell the user if the language has changed (except first time). */
462 else if (c->function.cfunc == NO_FUNCTION)
463 error ("That is not a command, just a help topic.");
465 ! energize_call_command (c, arg, from_tty & caution);
468 /* Tell the user if the language has changed (except first time). */
474 ! p = command_line_input ((char *) NULL, instream == stdin);
476 /* Treat end of file like "end". */
482 ! p = energize_command_line_input ((char *) NULL, instream == stdin);
484 /* Treat end of file like "end". */
491 ! printf ("%s", prompt);
499 ! printf_filtered ("%s", prompt);
503 *** printcmd.c.orig Sun Jul 5 17:22:52 1992
504 --- printcmd.c Mon Aug 24 19:22:29 1992
509 int histindex = record_latest_value (val);
515 + sprintf(buf, "$%d", histindex);
516 + energize_start_variable_annotation(buf, NULL, VALUE_TYPE(val),
517 + VALUE_ADDRESS(val), "");
521 printf ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
526 if (histindex >= 0) printf_filtered ("$%d = ", histindex);
528 print_formatted (val, format, fmt.size);
529 + energize_end_variable_annotation();
530 printf_filtered ("\n");
536 standard indentation here is 4 spaces, and val_print indents
537 2 for each recurse. */
538 val = read_var_value (sym, FRAME_INFO_ID (fi));
540 + energize_start_variable_annotation(SYMBOL_NAME(sym), sym,
542 + VALUE_ADDRESS(val), "");
545 val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
546 stream, 0, 0, 2, Val_no_prettyprint);
548 fputs_filtered ("???", stream);
550 + energize_end_variable_annotation();
555 *** stack.c.orig Fri Jul 3 20:21:45 1992
556 --- stack.c Mon Aug 24 19:22:30 1992
560 printf_filtered ("%s in ", local_hex_string(fi->pc));
562 ! fputs_demangled (fname, stdout, 0);
563 fputs_filtered (" (...)\n", stdout);
568 printf_filtered ("%s in ", local_hex_string(fi->pc));
571 ! energize_annotate_function(fname, 0, level);
573 ! fputs_demangled (fname, stdout, 0);
574 fputs_filtered (" (...)\n", stdout);
580 if (fi->pc != sal.pc || !sal.symtab)
581 printf_filtered ("%s in ", local_hex_string(fi->pc));
582 ! fputs_demangled (funname ? funname : "??", stdout, 0);
584 fputs_filtered (" (", stdout);
588 if (fi->pc != sal.pc || !sal.symtab)
589 printf_filtered ("%s in ", local_hex_string(fi->pc));
591 ! energize_annotate_function(funname ? funname : "??", 0, level);
593 ! fputs_demangled (funname ? funname : "??", stdout, 0);
595 fputs_filtered (" (", stdout);
600 if (addressprint && mid_statement)
601 printf_filtered ("%s\t", local_hex_string(fi->pc));
602 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
604 current_source_line = max (sal.line - lines_to_list/2, 1);
608 if (addressprint && mid_statement)
609 printf_filtered ("%s\t", local_hex_string(fi->pc));
611 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
613 current_source_line = max (sal.line - lines_to_list/2, 1);
619 printf_filtered (" in ");
620 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
627 printf_filtered (" in ");
629 ! energize_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS,
630 ! selected_frame_level);
632 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
636 *** symfile.c.orig Sun Aug 23 11:09:17 1992
637 --- symfile.c Mon Aug 24 19:22:30 1992
644 + energize_symbol_file(objfile);
649 *** utils.c.orig Sun Aug 23 11:09:21 1992
650 --- utils.c Mon Aug 24 19:22:31 1992
655 /* Automatically answer "yes" if input is not from a terminal. */
656 ! if (!input_from_terminal_p ())
663 /* Automatically answer "yes" if input is not from a terminal. */
664 ! if (!input_from_terminal_p () && !energize)
672 ctlstr = va_arg (args, char *);
673 vfprintf_filtered (stdout, ctlstr, args);
675 printf_filtered ("(y or n) ");
677 ! answer = fgetc (stdin);
678 ! clearerr (stdin); /* in case of C-d */
679 ! if (answer == EOF) /* C-d */
681 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
684 ! ans2 = fgetc (stdin);
687 ! while (ans2 != EOF && ans2 != '\n');
694 ctlstr = va_arg (args, char *);
695 + energize_query (ctlstr, args);
696 vfprintf_filtered (stdout, ctlstr, args);
697 printf_filtered ("(y or n) ");
702 ! buf = energize_command_line_input(0, 0);
703 ! answer = buf ? *buf : 'Y';
704 ! energize_acknowledge_query(buf);
709 ! answer = fgetc (stdin);
710 ! clearerr (stdin); /* in case of C-d */
711 ! if (answer == EOF) /* C-d */
713 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
716 ! ans2 = fgetc (stdin);
719 ! while (ans2 != EOF && ans2 != '\n');
729 printf_filtered ("Please answer y or n.\n");
742 + energize_fputs(linebuffer);
746 /* Don't do any filtering if it is disabled. */
748 || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
749 *** valprint.c.orig Sat Aug 8 23:14:57 1992
750 --- valprint.c Mon Aug 24 19:22:31 1992
754 struct type **dont_print;
756 int i, len, n_baseclasses;
757 + char expr_tag[100]; /* Energize */
759 check_stub_type (type);
764 fprint_symbol (stream, TYPE_FIELD_NAME (type, i));
765 fputs_filtered (" = ", stream);
768 + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i));
770 + energize_start_variable_annotation(expr_tag, NULL,
771 + TYPE_FIELD_TYPE(type, i),
772 + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8),
774 if (TYPE_FIELD_PACKED (type, i))
780 valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
781 0, stream, format, 0, recurse + 1, pretty);
783 + energize_end_variable_annotation();
791 /* Number of repetitions we have detected so far. */
793 + char expr_tag[100]; /* Energize */
803 + sprintf(expr_tag, "[%d]", i);
804 + energize_start_variable_annotation(expr_tag, NULL,
806 + (CORE_ADDR) (valaddr + i * eltlen),
808 if (reps > REPEAT_COUNT_THRESHOLD)
810 val_print (elttype, valaddr + i * eltlen,
814 recurse + 1, pretty);
817 + energize_end_variable_annotation();
820 fprintf_filtered (stream, "...");
821 *** demangle.c.orig Wed Jul 15 12:33:17 1992
822 --- demangle.c Mon Aug 24 19:22:32 1992
825 the appropriate target configuration file. */
827 #ifndef DEFAULT_DEMANGLING_STYLE
828 ! # define DEFAULT_DEMANGLING_STYLE AUTO_DEMANGLING_STYLE_STRING
831 /* The current demangling style in affect. Global so that the demangler
833 the appropriate target configuration file. */
835 #ifndef DEFAULT_DEMANGLING_STYLE
836 ! # define DEFAULT_DEMANGLING_STYLE LUCID_DEMANGLING_STYLE_STRING
839 /* The current demangling style in affect. Global so that the demangler