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 *** 2.71 1992/09/25 17:04:36
7 --- .Sanitize 1992/09/25 23:47:40
20 ===================================================================
21 *** 1.186 1992/09/25 17:03:18
22 --- Makefile.in 1992/09/26 00:20:58
26 READLINE_DEP = $$(READLINE_DIR)
27 RL_LIB = ./../readline${subdir}/libreadline.a
29 + # Energize libraries. Works slightly differently than other libraries
30 + # because it is a gdb subdir and we try to build the energize library
31 + # if it doesn't exist, unlike readline, bfd, mmalloc, etc. Note
32 + # that SDIR and BDIR will be different if we configured with -srcdir.
33 + ENERGIZE_DIR = energize
34 + ENERGIZE_LIB = ${ENERGIZE_DIR}/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} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY} \
44 ! ${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS}
45 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${NAT_CDEPS} \
46 ${BFD_LIB} ${RL_LIB} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY}
49 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
50 # TERMCAP comes after readline, since readline depends on it.
51 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY} \
52 ! ${ENERGIZE_LIB} ${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS}
53 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${NAT_CDEPS} \
54 ${BFD_LIB} ${RL_LIB} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY}
58 mem-break.c target.c inftarg.c \
59 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c stabsread.c \
60 ieee-float.c language.c parse.c buildsym.c objfiles.c \
61 ! minsyms.c mipsread.c maint.c
63 # Source files in subdirectories (which will be handled separately by
66 mem-break.c target.c inftarg.c \
67 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c stabsread.c \
68 ieee-float.c language.c parse.c buildsym.c objfiles.c \
69 ! minsyms.c mipsread.c maint.c energize.c
71 # Source files in subdirectories (which will be handled separately by
75 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
76 copying.o $(DEPFILES) mem-break.o target.o \
77 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
78 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o \
79 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o \
83 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
84 copying.o $(DEPFILES) mem-break.o target.o \
85 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
86 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o energize.o \
87 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o \
93 NTSSTART = kdb-start.o
97 # For now, shortcut the "configure GDB for fewer languages" stuff.
98 YYFILES = c-exp.tab.c m2-exp.tab.c
101 NTSSTART = kdb-start.o
103 ! SUBDIRS = doc ${ENERGIZE_DIR}
105 # For now, shortcut the "configure GDB for fewer languages" stuff.
106 YYFILES = c-exp.tab.c m2-exp.tab.c
110 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
111 echo "Load .c corresponding to:" $(DEPFILES)
114 + @(cd ${ENERGIZE_DIR}; \
116 + "against=$(against)" \
118 + "AR_FLAGS=$(AR_FLAGS)" \
120 + "CFLAGS=$(CFLAGS)" \
121 + "RANLIB=$(RANLIB)" \
122 + "MAKEINFO=$(MAKEINFO)" \
123 + "INSTALL=$(INSTALL)" \
124 + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
125 + "INSTALL_DATA=$(INSTALL_DATA)" \
128 # This is useful when debugging GDB, because some Unix's don't let you run GDB
129 # on itself without copying the executable. So "make gdb1" will make
130 ===================================================================
131 *** 1.47 1992/09/19 11:47:08
132 --- breakpoint.c 1992/09/25 23:47:48
136 b->cond_string = NULL;
138 printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
139 + energize_condition_breakpoint(b);
146 typed in or the decompiled expression. */
147 b->cond_string = savestring (arg, strlen (arg));
148 b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
149 + energize_condition_breakpoint(b);
151 error ("Junk at end of expression");
156 l = read_command_lines ();
157 free_command_lines (&b->commands);
159 + energize_commands_breakpoint(b);
162 error ("No breakpoint number %d.", bnum);
169 + energize_ignore_breakpoint(b);
177 struct breakpoint *b;
179 + energize_create_breakpoint(b);
187 register struct breakpoint *b;
190 + energize_delete_breakpoint(bpt);
193 target_remove_breakpoint(bpt->address, bpt->shadow_contents);
198 if (b->number == bptnum)
200 b->ignore_count = count;
201 + energize_ignore_breakpoint(b);
207 struct breakpoint *b;
210 ! b->ignore_count = 0;
213 /* Command to set ignore-count of breakpoint N to COUNT. */
215 struct breakpoint *b;
219 ! b->ignore_count = 0;
220 ! energize_ignore_breakpoint(b);
224 /* Command to set ignore-count of breakpoint N to COUNT. */
229 bpt->enable = enabled;
231 + energize_enable_breakpoint(bpt);
233 if (xgdb_verbose && bpt->type == bp_breakpoint)
234 printf_filtered ("breakpoint #%d enabled\n", bpt->number);
239 disable_breakpoint (bpt)
240 struct breakpoint *bpt;
242 + energize_disable_breakpoint(bpt);
244 bpt->enable = disabled;
246 if (xgdb_verbose && bpt->type == bp_breakpoint)
247 ===================================================================
248 *** 1.18 1992/07/10 17:22:30
249 --- command.c 1992/09/18 19:23:13
254 error ("gdb internal error: bad cmd_type in do_setshow_command");
255 (*c->function.sfunc) (NULL, from_tty, c);
260 /* Show all the settings in a list of show commands. */
266 ! while ((rc = wait (&status)) != pid && rc != -1)
269 error ("Fork failed");
274 ! while ((rc = energize_shell_wait (&status)) != pid && rc != -1)
277 error ("Fork failed");
278 ===================================================================
279 *** 1.67 1992/09/21 20:01:00
280 --- configure.in 1992/09/25 23:47:53
288 ! configdirs="energize doc"
292 ===================================================================
293 *** 1.48 1992/09/15 08:55:59
294 --- defs.h 1992/09/15 08:54:35
298 #define MAINTENANCE_CMDS 1
301 + #include "energize.h"
303 #endif /* !defined (DEFS_H) */
304 ===================================================================
305 *** 2.5 1992/09/03 16:26:03
306 --- demangle.c 1992/09/15 05:19:59
309 the appropriate target configuration file. */
311 #ifndef DEFAULT_DEMANGLING_STYLE
312 ! # define DEFAULT_DEMANGLING_STYLE AUTO_DEMANGLING_STYLE_STRING
315 /* String name for the current demangling style. Set by the "set demangling"
317 the appropriate target configuration file. */
319 #ifndef DEFAULT_DEMANGLING_STYLE
320 ! # define DEFAULT_DEMANGLING_STYLE LUCID_DEMANGLING_STYLE_STRING
323 /* String name for the current demangling style. Set by the "set demangling"
324 ===================================================================
325 *** 1.29 1992/09/25 19:19:00
326 --- inflow.c 1992/09/25 23:48:13
329 static short pgrp_inferior;
330 static short pgrp_ours;
331 # else /* not def SHORT_PGRP */
332 ! static int pgrp_inferior;
333 static int pgrp_ours;
334 # endif /* not def SHORT_PGRP */
335 #else /* not def TIOCGPGRP */
337 static short pgrp_inferior;
338 static short pgrp_ours;
339 # else /* not def SHORT_PGRP */
341 static int pgrp_ours;
342 # endif /* not def SHORT_PGRP */
343 #else /* not def TIOCGPGRP */
344 ===================================================================
345 *** 1.14 1992/09/25 19:19:08
346 --- inftarg.c 1992/09/26 00:25:51
353 ! pid = proc_wait (status);
355 ! pid = wait (status);
357 if (pid == -1) /* No more children to wait for */
359 fprintf (stderr, "Child process unexpectedly missing.\n");
364 ! pid = energize_wait (status);
365 if (pid == -1) /* No more children to wait for */
367 fprintf (stderr, "Child process unexpectedly missing.\n");
374 + energize_new_process();
375 push_target (&child_ops);
377 mark_breakpoints_out ();
381 Here we must get it up to actual execution of the real program. */
383 inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
384 + energize_new_process();
386 clear_proceed_status ();
388 ===================================================================
389 *** 1.56 1992/09/22 05:23:29
390 --- main.c 1992/09/25 23:48:21
394 char *corearg = NULL;
397 + char *energize_id = NULL;
399 /* Pointers to all arguments of +command option. */
404 {"tty", required_argument, 0, 't'},
405 {"baud", required_argument, 0, 'b'},
406 {"b", required_argument, 0, 'b'},
407 + {"context", required_argument, 0, 12},
408 /* Allow machine descriptions to add more options... */
409 #ifdef ADDITIONAL_OPTIONS
418 + energize_id = optarg;
427 /* Run the init function of each source file */
429 + /* Must call this first to setup tty */
430 + energize_initialize (energize_id, execarg);
432 initialize_cmd_lists (); /* This needs to be done first */
433 initialize_all_files ();
434 initialize_main (); /* But that omits this file! Do it now */
437 if (!setjmp (to_top_level))
439 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
441 quit_command ((char *)0, instream == stdin);
445 if (!setjmp (to_top_level))
447 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
449 ! energize_main_loop();
452 quit_command ((char *)0, instream == stdin);
457 else if (c->function.cfunc == NO_FUNCTION)
458 error ("That is not a command, just a help topic.");
460 ! (*c->function.cfunc) (arg, from_tty & caution);
463 /* Tell the user if the language has changed (except first time). */
465 else if (c->function.cfunc == NO_FUNCTION)
466 error ("That is not a command, just a help topic.");
468 ! energize_call_command (c, arg, from_tty & caution);
471 /* Tell the user if the language has changed (except first time). */
477 ! p = command_line_input ((char *) NULL, instream == stdin);
479 /* Treat end of file like "end". */
485 ! p = energize_command_line_input ((char *) NULL, instream == stdin);
487 /* Treat end of file like "end". */
489 ===================================================================
490 *** 1.32 1992/09/15 06:27:00
491 --- printcmd.c 1992/09/15 06:30:06
496 int histindex = record_latest_value (val);
502 + sprintf(buf, "$%d", histindex);
503 + energize_start_variable_annotation(buf, NULL, VALUE_TYPE(val),
504 + VALUE_ADDRESS(val), "");
508 printf_filtered ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
513 if (histindex >= 0) printf_filtered ("$%d = ", histindex);
515 print_formatted (val, format, fmt.size);
516 + energize_end_variable_annotation();
517 printf_filtered ("\n");
519 printf_filtered("\") )\030");
523 standard indentation here is 4 spaces, and val_print indents
524 2 for each recurse. */
525 val = read_var_value (sym, FRAME_INFO_ID (fi));
527 + energize_start_variable_annotation(SYMBOL_NAME(sym), sym,
529 + VALUE_ADDRESS(val), "");
532 val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
533 stream, 0, 0, 2, Val_no_prettyprint);
535 fputs_filtered ("???", stream);
537 + energize_end_variable_annotation();
542 ===================================================================
543 *** 1.35 1992/09/18 09:20:00
544 --- stack.c 1992/09/25 23:48:37
548 printf_filtered ("%s in ", local_hex_string(fi->pc));
550 ! fputs_demangled (fname, stdout, 0);
551 fputs_filtered (" (...)\n", stdout);
556 printf_filtered ("%s in ", local_hex_string(fi->pc));
559 ! energize_annotate_function(fname, 0, level);
561 ! fputs_demangled (fname, stdout, 0);
562 fputs_filtered (" (...)\n", stdout);
568 if (fi->pc != sal.pc || !sal.symtab)
569 printf_filtered ("%s in ", local_hex_string(fi->pc));
570 ! fputs_demangled (funname ? funname : "??", stdout, 0);
572 fputs_filtered (" (", stdout);
576 if (fi->pc != sal.pc || !sal.symtab)
577 printf_filtered ("%s in ", local_hex_string(fi->pc));
579 ! energize_annotate_function(funname ? funname : "??", 0, level);
581 ! fputs_demangled (funname ? funname : "??", stdout, 0);
583 fputs_filtered (" (", stdout);
588 if (addressprint && mid_statement)
589 printf_filtered ("%s\t", local_hex_string(fi->pc));
590 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
592 current_source_line = max (sal.line - lines_to_list/2, 1);
596 if (addressprint && mid_statement)
597 printf_filtered ("%s\t", local_hex_string(fi->pc));
599 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
601 current_source_line = max (sal.line - lines_to_list/2, 1);
607 printf_filtered (" in ");
608 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
615 printf_filtered (" in ");
617 ! energize_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS,
618 ! selected_frame_level);
620 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
624 ===================================================================
625 *** 1.58 1992/09/19 16:55:36
626 --- symfile.c 1992/09/25 23:48:39
633 + energize_symbol_file(objfile);
638 ===================================================================
639 *** 1.62 1992/09/18 09:21:36
640 --- utils.c 1992/09/25 23:48:47
645 ctlstr = va_arg (args, char *);
646 vfprintf_filtered (stdout, ctlstr, args);
648 printf_filtered ("(y or n) ");
650 ! answer = fgetc (stdin);
651 ! clearerr (stdin); /* in case of C-d */
652 ! if (answer == EOF) /* C-d */
654 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
657 ! ans2 = fgetc (stdin);
660 ! while (ans2 != EOF && ans2 != '\n');
667 ctlstr = va_arg (args, char *);
668 + energize_query (ctlstr, args);
669 vfprintf_filtered (stdout, ctlstr, args);
670 printf_filtered ("(y or n) ");
675 ! buf = energize_command_line_input(0, 0);
676 ! answer = buf ? *buf : 'Y';
677 ! energize_acknowledge_query(buf);
682 ! answer = fgetc (stdin);
683 ! clearerr (stdin); /* in case of C-d */
684 ! if (answer == EOF) /* C-d */
686 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
689 ! ans2 = fgetc (stdin);
692 ! while (ans2 != EOF && ans2 != '\n');
702 printf_filtered ("Please answer y or n.\n");
715 + energize_fputs(linebuffer);
719 /* Don't do any filtering if it is disabled. */
721 || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
722 ===================================================================
723 *** 1.54 1992/09/15 06:27:03
724 --- valprint.c 1992/09/15 06:30:13
728 struct type **dont_print;
730 int i, len, n_baseclasses;
731 + char expr_tag[100]; /* Energize */
733 check_stub_type (type);
738 fprint_symbol (stream, TYPE_FIELD_NAME (type, i));
739 fputs_filtered (" = ", stream);
742 + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i));
744 + energize_start_variable_annotation(expr_tag, NULL,
745 + TYPE_FIELD_TYPE(type, i),
746 + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8),
748 if (TYPE_FIELD_PACKED (type, i))
754 valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
755 0, stream, format, 0, recurse + 1, pretty);
757 + energize_end_variable_annotation();
765 /* Number of repetitions we have detected so far. */
767 + char expr_tag[100]; /* Energize */
777 + sprintf(expr_tag, "[%d]", i);
778 + energize_start_variable_annotation(expr_tag, NULL,
780 + (CORE_ADDR) (valaddr + i * eltlen),
782 if (reps > REPEAT_COUNT_THRESHOLD)
784 val_print (elttype, valaddr + i * eltlen,
788 recurse + 1, pretty);
791 + energize_end_variable_annotation();
794 fprintf_filtered (stream, "...");
795 ===================================================================
796 *** 1.4 1992/06/10 02:05:16
797 --- config/amix.mh 1992/07/21 20:18:16
802 # SVR4 puts the BSD compatible install in /usr/ucb.
803 INSTALL = /usr/ucb/install -c
805 + # These are the libs that are needed for the Energize version of gdb on
806 + # SVR4. Note that we MUST include the standard C library before libucb.a,
807 + # otherwise we get lots of broken stuff we don't want.
808 + ENERGIZE_LIB = energize/libconn.a
809 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
810 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
812 + # These are the libs that are needed for the Energize version of gdb on
813 + # SVR4. Note that we MUST include the standard C library before libucb.a,
814 + # otherwise we get lots of broken stuff we don't want.
815 + ENERGIZE_LIB = energize/libconn.a
816 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
817 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
818 ===================================================================
819 *** 1.4 1992/06/15 19:25:13
820 --- config/ncr3000.mh 1992/09/15 01:51:32
824 # The /usr/ucb/install program is incompatible (complains about unknown
825 # group staff). Use good old cp...
828 + # These are the libs that are needed for the Energize version of gdb on
829 + # SVR4. Note that we MUST include the standard C library before libucb.a,
830 + # otherwise we get lots of broken stuff we don't want.
831 + XM_CLIBS = -L/usr/lib -lm -lnet -lresolv -lform -lsocket -lnsl -lc
833 + # These are the libs that are needed for the Energize version of gdb on
834 + # SVR4. Note that we MUST include the standard C library before libucb.a,
835 + # otherwise we get lots of broken stuff we don't want.
836 + ENERGIZE_LIB = energize/libconn.a
837 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
838 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
840 + # These are the libs that are needed for the Energize version of gdb on
841 + # SVR4. Note that we MUST include the standard C library before libucb.a,
842 + # otherwise we get lots of broken stuff we don't want.
843 + ENERGIZE_LIB = energize/libconn.a
844 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
845 + -lsocket -lc /usr/ucblib/libucb.a -lnsl