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.72 1992/09/27 06:48:41
7 --- .Sanitize 1992/09/28 16:15:04
20 ===================================================================
21 *** 1.187 1992/09/26 08:06:30
22 --- Makefile.in 1992/09/28 17:46:22
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 # Libraries and corresponding dependencies for compiling gdb.
42 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
43 # TERMCAP comes after readline, since readline depends on it.
44 ! CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY} \
45 ! ${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS}
46 ! CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${NAT_CDEPS} \
47 ! ${BFD_LIB} ${RL_LIB} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY}
49 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES} ${NAT_ADD_FILES}
50 ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES} ${NAT_ADD_FILES}
52 # Libraries and corresponding dependencies for compiling gdb.
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} ${OPCODES} ${MMALLOC_LIB} \
56 ! ${LIBIBERTY} ${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS} ${ENERGIZE_LIB}
57 ! CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${NAT_CDEPS} ${BFD_LIB} ${RL_LIB} ${OPCODES} \
58 ! ${MMALLOC_LIB} ${LIBIBERTY} ${ENERGIZE_LIB}
60 ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES} ${NAT_ADD_FILES}
61 ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES} ${NAT_ADD_FILES}
64 mem-break.c target.c \
65 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c stabsread.c \
66 ieee-float.c language.c parse.c buildsym.c objfiles.c \
67 ! minsyms.c mipsread.c maint.c
69 # Source files in subdirectories (which will be handled separately by
72 mem-break.c target.c \
73 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c stabsread.c \
74 ieee-float.c language.c parse.c buildsym.c objfiles.c \
75 ! minsyms.c mipsread.c maint.c energize.c
77 # Source files in subdirectories (which will be handled separately by
81 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
82 copying.o $(DEPFILES) mem-break.o target.o \
83 ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
84 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o \
85 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o \
89 command.o utils.o expprint.o environ.o version.o gdbtypes.o \
90 copying.o $(DEPFILES) mem-break.o target.o \
91 ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
92 ! buildsym.o objfiles.o minsyms.o maint.o demangle.o energize.o \
93 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o \
99 NTSSTART = kdb-start.o
103 # For now, shortcut the "configure GDB for fewer languages" stuff.
104 YYFILES = c-exp.tab.c m2-exp.tab.c
107 NTSSTART = kdb-start.o
109 ! SUBDIRS = doc ${ENERGIZE_DIR}
111 # For now, shortcut the "configure GDB for fewer languages" stuff.
112 YYFILES = c-exp.tab.c m2-exp.tab.c
116 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
117 echo "Load .c corresponding to:" $(DEPFILES)
120 + @(cd ${ENERGIZE_DIR}; \
122 + "against=$(against)" \
124 + "AR_FLAGS=$(AR_FLAGS)" \
126 + "CFLAGS=$(CFLAGS)" \
127 + "RANLIB=$(RANLIB)" \
128 + "MAKEINFO=$(MAKEINFO)" \
129 + "INSTALL=$(INSTALL)" \
130 + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
131 + "INSTALL_DATA=$(INSTALL_DATA)" \
134 # This is useful when debugging GDB, because some Unix's don't let you run GDB
135 # on itself without copying the executable. So "make gdb1" will make
136 ===================================================================
137 *** 1.47 1992/09/19 11:47:08
138 --- breakpoint.c 1992/09/28 16:15:05
142 b->cond_string = NULL;
144 printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
145 + energize_condition_breakpoint(b);
152 typed in or the decompiled expression. */
153 b->cond_string = savestring (arg, strlen (arg));
154 b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
155 + energize_condition_breakpoint(b);
157 error ("Junk at end of expression");
162 l = read_command_lines ();
163 free_command_lines (&b->commands);
165 + energize_commands_breakpoint(b);
168 error ("No breakpoint number %d.", bnum);
175 + energize_ignore_breakpoint(b);
183 struct breakpoint *b;
185 + energize_create_breakpoint(b);
193 register struct breakpoint *b;
196 + energize_delete_breakpoint(bpt);
199 target_remove_breakpoint(bpt->address, bpt->shadow_contents);
204 if (b->number == bptnum)
206 b->ignore_count = count;
207 + energize_ignore_breakpoint(b);
213 struct breakpoint *b;
216 ! b->ignore_count = 0;
219 /* Command to set ignore-count of breakpoint N to COUNT. */
221 struct breakpoint *b;
225 ! b->ignore_count = 0;
226 ! energize_ignore_breakpoint(b);
230 /* Command to set ignore-count of breakpoint N to COUNT. */
235 bpt->enable = enabled;
237 + energize_enable_breakpoint(bpt);
239 if (xgdb_verbose && bpt->type == bp_breakpoint)
240 printf_filtered ("breakpoint #%d enabled\n", bpt->number);
245 disable_breakpoint (bpt)
246 struct breakpoint *bpt;
248 + energize_disable_breakpoint(bpt);
250 bpt->enable = disabled;
252 if (xgdb_verbose && bpt->type == bp_breakpoint)
253 ===================================================================
254 *** 1.18 1992/07/10 17:22:30
255 --- command.c 1992/09/28 16:15:06
260 error ("gdb internal error: bad cmd_type in do_setshow_command");
261 (*c->function.sfunc) (NULL, from_tty, c);
266 /* Show all the settings in a list of show commands. */
272 ! while ((rc = wait (&status)) != pid && rc != -1)
275 error ("Fork failed");
280 ! while ((rc = energize_shell_wait (&status)) != pid && rc != -1)
283 error ("Fork failed");
284 ===================================================================
285 *** 1.67 1992/09/21 20:01:00
286 --- configure.in 1992/09/28 16:15:06
294 ! configdirs="energize doc"
298 ===================================================================
299 *** 1.48 1992/09/15 08:55:59
300 --- defs.h 1992/09/28 16:15:07
304 #define MAINTENANCE_CMDS 1
307 + #include "energize.h"
309 #endif /* !defined (DEFS_H) */
310 ===================================================================
311 *** 2.5 1992/09/03 16:26:03
312 --- demangle.c 1992/09/28 16:15:07
315 the appropriate target configuration file. */
317 #ifndef DEFAULT_DEMANGLING_STYLE
318 ! # define DEFAULT_DEMANGLING_STYLE AUTO_DEMANGLING_STYLE_STRING
321 /* String name for the current demangling style. Set by the "set demangling"
323 the appropriate target configuration file. */
325 #ifndef DEFAULT_DEMANGLING_STYLE
326 ! # define DEFAULT_DEMANGLING_STYLE LUCID_DEMANGLING_STYLE_STRING
329 /* String name for the current demangling style. Set by the "set demangling"
330 ===================================================================
331 *** 1.34 1992/09/26 05:20:04
332 --- infcmd.c 1992/09/28 16:53:10
337 target_create_inferior (exec_file, inferior_args,
338 environ_vector (inferior_environ));
339 + energize_new_process();
343 ===================================================================
344 *** 1.29 1992/09/25 19:19:00
345 --- inflow.c 1992/09/28 16:15:07
348 static short pgrp_inferior;
349 static short pgrp_ours;
350 # else /* not def SHORT_PGRP */
351 ! static int pgrp_inferior;
352 static int pgrp_ours;
353 # endif /* not def SHORT_PGRP */
354 #else /* not def TIOCGPGRP */
356 static short pgrp_inferior;
357 static short pgrp_ours;
358 # else /* not def SHORT_PGRP */
360 static int pgrp_ours;
361 # endif /* not def SHORT_PGRP */
362 #else /* not def TIOCGPGRP */
363 ===================================================================
364 *** 1.59 1992/09/26 01:49:01
365 --- infrun.c 1992/09/28 16:22:33
368 flush_cached_frames ();
369 registers_changed ();
373 #ifdef SIGTRAP_STOP_AFTER_LOAD
376 flush_cached_frames ();
377 registers_changed ();
379 ! energize_wait (&w);
381 #ifdef SIGTRAP_STOP_AFTER_LOAD
383 ===================================================================
384 *** 1.17 1992/09/26 09:06:10
385 --- inftarg.c 1992/09/28 16:43:53
392 + energize_new_process();
393 push_target (&child_ops);
394 #endif /* ATTACH_DETACH */
396 ===================================================================
397 *** 1.56 1992/09/22 05:23:29
398 --- main.c 1992/09/28 16:15:08
402 char *corearg = NULL;
405 + char *energize_id = NULL;
407 /* Pointers to all arguments of +command option. */
412 {"tty", required_argument, 0, 't'},
413 {"baud", required_argument, 0, 'b'},
414 {"b", required_argument, 0, 'b'},
415 + {"context", required_argument, 0, 12},
416 /* Allow machine descriptions to add more options... */
417 #ifdef ADDITIONAL_OPTIONS
426 + energize_id = optarg;
435 /* Run the init function of each source file */
437 + /* Must call this first to setup tty */
438 + energize_initialize (energize_id, execarg);
440 initialize_cmd_lists (); /* This needs to be done first */
441 initialize_all_files ();
442 initialize_main (); /* But that omits this file! Do it now */
445 if (!setjmp (to_top_level))
447 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
449 quit_command ((char *)0, instream == stdin);
453 if (!setjmp (to_top_level))
455 do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
457 ! energize_main_loop();
460 quit_command ((char *)0, instream == stdin);
465 else if (c->function.cfunc == NO_FUNCTION)
466 error ("That is not a command, just a help topic.");
468 ! (*c->function.cfunc) (arg, from_tty & caution);
471 /* Tell the user if the language has changed (except first time). */
473 else if (c->function.cfunc == NO_FUNCTION)
474 error ("That is not a command, just a help topic.");
476 ! energize_call_command (c, arg, from_tty & caution);
479 /* Tell the user if the language has changed (except first time). */
485 ! p = command_line_input ((char *) NULL, instream == stdin);
487 /* Treat end of file like "end". */
493 ! p = energize_command_line_input ((char *) NULL, instream == stdin);
495 /* Treat end of file like "end". */
497 ===================================================================
498 *** 1.32 1992/09/15 06:27:00
499 --- printcmd.c 1992/09/28 16:15:08
504 int histindex = record_latest_value (val);
510 + sprintf(buf, "$%d", histindex);
511 + energize_start_variable_annotation(buf, NULL, VALUE_TYPE(val),
512 + VALUE_ADDRESS(val), "");
516 printf_filtered ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
521 if (histindex >= 0) printf_filtered ("$%d = ", histindex);
523 print_formatted (val, format, fmt.size);
524 + energize_end_variable_annotation();
525 printf_filtered ("\n");
527 printf_filtered("\") )\030");
531 standard indentation here is 4 spaces, and val_print indents
532 2 for each recurse. */
533 val = read_var_value (sym, FRAME_INFO_ID (fi));
535 + energize_start_variable_annotation(SYMBOL_NAME(sym), sym,
537 + VALUE_ADDRESS(val), "");
540 val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
541 stream, 0, 0, 2, Val_no_prettyprint);
543 fputs_filtered ("???", stream);
545 + energize_end_variable_annotation();
550 ===================================================================
551 *** 1.35 1992/09/18 09:20:00
552 --- stack.c 1992/09/28 16:15:09
556 printf_filtered ("%s in ", local_hex_string(fi->pc));
558 ! fputs_demangled (fname, stdout, 0);
559 fputs_filtered (" (...)\n", stdout);
564 printf_filtered ("%s in ", local_hex_string(fi->pc));
567 ! energize_annotate_function(fname, 0, level);
569 ! fputs_demangled (fname, stdout, 0);
570 fputs_filtered (" (...)\n", stdout);
576 if (fi->pc != sal.pc || !sal.symtab)
577 printf_filtered ("%s in ", local_hex_string(fi->pc));
578 ! fputs_demangled (funname ? funname : "??", stdout, 0);
580 fputs_filtered (" (", stdout);
584 if (fi->pc != sal.pc || !sal.symtab)
585 printf_filtered ("%s in ", local_hex_string(fi->pc));
587 ! energize_annotate_function(funname ? funname : "??", 0, level);
589 ! fputs_demangled (funname ? funname : "??", stdout, 0);
591 fputs_filtered (" (", stdout);
596 if (addressprint && mid_statement)
597 printf_filtered ("%s\t", local_hex_string(fi->pc));
598 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
600 current_source_line = max (sal.line - lines_to_list/2, 1);
604 if (addressprint && mid_statement)
605 printf_filtered ("%s\t", local_hex_string(fi->pc));
607 ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
609 current_source_line = max (sal.line - lines_to_list/2, 1);
615 printf_filtered (" in ");
616 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
623 printf_filtered (" in ");
625 ! energize_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS,
626 ! selected_frame_level);
628 ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS);
632 ===================================================================
633 *** 1.58 1992/09/19 16:55:36
634 --- symfile.c 1992/09/28 16:15:09
641 + energize_symbol_file(objfile);
646 ===================================================================
647 *** 1.63 1992/09/26 05:34:06
648 --- utils.c 1992/09/28 16:15:09
653 ctlstr = va_arg (args, char *);
654 vfprintf_filtered (stdout, ctlstr, args);
656 printf_filtered ("(y or n) ");
658 ! answer = fgetc (stdin);
659 ! clearerr (stdin); /* in case of C-d */
660 ! if (answer == EOF) /* C-d */
662 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
665 ! ans2 = fgetc (stdin);
668 ! while (ans2 != EOF && ans2 != '\n');
675 ctlstr = va_arg (args, char *);
676 + energize_query (ctlstr, args);
677 vfprintf_filtered (stdout, ctlstr, args);
678 printf_filtered ("(y or n) ");
683 ! buf = energize_command_line_input(0, 0);
684 ! answer = buf ? *buf : 'Y';
685 ! energize_acknowledge_query(buf);
690 ! answer = fgetc (stdin);
691 ! clearerr (stdin); /* in case of C-d */
692 ! if (answer == EOF) /* C-d */
694 ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */
697 ! ans2 = fgetc (stdin);
700 ! while (ans2 != EOF && ans2 != '\n');
710 printf_filtered ("Please answer y or n.\n");
723 + energize_fputs(linebuffer);
727 /* Don't do any filtering if it is disabled. */
729 || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
730 ===================================================================
731 *** 1.54 1992/09/15 06:27:03
732 --- valprint.c 1992/09/28 16:15:10
736 struct type **dont_print;
738 int i, len, n_baseclasses;
739 + char expr_tag[100]; /* Energize */
741 check_stub_type (type);
746 fprint_symbol (stream, TYPE_FIELD_NAME (type, i));
747 fputs_filtered (" = ", stream);
750 + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i));
752 + energize_start_variable_annotation(expr_tag, NULL,
753 + TYPE_FIELD_TYPE(type, i),
754 + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8),
756 if (TYPE_FIELD_PACKED (type, i))
762 valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
763 0, stream, format, 0, recurse + 1, pretty);
765 + energize_end_variable_annotation();
773 /* Number of repetitions we have detected so far. */
775 + char expr_tag[100]; /* Energize */
785 + sprintf(expr_tag, "[%d]", i);
786 + energize_start_variable_annotation(expr_tag, NULL,
788 + (CORE_ADDR) (valaddr + i * eltlen),
790 if (reps > REPEAT_COUNT_THRESHOLD)
792 val_print (elttype, valaddr + i * eltlen,
796 recurse + 1, pretty);
799 + energize_end_variable_annotation();
802 fprintf_filtered (stream, "...");
803 ===================================================================
804 *** 1.5 1992/09/26 08:07:45
805 --- config/amix.mh 1992/09/28 16:15:10
810 # SVR4 puts the BSD compatible install in /usr/ucb.
811 INSTALL = /usr/ucb/install -c
813 + # These are the libs that are needed for the Energize version of gdb on
814 + # SVR4. Note that we MUST include the standard C library before libucb.a,
815 + # otherwise we get lots of broken stuff we don't want.
816 + ENERGIZE_LIB = energize/libconn.a
817 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
818 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
820 + # These are the libs that are needed for the Energize version of gdb on
821 + # SVR4. Note that we MUST include the standard C library before libucb.a,
822 + # otherwise we get lots of broken stuff we don't want.
823 + ENERGIZE_LIB = energize/libconn.a
824 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
825 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
826 ===================================================================
827 *** 1.5 1992/09/26 08:08:14
828 --- config/ncr3000.mh 1992/09/28 16:15:10
832 # The /usr/ucb/install program is incompatible (complains about unknown
833 # group staff). Use good old cp...
836 + # These are the libs that are needed for the Energize version of gdb on
837 + # SVR4. Note that we MUST include the standard C library before libucb.a,
838 + # otherwise we get lots of broken stuff we don't want.
839 + XM_CLIBS = -L/usr/lib -lm -lnet -lresolv -lform -lsocket -lnsl -lc
841 + # These are the libs that are needed for the Energize version of gdb on
842 + # SVR4. Note that we MUST include the standard C library before libucb.a,
843 + # otherwise we get lots of broken stuff we don't want.
844 + ENERGIZE_LIB = energize/libconn.a
845 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
846 + -lsocket -lc /usr/ucblib/libucb.a -lnsl
848 + # These are the libs that are needed for the Energize version of gdb on
849 + # SVR4. Note that we MUST include the standard C library before libucb.a,
850 + # otherwise we get lots of broken stuff we don't want.
851 + ENERGIZE_LIB = energize/libconn.a
852 + ENERGIZE_LIBS = ${ENERGIZE_LIB} -L/usr/lib -lm -lnet -lresolv -lform \
853 + -lsocket -lc /usr/ucblib/libucb.a -lnsl