Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010 Free Software Foundation, Inc.
+ 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GDB.
static int user_call_depth = 0;
extern int max_user_call_depth;
- old_chain = setup_user_args (args);
-
cmdlines = c->user_commands;
if (cmdlines == 0)
/* Null command */
return;
+ old_chain = setup_user_args (args);
+
if (++user_call_depth > max_user_call_depth)
error (_("Max user call depth exceeded -- command aborted."));
if (deprecated_readline_begin_hook)
{
/* Note - intentional to merge messages with no newline. */
- (*deprecated_readline_begin_hook) ("%s %s\n", prompt_arg, END_MESSAGE);
+ (*deprecated_readline_begin_hook) ("%s %s\n", prompt_arg,
+ END_MESSAGE);
}
else
{
hookc = 0;
if (!hookc)
{
- warning (_("Your new `%s' command does not hook any existing command."),
+ warning (_("Your new `%s' command does not "
+ "hook any existing command."),
comfull);
if (!query (_("Proceed? ")))
error (_("Not confirmed."));
break;
case CMD_POST_HOOK:
hookc->hook_post = newc; /* Target gets hooked. */
- newc->hookee_post = hookc; /* We are marked as hooking target cmd. */
+ newc->hookee_post = hookc; /* We are marked as hooking
+ target cmd. */
break;
default:
/* Should never come here as hookc would be 0. */
source_file_name = p->old_file;
}
-struct wrapped_read_command_file_args
-{
- FILE *stream;
-};
-
-static void
-wrapped_read_command_file (struct ui_out *uiout, void *data)
-{
- struct wrapped_read_command_file_args *args = data;
-
- read_command_file (args->stream);
-}
-
/* Used to implement source_command. */
void
error_pre_print = "";
{
- struct gdb_exception e;
- struct wrapped_read_command_file_args args;
+ volatile struct gdb_exception e;
- args.stream = stream;
- e = catch_exception (uiout, wrapped_read_command_file, &args,
- RETURN_MASK_ERROR);
+ TRY_CATCH (e, RETURN_MASK_ERROR)
+ {
+ read_command_file (stream);
+ }
switch (e.reason)
{
case 0:
return;
fprintf_filtered (stream, "User command \"%s%s\":\n", prefix, name);
- print_command_lines (uiout, cmdlines, 1);
+ print_command_lines (current_uiout, cmdlines, 1);
fputs_filtered ("\n", stream);
}