# Apply these patches to GDB to produce an Energize GDB. # To apply these patches, first cd to gdb-XX/gdb, run "patch -p0 cond_string = NULL; if (from_tty) printf_filtered ("Breakpoint %d now unconditional.\n", bnum); + energize_condition_breakpoint(b); } else { *************** *** 281,286 **** --- 282,288 ---- typed in or the decompiled expression. */ b->cond_string = savestring (arg, strlen (arg)); b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0); + energize_condition_breakpoint(b); if (*arg) error ("Junk at end of expression"); } *************** *** 316,327 **** ALL_BREAKPOINTS (b) if (b->number == bnum) { ! if (from_tty && input_from_terminal_p ()) printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\ End with a line saying just \"end\".\n", bnum); l = read_command_lines (); free_command_lines (&b->commands); b->commands = l; return; } error ("No breakpoint number %d.", bnum); --- 318,330 ---- ALL_BREAKPOINTS (b) if (b->number == bnum) { ! if ((from_tty && input_from_terminal_p ()) || energize) printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\ End with a line saying just \"end\".\n", bnum); l = read_command_lines (); free_command_lines (&b->commands); b->commands = l; + energize_commands_breakpoint(b); return; } error ("No breakpoint number %d.", bnum); *************** *** 923,928 **** --- 926,932 ---- { b->ignore_count--; this_bp_stop = 0; + energize_ignore_breakpoint(b); } else { *************** *** 1375,1380 **** --- 1379,1386 ---- mention (b) struct breakpoint *b; { + energize_create_breakpoint(b); + switch (b->type) { case bp_watchpoint: *************** *** 2125,2130 **** --- 2131,2138 ---- register struct breakpoint *b; register bpstat bs; + energize_delete_breakpoint(bpt); + if (bpt->inserted) target_remove_breakpoint(bpt->address, bpt->shadow_contents); *************** *** 2303,2308 **** --- 2311,2317 ---- if (b->number == bptnum) { b->ignore_count = count; + energize_ignore_breakpoint(b); if (!from_tty) return; else if (count == 0) *************** *** 2327,2333 **** struct breakpoint *b; ALL_BREAKPOINTS (b) ! b->ignore_count = 0; } /* Command to set ignore-count of breakpoint N to COUNT. */ --- 2336,2345 ---- struct breakpoint *b; ALL_BREAKPOINTS (b) ! { ! b->ignore_count = 0; ! energize_ignore_breakpoint(b); ! } } /* Command to set ignore-count of breakpoint N to COUNT. */ *************** *** 2394,2399 **** --- 2406,2413 ---- { bpt->enable = enabled; + energize_enable_breakpoint(bpt); + if (xgdb_verbose && bpt->type == bp_breakpoint) printf_filtered ("breakpoint #%d enabled\n", bpt->number); *************** *** 2441,2446 **** --- 2455,2462 ---- disable_breakpoint (bpt) struct breakpoint *bpt; { + energize_disable_breakpoint(bpt); + bpt->enable = disabled; if (xgdb_verbose && bpt->type == bp_breakpoint) =================================================================== *** 1.18 1992/07/10 17:22:30 --- command.c 1992/07/23 01:42:36 *************** *** 1093,1098 **** --- 1093,1100 ---- else error ("gdb internal error: bad cmd_type in do_setshow_command"); (*c->function.sfunc) (NULL, from_tty, c); + if (energize) + print_prompt(); } /* Show all the settings in a list of show commands. */ *************** *** 1148,1154 **** } if (pid != -1) ! while ((rc = wait (&status)) != pid && rc != -1) ; else error ("Fork failed"); --- 1150,1156 ---- } if (pid != -1) ! while ((rc = energize_wait (&status)) != pid && rc != -1) ; else error ("Fork failed"); =================================================================== *** 1.63 1992/09/03 16:26:02 --- configure.in 1992/09/15 05:19:56 *************** *** 1,4 **** ! configdirs="doc" srcname="GDB" srctrigger=main.c target_dependent=true --- 1,4 ---- ! configdirs="energize doc" srcname="GDB" srctrigger=main.c target_dependent=true =================================================================== *** 1.48 1992/09/15 08:55:59 --- defs.h 1992/09/15 08:54:35 *************** *** 811,814 **** --- 811,816 ---- #define MAINTENANCE_CMDS 1 #endif + #include "energize.h" + #endif /* !defined (DEFS_H) */ =================================================================== *** 2.5 1992/09/03 16:26:03 --- demangle.c 1992/09/15 05:19:59 *************** *** 37,43 **** the appropriate target configuration file. */ #ifndef DEFAULT_DEMANGLING_STYLE ! # define DEFAULT_DEMANGLING_STYLE AUTO_DEMANGLING_STYLE_STRING #endif /* String name for the current demangling style. Set by the "set demangling" --- 37,43 ---- the appropriate target configuration file. */ #ifndef DEFAULT_DEMANGLING_STYLE ! # define DEFAULT_DEMANGLING_STYLE LUCID_DEMANGLING_STYLE_STRING #endif /* String name for the current demangling style. Set by the "set demangling" =================================================================== *** 1.28 1992/07/23 04:41:45 --- inflow.c 1992/08/27 22:43:15 *************** *** 89,95 **** static short pgrp_inferior; static short pgrp_ours; # else /* not def SHORT_PGRP */ ! static int pgrp_inferior; static int pgrp_ours; # endif /* not def SHORT_PGRP */ #else /* not def TIOCGPGRP */ --- 89,95 ---- static short pgrp_inferior; static short pgrp_ours; # else /* not def SHORT_PGRP */ ! int pgrp_inferior; static int pgrp_ours; # endif /* not def SHORT_PGRP */ #else /* not def TIOCGPGRP */ =================================================================== *** 1.54 1992/09/02 09:22:09 --- infrun.c 1992/09/15 05:20:09 *************** *** 633,638 **** --- 633,639 ---- Here we must get it up to actual execution of the real program. */ inferior_pid = pid; /* Needed for wait_for_inferior stuff below */ + energize_new_process(); clear_proceed_status (); *************** *** 771,776 **** --- 772,778 ---- attach (pid); inferior_pid = pid; + energize_new_process(); push_target (&child_ops); mark_breakpoints_out (); =================================================================== *** 1.11 1992/03/29 23:21:27 --- inftarg.c 1992/09/15 06:37:01 *************** *** 55,65 **** int pid; do { ! #ifdef USE_PROC_FS ! pid = proc_wait (status); ! #else ! pid = wait (status); ! #endif if (pid == -1) /* No more children to wait for */ { fprintf (stderr, "Child process unexpectedly missing.\n"); --- 55,61 ---- int pid; do { ! pid = energize_wait (status); if (pid == -1) /* No more children to wait for */ { fprintf (stderr, "Child process unexpectedly missing.\n"); =================================================================== *** 1.52 1992/09/15 06:27:10 --- main.c 1992/09/15 06:30:03 *************** *** 426,431 **** --- 426,432 ---- char *corearg = NULL; char *cdarg = NULL; char *ttyarg = NULL; + char *energize_id = NULL; /* Pointers to all arguments of +command option. */ char **cmdarg; *************** *** 524,529 **** --- 525,531 ---- {"tty", required_argument, 0, 't'}, {"baud", required_argument, 0, 'b'}, {"b", required_argument, 0, 'b'}, + {"context", required_argument, 0, 12}, /* Allow machine descriptions to add more options... */ #ifdef ADDITIONAL_OPTIONS ADDITIONAL_OPTIONS *************** *** 556,561 **** --- 558,566 ---- case 11: cdarg = optarg; break; + case 12: + energize_id = optarg; + break; case 's': symarg = optarg; break; *************** *** 664,669 **** --- 669,677 ---- /* Run the init function of each source file */ + /* Must call this first to setup tty */ + energize_initialize (energize_id, execarg); + initialize_cmd_lists (); /* This needs to be done first */ initialize_all_files (); initialize_main (); /* But that omits this file! Do it now */ *************** *** 850,856 **** if (!setjmp (to_top_level)) { do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */ ! command_loop (); quit_command ((char *)0, instream == stdin); } } --- 858,867 ---- if (!setjmp (to_top_level)) { do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */ ! if (energize) ! energize_main_loop(); ! else ! command_loop (); quit_command ((char *)0, instream == stdin); } } *************** *** 912,918 **** else if (c->function.cfunc == NO_FUNCTION) error ("That is not a command, just a help topic."); else ! (*c->function.cfunc) (arg, from_tty & caution); } /* Tell the user if the language has changed (except first time). */ --- 923,929 ---- else if (c->function.cfunc == NO_FUNCTION) error ("That is not a command, just a help topic."); else ! energize_call_command (c, arg, from_tty & caution); } /* Tell the user if the language has changed (except first time). */ *************** *** 1564,1570 **** while (1) { dont_repeat (); ! p = command_line_input ((char *) NULL, instream == stdin); if (p == NULL) /* Treat end of file like "end". */ break; --- 1575,1581 ---- while (1) { dont_repeat (); ! p = energize_command_line_input ((char *) NULL, instream == stdin); if (p == NULL) /* Treat end of file like "end". */ break; =================================================================== *** 1.32 1992/09/15 06:27:00 --- printcmd.c 1992/09/15 06:30:06 *************** *** 778,783 **** --- 778,792 ---- { int histindex = record_latest_value (val); + if (energize) + { + char buf[20]; + + sprintf(buf, "$%d", histindex); + energize_start_variable_annotation(buf, NULL, VALUE_TYPE(val), + VALUE_ADDRESS(val), ""); + } + if (inspect) printf_filtered ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex); else *************** *** 784,789 **** --- 793,799 ---- if (histindex >= 0) printf_filtered ("$%d = ", histindex); print_formatted (val, format, fmt.size); + energize_end_variable_annotation(); printf_filtered ("\n"); if (inspect) printf_filtered("\") )\030"); *************** *** 1652,1662 **** --- 1662,1680 ---- standard indentation here is 4 spaces, and val_print indents 2 for each recurse. */ val = read_var_value (sym, FRAME_INFO_ID (fi)); + + energize_start_variable_annotation(SYMBOL_NAME(sym), sym, + VALUE_TYPE(val), + VALUE_ADDRESS(val), ""); + if (val) val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val), stream, 0, 0, 2, Val_no_prettyprint); else fputs_filtered ("???", stream); + + energize_end_variable_annotation(); + first = 0; } =================================================================== *** 1.34 1992/09/11 09:11:04 --- stack.c 1992/09/15 05:20:25 *************** *** 159,165 **** if (addressprint) printf_filtered ("%s in ", local_hex_string(fi->pc)); ! fputs_demangled (fname, stdout, 0); fputs_filtered (" (...)\n", stdout); return; --- 159,168 ---- if (addressprint) printf_filtered ("%s in ", local_hex_string(fi->pc)); ! if (energize) ! energize_annotate_function(fname, 0, level); ! else ! fputs_demangled (fname, stdout, 0); fputs_filtered (" (...)\n", stdout); return; *************** *** 218,224 **** if (addressprint) if (fi->pc != sal.pc || !sal.symtab) printf_filtered ("%s in ", local_hex_string(fi->pc)); ! fputs_demangled (funname ? funname : "??", stdout, 0); wrap_here (" "); fputs_filtered (" (", stdout); if (args) --- 221,230 ---- if (addressprint) if (fi->pc != sal.pc || !sal.symtab) printf_filtered ("%s in ", local_hex_string(fi->pc)); ! if (energize) ! energize_annotate_function(funname ? funname : "??", 0, level); ! else ! fputs_demangled (funname ? funname : "??", stdout, 0); wrap_here (" "); fputs_filtered (" (", stdout); if (args) *************** *** 255,261 **** { if (addressprint && mid_statement) printf_filtered ("%s\t", local_hex_string(fi->pc)); ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0); } current_source_line = max (sal.line - lines_to_list/2, 1); } --- 261,268 ---- { if (addressprint && mid_statement) printf_filtered ("%s\t", local_hex_string(fi->pc)); ! if (!energize) ! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0); } current_source_line = max (sal.line - lines_to_list/2, 1); } *************** *** 429,435 **** if (funname) { printf_filtered (" in "); ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS); } wrap_here (" "); if (sal.symtab) --- 436,446 ---- if (funname) { printf_filtered (" in "); ! if (energize) ! energize_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS, ! selected_frame_level); ! else ! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS); } wrap_here (" "); if (sal.symtab) =================================================================== *** 1.57 1992/09/15 06:27:08 --- symfile.c 1992/09/15 06:30:09 *************** *** 611,616 **** --- 611,618 ---- fflush (stdout); } + energize_symbol_file(objfile); + return (objfile); } =================================================================== *** 1.60 1992/09/15 06:26:56 --- utils.c 1992/09/15 08:57:41 *************** *** 700,720 **** fflush (stdout); va_start (args); ctlstr = va_arg (args, char *); vfprintf_filtered (stdout, ctlstr, args); - va_end (args); printf_filtered ("(y or n) "); ! fflush (stdout); ! answer = fgetc (stdin); ! clearerr (stdin); /* in case of C-d */ ! if (answer == EOF) /* C-d */ ! return 1; ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */ ! do ! { ! ans2 = fgetc (stdin); ! clearerr (stdin); ! } ! while (ans2 != EOF && ans2 != '\n'); if (answer >= 'a') answer -= 040; if (answer == 'Y') --- 700,731 ---- fflush (stdout); va_start (args); ctlstr = va_arg (args, char *); + energize_query (ctlstr, args); vfprintf_filtered (stdout, ctlstr, args); printf_filtered ("(y or n) "); ! if (energize) ! { ! char *buf; ! ! buf = energize_command_line_input(0, 0); ! answer = buf ? *buf : 'Y'; ! energize_acknowledge_query(buf); ! } ! else ! { ! fflush (stdout); ! answer = fgetc (stdin); ! clearerr (stdin); /* in case of C-d */ ! if (answer == EOF) /* C-d */ ! return 1; ! if (answer != '\n') /* Eat rest of input line, to EOF or newline */ ! do ! { ! ans2 = fgetc (stdin); ! clearerr (stdin); ! } ! while (ans2 != EOF && ans2 != '\n'); ! } if (answer >= 'a') answer -= 040; if (answer == 'Y') *************** *** 722,727 **** --- 733,739 ---- if (answer == 'N') return 0; printf_filtered ("Please answer y or n.\n"); + va_end (args); } } *************** *** 988,993 **** --- 1000,1011 ---- if (linebuffer == 0) return; + if (energize) + { + energize_fputs(linebuffer); + return; + } + /* Don't do any filtering if it is disabled. */ if (stream != stdout || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX)) =================================================================== *** 1.54 1992/09/15 06:27:03 --- valprint.c 1992/09/15 06:30:13 *************** *** 488,493 **** --- 488,494 ---- struct type **dont_print; { int i, len, n_baseclasses; + char expr_tag[100]; /* Energize */ check_stub_type (type); *************** *** 552,557 **** --- 553,565 ---- fprint_symbol (stream, TYPE_FIELD_NAME (type, i)); fputs_filtered (" = ", stream); } + + sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i)); + + energize_start_variable_annotation(expr_tag, NULL, + TYPE_FIELD_TYPE(type, i), + (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8), + ""); if (TYPE_FIELD_PACKED (type, i)) { value v; *************** *** 570,575 **** --- 578,584 ---- valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0, stream, format, 0, recurse + 1, pretty); } + energize_end_variable_annotation(); } if (pretty) { *************** *** 804,809 **** --- 813,819 ---- unsigned int rep1; /* Number of repetitions we have detected so far. */ unsigned int reps; + char expr_tag[100]; /* Energize */ if (i != 0) if (arrayprint) *************** *** 825,830 **** --- 835,845 ---- ++rep1; } + sprintf(expr_tag, "[%d]", i); + energize_start_variable_annotation(expr_tag, NULL, + elttype, + (CORE_ADDR) (valaddr + i * eltlen), + ""); if (reps > REPEAT_COUNT_THRESHOLD) { val_print (elttype, valaddr + i * eltlen, *************** *** 841,846 **** --- 856,862 ---- recurse + 1, pretty); things_printed++; } + energize_end_variable_annotation(); } if (i < len) fprintf_filtered (stream, "...");