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 *** 1.4 1992/06/10 02:05:16
7 --- config/amix.mh 1992/07/21 20:18:16
12 # SVR4 puts the BSD compatible install in /usr/ucb.
13 INSTALL = /usr/ucb/install -c
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 + ENERGIZE_LIB = energize/libconn.a
19 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
20 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
22 + # These are the libs that are needed for the Energize version of gdb on
23 + # SVR4. Note that we MUST include the standard C library before libucb.a,
24 + # otherwise we get lots of broken stuff we don't want.
25 + ENERGIZE_LIB = energize/libconn.a
26 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
27 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
28 ===================================================================
29 *** 1.4 1992/06/15 19:25:13
30 --- config/ncr3000.mh 1992/09/15 01:51:32
34 # The /usr/ucb/install program is incompatible (complains about unknown
35 # group staff). Use good old cp...
38 + # These are the libs that are needed for the Energize version of gdb on
39 + # SVR4. Note that we MUST include the standard C library before libucb.a,
40 + # otherwise we get lots of broken stuff we don't want.
41 + XM_CLIBS = -L/usr/lib -lm -lnet -lresolv -lform -lsocket -lnsl -lc
43 + # These are the libs that are needed for the Energize version of gdb on
44 + # SVR4. Note that we MUST include the standard C library before libucb.a,
45 + # otherwise we get lots of broken stuff we don't want.
46 + ENERGIZE_LIB = energize/libconn.a
47 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
48 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
50 + # These are the libs that are needed for the Energize version of gdb on
51 + # SVR4. Note that we MUST include the standard C library before libucb.a,
52 + # otherwise we get lots of broken stuff we don't want.
53 + ENERGIZE_LIB = energize/libconn.a
54 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
55 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
56 ===================================================================
57 diff -c -r2.70 .Sanitize
58 *** 2.70 1992/09/03 16:25:59
59 --- .Sanitize 1992/09/15 05:19:46
72 ===================================================================
73 *** 1.181 1992/09/08 22:33:31
74 --- Makefile.in 1992/09/15 05:21:40
78 READLINE_DEP = $$(READLINE_DIR)
79 RL_LIB = ./../readline${subdir}/libreadline.a
81 + # Energize libraries. Works slightly differently than other libraries
82 + # because it is a gdb subdir and we try to build the energize library
83 + # if it doesn't exist, unlike readline, bfd, mmalloc, etc. Note
84 + # that SDIR and BDIR will be different if we configured with -srcdir.
85 + ENERGIZE_DIR = energize
86 + ENERGIZE_LIB = ${ENERGIZE_DIR}/libconn.a
88 # All the includes used for CFLAGS and for lint.
89 # -I. for config files.
90 # -I${srcdir} possibly for regex.h also.
93 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
94 # TERMCAP comes after readline, since readline depends on it.
95 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY} \
96 ! ${XM_CLIBS} ${TM_CLIBS}
97 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY} \
98 ${RL_LIB} ${MMALLOC_LIB}
100 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
101 ! ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES}
106 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
107 # TERMCAP comes after readline, since readline depends on it.
108 CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY} \
109 ! ${ENERGIZE_LIB} ${XM_CLIBS} ${TM_CLIBS}
110 CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY} \
111 ${RL_LIB} ${MMALLOC_LIB}
113 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
114 ! ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES} \
121 mem-break.c target.c inftarg.c \
122 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c stabsread.c \
123 ieee-float.c language.c parse.c buildsym.c objfiles.c \
124 ! minsyms.c mipsread.c maint.c
126 # Source files in subdirectories (which will be handled separately by
129 mem-break.c target.c inftarg.c \
130 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c stabsread.c \
131 ieee-float.c language.c parse.c buildsym.c objfiles.c \
132 ! minsyms.c mipsread.c maint.c energize.c
134 # Source files in subdirectories (which will be handled separately by
138 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
139 copying.o $(DEPFILES) mem-break.o target.o \
140 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
141 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o \
142 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o \
146 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
147 copying.o $(DEPFILES) mem-break.o target.o \
148 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
149 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o energize.o \
150 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o \
156 NTSSTART = kdb-start.o
160 # For now, shortcut the "configure GDB for fewer languages" stuff.
161 YYFILES = c-exp.tab.c m2-exp.tab.c
164 NTSSTART = kdb-start.o
166 ! SUBDIRS = doc ${ENERGIZE_DIR}
168 # For now, shortcut the "configure GDB for fewer languages" stuff.
169 YYFILES = c-exp.tab.c m2-exp.tab.c
173 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
174 echo "Load .c corresponding to:" $(DEPFILES)
177 + @(cd ${ENERGIZE_DIR}; \
179 + "against=$(against)" \
181 + "AR_FLAGS=$(AR_FLAGS)" \
183 + "CFLAGS=$(CFLAGS)" \
184 + "RANLIB=$(RANLIB)" \
185 + "MAKEINFO=$(MAKEINFO)" \
186 + "INSTALL=$(INSTALL)" \
187 + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
188 + "INSTALL_DATA=$(INSTALL_DATA)" \
191 # This is useful when debugging GDB, because some Unix's don't let you run GDB
192 # on itself without copying the executable. So "make gdb1" will make
193 ===================================================================
194 *** 1.46 1992/09/15 06:27:18
195 --- breakpoint.c 1992/09/15 06:33:37
199 b->cond_string = NULL;
201 printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
202 + energize_condition_breakpoint(b);
209 typed in or the decompiled expression. */
210 b->cond_string = savestring (arg, strlen (arg));
211 b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
212 + energize_condition_breakpoint(b);
214 error ("Junk at end of expression");
219 if (b->number == bnum)
221 ! if (from_tty && input_from_terminal_p ())
222 printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
223 End with a line saying just \"end\".\n", bnum);
224 l = read_command_lines ();
225 free_command_lines (&b->commands);
229 error ("No breakpoint number %d.", bnum);
232 if (b->number == bnum)
234 ! if ((from_tty && input_from_terminal_p ()) || energize)
235 printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
236 End with a line saying just \"end\".\n", bnum);
237 l = read_command_lines ();
238 free_command_lines (&b->commands);
240 + energize_commands_breakpoint(b);
243 error ("No breakpoint number %d.", bnum);
250 + energize_ignore_breakpoint(b);
258 struct breakpoint *b;
260 + energize_create_breakpoint(b);
268 register struct breakpoint *b;
271 + energize_delete_breakpoint(bpt);
274 target_remove_breakpoint(bpt->address, bpt->shadow_contents);
279 if (b->number == bptnum)
281 b->ignore_count = count;
282 + energize_ignore_breakpoint(b);
288 struct breakpoint *b;
291 ! b->ignore_count = 0;
294 /* Command to set ignore-count of breakpoint N to COUNT. */
296 struct breakpoint *b;
300 ! b->ignore_count = 0;
301 ! energize_ignore_breakpoint(b);
305 /* Command to set ignore-count of breakpoint N to COUNT. */
310 bpt->enable = enabled;
312 + energize_enable_breakpoint(bpt);
314 if (xgdb_verbose && bpt->type == bp_breakpoint)
315 printf_filtered ("breakpoint #%d enabled\n", bpt->number);
320 disable_breakpoint (bpt)
321 struct breakpoint *bpt;
323 + energize_disable_breakpoint(bpt);
325 bpt->enable = disabled;
327 if (xgdb_verbose && bpt->type == bp_breakpoint)
328 ===================================================================
329 *** 1.18 1992/07/10 17:22:30
330 --- command.c 1992/07/23 01:42:36
335 error ("gdb internal error: bad cmd_type in do_setshow_command");
336 (*c->function.sfunc) (NULL, from_tty, c);
341 /* Show all the settings in a list of show commands. */
347 ! while ((rc = wait (&status)) != pid && rc != -1)
350 error ("Fork failed");
355 ! while ((rc = energize_wait (&status)) != pid && rc != -1)
358 error ("Fork failed");
359 ===================================================================
360 *** 1.63 1992/09/03 16:26:02
361 --- configure.in 1992/09/15 05:19:56
367 target_dependent=true
369 ! configdirs="energize doc"
372 target_dependent=true
373 ===================================================================
374 *** 1.48 1992/09/15 08:55:59
375 --- defs.h 1992/09/15 08:54:35
379 #define MAINTENANCE_CMDS 1
382 + #include "energize.h"
384 #endif /* !defined (DEFS_H) */
385 ===================================================================
386 *** 2.5 1992/09/03 16:26:03
387 --- demangle.c 1992/09/15 05:19:59
390 the appropriate target configuration file. */
392 #ifndef DEFAULT_DEMANGLING_STYLE
393 ! # define DEFAULT_DEMANGLING_STYLE AUTO_DEMANGLING_STYLE_STRING
396 /* String name for the current demangling style. Set by the "set demangling"
398 the appropriate target configuration file. */
400 #ifndef DEFAULT_DEMANGLING_STYLE
401 ! # define DEFAULT_DEMANGLING_STYLE LUCID_DEMANGLING_STYLE_STRING
404 /* String name for the current demangling style. Set by the "set demangling"
405 ===================================================================
406 *** 1.28 1992/07/23 04:41:45
407 --- inflow.c 1992/08/27 22:43:15
410 static short pgrp_inferior;
411 static short pgrp_ours;
412 # else /* not def SHORT_PGRP */
413 ! static int pgrp_inferior;
414 static int pgrp_ours;
415 # endif /* not def SHORT_PGRP */
416 #else /* not def TIOCGPGRP */
418 static short pgrp_inferior;
419 static short pgrp_ours;
420 # else /* not def SHORT_PGRP */
422 static int pgrp_ours;
423 # endif /* not def SHORT_PGRP */
424 #else /* not def TIOCGPGRP */
425 ===================================================================
426 *** 1.54 1992/09/02 09:22:09
427 --- infrun.c 1992/09/15 05:20:09
431 Here we must get it up to actual execution of the real program. */
433 inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
434 + energize_new_process();
436 clear_proceed_status ();
444 + energize_new_process();
445 push_target (&child_ops);
447 mark_breakpoints_out ();
448 ===================================================================
449 *** 1.11 1992/03/29 23:21:27
450 --- inftarg.c 1992/09/15 06:37:01
457 ! pid = proc_wait (status);
459 ! pid = wait (status);
461 if (pid == -1) /* No more children to wait for */
463 fprintf (stderr, "Child process unexpectedly missing.\n");
468 ! pid = energize_wait (status);
469 if (pid == -1) /* No more children to wait for */
471 fprintf (stderr, "Child process unexpectedly missing.\n");
472 ===================================================================
473 *** 1.52 1992/09/15 06:27:10
474 --- main.c 1992/09/15 06:30:03
478 char *corearg = NULL;
481 + char *energize_id = NULL;
483 /* Pointers to all arguments of +command option. */
488 {"tty", required_argument, 0, 't'},
489 {"baud", required_argument, 0, 'b'},
490 {"b", required_argument, 0, 'b'},
491 + {"context", required_argument, 0, 12},
492 /* Allow machine descriptions to add more options... */
493 #ifdef ADDITIONAL_OPTIONS
502 + energize_id = optarg;
511 /* Run the init function of each source file */
513 + /* Must call this first to setup tty */
514 + energize_initialize (energize_id, execarg);
516 initialize_cmd_lists (); /* This needs to be done first */
517 initialize_all_files ();
518 initialize_main (); /* But that omits this file! Do it now */
521 if (!setjmp (to_top_level))
523 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
525 quit_command ((char *)0, instream == stdin);
529 if (!setjmp (to_top_level))
531 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
533 ! energize_main_loop();
536 quit_command ((char *)0, instream == stdin);
541 else if (c->function.cfunc == NO_FUNCTION)
542 error ("That is not a command, just a help topic.");
544 ! (*c->function.cfunc) (arg, from_tty & caution);
547 /* Tell the user if the language has changed (except first time). */
549 else if (c->function.cfunc == NO_FUNCTION)
550 error ("That is not a command, just a help topic.");
552 ! energize_call_command (c, arg, from_tty & caution);
555 /* Tell the user if the language has changed (except first time). */
561 ! p = command_line_input ((char *) NULL, instream == stdin);
563 /* Treat end of file like "end". */
569 ! p = energize_command_line_input ((char *) NULL, instream == stdin);
571 /* Treat end of file like "end". */
573 ===================================================================
574 *** 1.32 1992/09/15 06:27:00
575 --- printcmd.c 1992/09/15 06:30:06
580 int histindex = record_latest_value (val);
586 + sprintf(buf, "$%d", histindex);
587 + energize_start_variable_annotation(buf, NULL, VALUE_TYPE(val),
588 + VALUE_ADDRESS(val), "");
592 printf_filtered ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
597 if (histindex >= 0) printf_filtered ("$%d = ", histindex);
599 print_formatted (val, format, fmt.size);
600 + energize_end_variable_annotation();
601 printf_filtered ("\n");
603 printf_filtered("\") )\030");
607 standard indentation here is 4 spaces, and val_print indents
608 2 for each recurse. */
609 val = read_var_value (sym, FRAME_INFO_ID (fi));
611 + energize_start_variable_annotation(SYMBOL_NAME(sym), sym,
613 + VALUE_ADDRESS(val), "");
616 val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
617 stream, 0, 0, 2, Val_no_prettyprint);
619 fputs_filtered ("???", stream);
621 + energize_end_variable_annotation();
626 ===================================================================
627 *** 1.34 1992/09/11 09:11:04
628 --- stack.c 1992/09/15 05:20:25
632 printf_filtered ("%s in ", local_hex_string(fi->pc));
634 ! fputs_demangled (fname, stdout, 0);
635 fputs_filtered (" (...)\n", stdout);
640 printf_filtered ("%s in ", local_hex_string(fi->pc));
643 ! energize_annotate_function(fname, 0, level);
645 ! fputs_demangled (fname, stdout, 0);
646 fputs_filtered (" (...)\n", stdout);
652 if (fi->pc != sal.pc || !sal.symtab)
653 printf_filtered ("%s in ", local_hex_string(fi->pc));
654 ! fputs_demangled (funname ? funname : "??", stdout, 0);
656 fputs_filtered (" (", stdout);
660 if (fi->pc != sal.pc || !sal.symtab)
661 printf_filtered ("%s in ", local_hex_string(fi->pc));
663 ! energize_annotate_function(funname ? funname : "??", 0, level);
665 ! fputs_demangled (funname ? funname : "??", stdout, 0);
667 fputs_filtered (" (", stdout);
672 if (addressprint && mid_statement)
673 printf_filtered ("%s\t", local_hex_string(fi->pc));
674 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
676 current_source_line = max (sal.line - lines_to_list/2, 1);
680 if (addressprint && mid_statement)
681 printf_filtered ("%s\t", local_hex_string(fi->pc));
683 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
685 current_source_line = max (sal.line - lines_to_list/2, 1);
691 printf_filtered (" in ");
692 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
699 printf_filtered (" in ");
701 ! energize_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS,
702 ! selected_frame_level);
704 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
708 ===================================================================
709 *** 1.57 1992/09/15 06:27:08
710 --- symfile.c 1992/09/15 06:30:09
717 + energize_symbol_file(objfile);
722 ===================================================================
723 *** 1.60 1992/09/15 06:26:56
724 --- utils.c 1992/09/15 08:57:41
729 ctlstr = va_arg (args, char *);
730 vfprintf_filtered (stdout, ctlstr, args);
732 printf_filtered ("(y or n) ");
734 ! answer = fgetc (stdin);
735 ! clearerr (stdin); /* in case of C-d */
736 ! if (answer == EOF) /* C-d */
738 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
741 ! ans2 = fgetc (stdin);
744 ! while (ans2 != EOF && ans2 != '\n');
751 ctlstr = va_arg (args, char *);
752 + energize_query (ctlstr, args);
753 vfprintf_filtered (stdout, ctlstr, args);
754 printf_filtered ("(y or n) ");
759 ! buf = energize_command_line_input(0, 0);
760 ! answer = buf ? *buf : 'Y';
761 ! energize_acknowledge_query(buf);
766 ! answer = fgetc (stdin);
767 ! clearerr (stdin); /* in case of C-d */
768 ! if (answer == EOF) /* C-d */
770 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
773 ! ans2 = fgetc (stdin);
776 ! while (ans2 != EOF && ans2 != '\n');
786 printf_filtered ("Please answer y or n.\n");
799 + energize_fputs(linebuffer);
803 /* Don't do any filtering if it is disabled. */
805 || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
806 ===================================================================
807 *** 1.54 1992/09/15 06:27:03
808 --- valprint.c 1992/09/15 06:30:13
812 struct type **dont_print;
814 int i, len, n_baseclasses;
815 + char expr_tag[100]; /* Energize */
817 check_stub_type (type);
822 fprint_symbol (stream, TYPE_FIELD_NAME (type, i));
823 fputs_filtered (" = ", stream);
826 + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i));
828 + energize_start_variable_annotation(expr_tag, NULL,
829 + TYPE_FIELD_TYPE(type, i),
830 + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8),
832 if (TYPE_FIELD_PACKED (type, i))
838 valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
839 0, stream, format, 0, recurse + 1, pretty);
841 + energize_end_variable_annotation();
849 /* Number of repetitions we have detected so far. */
851 + char expr_tag[100]; /* Energize */
861 + sprintf(expr_tag, "[%d]", i);
862 + energize_start_variable_annotation(expr_tag, NULL,
864 + (CORE_ADDR) (valaddr + i * eltlen),
866 if (reps > REPEAT_COUNT_THRESHOLD)
868 val_print (elttype, valaddr + i * eltlen,
872 recurse + 1, pretty);
875 + energize_end_variable_annotation();
878 fprintf_filtered (stream, "...");