X-Git-Url: http://drtracing.org/?a=blobdiff_plain;ds=sidebyside;f=gdb%2Ftop.c;h=e8ed3b2747eebc8b1414225984e009ddc82630ee;hb=bda13cdcf0db4d9cee648bfa0bfc7f1a4415d2a7;hp=08c742548bcd6cf65bb05921523c74c81f39ddcc;hpb=992a70401ec229425ee75b2ad9b731f30d2de391;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/top.c b/gdb/top.c index 08c742548b..e8ed3b2747 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -92,21 +92,35 @@ extern void initialize_all_files (void); #define DEFAULT_PROMPT "(gdb) " #endif -/* Generate a function that exports a pointer to a field of the - current UI. */ +struct ui_file ** +current_ui_gdb_stdout_ptr () +{ + return ¤t_ui->m_gdb_stdout; +} -#define gen_ret_current_ui_field_ptr(type, name) \ -type * \ -current_ui_## name ## _ptr (void) \ -{ \ - return ¤t_ui->m_ ## name; \ +struct ui_file ** +current_ui_gdb_stdin_ptr () +{ + return ¤t_ui->m_gdb_stdin; } -gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdout) -gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdin) -gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stderr) -gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdlog) -gen_ret_current_ui_field_ptr (struct ui_out *, current_uiout) +struct ui_file ** +current_ui_gdb_stderr_ptr () +{ + return ¤t_ui->m_gdb_stderr; +} + +struct ui_file ** +current_ui_gdb_stdlog_ptr () +{ + return ¤t_ui->m_gdb_stdlog; +} + +struct ui_out ** +current_ui_current_uiout_ptr () +{ + return ¤t_ui->m_current_uiout; +} int inhibit_gdbinit = 0; @@ -613,6 +627,18 @@ execute_command (const char *p, int from_tty) /* c->user_commands would be NULL in the case of a python command. */ if (c->theclass == class_user && c->user_commands) execute_user_command (c, arg); + else if (c->theclass == class_user + && c->prefixlist && !c->allow_unknown) + /* If this is a user defined prefix that does not allow unknown + (in other words, C is a prefix command and not a command + that can be followed by its args), report the list of + subcommands. */ + { + printf_unfiltered + ("\"%.*s\" must be followed by the name of a subcommand.\n", + (int) strlen (c->prefixname) - 1, c->prefixname); + help_list (*c->prefixlist, c->prefixname, all_commands, gdb_stdout); + } else if (c->type == set_cmd) do_set_command (arg, from_tty, c); else if (c->type == show_cmd)