#include "signals.h"
#include "target.h"
#include "breakpoint.h"
+#include "language.h"
#include "getopt.h"
extern char *error_pre_print;
+extern char lang_frame_mismatch_warn[]; /* language.c */
+
/* Flag for whether we want all the "from_tty" gubbish printed. */
int caution = 1; /* Default is yes, sigh. */
/* Function to call before reading a command, if nonzero.
The function receives two args: an input stream,
and a prompt string. */
-
+
void (*window_hook) ();
extern int frame_file_full_name;
alloca (4 - i);
#endif
+ /* If error() is called from initialization code, just exit */
+ if (setjmp (to_top_level)) {
+ exit(1);
+ }
+
cmdsize = 1;
cmdarg = (char **) xmalloc (cmdsize * sizeof (*cmdarg));
ncmd = 0;
print_gdb_version ();
if (symarg)
printf_filtered ("..");
- wrap_here();
+ wrap_here("");
fflush (stdout); /* Force to screen during slow operations */
}
{
register struct cmd_list_element *c;
register struct command_line *cmdlines;
+ register enum language flang;
+ static enum language current = language_unknown;
+ static int warned = 0;
free_all_values ();
error ("That is not a command, just a help topic.");
else
(*c->function) (arg, from_tty & caution);
+ }
+
+ /* Tell the user if the language has changed */
+ if (working_lang != current)
+ {
+ if (language_mode == language_mode_auto) {
+ if (current != language_unknown)
+ language_info ();
}
+ current = working_lang;
+ warned = 0;
+ }
+
+ /* Warn the user if the working language does not match the
+ language of the current frame. Only warn the user if we are
+ actually running the program, i.e. there is a stack. */
+ if (target_has_stack)
+ {
+ flang = get_frame_language();
+ if(!warned && flang != language_unknown && flang != working_lang)
+ {
+ printf_filtered ("%s\n", lang_frame_mismatch_warn);
+ warned = 1;
+ }
+ }
}
/* ARGSUSED */