+Mon Apr 11 10:44:35 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * main.c (main): Accept --annotate=N option and make --fullname
+ the same as --annotate=1.
+ (command_line_input): Print annotatation before and after prompt.
+ * blockframe.c (flush_cached_frames): Print annotation.
+ * Rename frame_file_full_name to annotation_level and move it from
+ symtab.h to defs.h.
+ * source.c (identify_source_line): If annotation_level > 1,
+ change output format.
+ * breakpoint.c: Print annotation whenever a breakpoint changes.
+ * main.c: New variable server_command.
+ (command_line_input): Parse "server " and set server_command.
+ (dont_repeat): Check server_command.
+
Wed Apr 20 08:37:16 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
* xcoffread.c (xcoff_next_symbol_text): Don't return before
/* Flag indicating extra verbosity for xgdb. */
extern int xgdb_verbose;
+
+static void
+breakpoints_changed ()
+{
+ if (annotation_level > 1)
+ {
+ target_terminal_ours ();
+ printf_unfiltered ("\n\032\032breakpoints-invalid\n");
+ }
+}
\f
/* *PP is a string denoting a breakpoint. Get the number of the breakpoint.
Advance *PP after the string and any trailing whitespace.
l = read_command_lines ();
free_command_lines (&b->commands);
b->commands = l;
+ breakpoints_changed ();
return;
}
error ("No breakpoint number %d.", bnum);
}
check_duplicates (sal.pc);
+ breakpoints_changed ();
return b;
}
if (found->next) from_tty = 1; /* Always report if deleted more than one */
if (from_tty) printf_unfiltered ("Deleted breakpoint%s ", found->next ? "s" : "");
+ breakpoints_changed ();
while (found)
{
if (from_tty) printf_unfiltered ("%d ", found->number);
if (bpt->source_file != NULL)
free (bpt->source_file);
- if (xgdb_verbose && bpt->type == bp_breakpoint)
- {
- target_terminal_ours_for_output ();
- printf_unfiltered ("breakpoint #%d deleted\n", bpt->number);
- }
+ breakpoints_changed ();
/* Be sure no bpstat's are pointing at it after it's been freed. */
/* FIXME, how can we find all bpstat's?
check_duplicates (b->address);
mention (b);
+
+ /* Might be better to do this just once per breakpoint_re_set,
+ rather than once for every breakpoint. */
+ breakpoints_changed ();
}
b->enable = save_enable; /* Restore it, this worked. */
}
else
printf_filtered ("Will ignore next %d crossings of breakpoint %d.",
count, bptnum);
+ breakpoints_changed ();
return;
}
longest_to_int (value_as_long (parse_and_eval (p))),
from_tty);
printf_filtered ("\n");
+ breakpoints_changed ();
}
\f
/* Call FUNCTION on each of the breakpoints
bpt->enable = enabled;
- if (xgdb_verbose && bpt->type == bp_breakpoint)
- printf_unfiltered ("breakpoint #%d enabled\n", bpt->number);
+ breakpoints_changed ();
check_duplicates (bpt->address);
if (bpt->type == bp_watchpoint || bpt->type == bp_hardware_watchpoint)
bpt->enable = disabled;
- if (xgdb_verbose && bpt->type == bp_breakpoint)
- printf_filtered ("breakpoint #%d disabled\n", bpt->number);
+ breakpoints_changed ();
check_duplicates (bpt->address);
}
bpt->disposition = disable;
check_duplicates (bpt->address);
+ breakpoints_changed ();
}
/* ARGSUSED */
bpt->disposition = delete;
check_duplicates (bpt->address);
+ breakpoints_changed ();
}
/* ARGSUSED */
char *line;
int linesize = 100;
+/* Nonzero if the current command is modified by "server ". This
+ affects things like recording into the command history, comamnds
+ repeating on RETURN, etc. This is so a user interface (emacs, GUI,
+ whatever) can issue its own commands and also send along commands
+ from the user, and have the user not notice that the user interface
+ is issuing commands too. */
+int server_command;
+
/* Baud rate specified for talking to serial target systems. Default
is left as -1, so targets can choose their own defaults. */
/* FIXME: This means that "show remotebaud" and gr_files_info can print -1
{"n", no_argument, &inhibit_gdbinit, 1},
{"batch", no_argument, &batch, 1},
{"epoch", no_argument, &epoch_interface, 1},
- {"fullname", no_argument, &frame_file_full_name, 1},
- {"f", no_argument, &frame_file_full_name, 1},
+
+ /* This is a synonym for "--annotate=1". --annotate is now preferred,
+ but keep this here for a long time because people will be running
+ emacses which use --fullname. */
+ {"fullname", no_argument, 0, 'f'},
+ {"f", no_argument, 0, 'f'},
+
+ {"annotate", required_argument, 0, 12},
{"help", no_argument, &print_help, 1},
{"se", required_argument, 0, 10},
{"symbols", required_argument, 0, 's'},
case 11:
cdarg = optarg;
break;
+ case 12:
+ /* FIXME: what if the syntax is wrong (e.g. not digits)? */
+ annotation_level = atoi (optarg);
+ break;
+ case 'f':
+ annotation_level = 1;
+ break;
case 's':
symarg = optarg;
break;
void
dont_repeat ()
{
+ if (server_command)
+ return;
+
/* If we aren't reading from standard input, we are saving the last
thing read from stdin in line and don't want to delete it. Null lines
won't repeat here in any case. */
char *nline;
char got_eof = 0;
+ if (annotation_level > 1 && prrompt != NULL)
+ {
+ local_prompt = alloca (strlen (prrompt) + 20);
+ strcpy (local_prompt, prrompt);
+ strcat (local_prompt, "\n\032\032prompt\n");
+ }
+
if (linebuffer == 0)
{
linelength = 80;
error_pre_print = source_error;
}
+ if (annotation_level > 1 && instream == stdin)
+ printf_unfiltered ("\n\032\032pre-prompt\n");
+
/* Don't use fancy stuff if not talking to stdin. */
if (command_editing_p && instream == stdin
&& ISATTY (instream))
else
rl = gdb_readline (local_prompt);
+ if (annotation_level > 1 && instream == stdin)
+ printf_unfiltered ("\n\032\032post-prompt\n");
+
if (!rl || rl == (char *) EOF)
{
got_eof = 1;
if (got_eof)
return NULL;
+#define SERVER_COMMAND_LENGTH 7
+ server_command =
+ (p - linebuffer > SERVER_COMMAND_LENGTH)
+ && STREQN (linebuffer, "server ", SERVER_COMMAND_LENGTH);
+ if (server_command)
+ {
+ /* Note that we don't set `line'. Between this and the check in
+ dont_repeat, this insures that repeating will still do the
+ right thing. */
+ *p = '\0';
+ return linebuffer + SERVER_COMMAND_LENGTH;
+ }
+
/* Do history expansion if that is wished. */
if (history_expansion_p && instream == stdin
&& ISATTY (instream))
immediate_quit--;
}
\f
-/* xgdb calls this to reprint the usual GDB prompt. */
+/* xgdb calls this to reprint the usual GDB prompt. Obsolete now that xgdb
+ is obsolete. */
void
print_prompt ()