From 1ad24239ce0af556836897b96f29c7475042c009 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Tue, 20 Nov 2001 16:54:39 +0000 Subject: * top.c (gdb_init): Call init_ui_hook before initializing the default UI. --- gdb/ChangeLog | 5 +++++ gdb/top.c | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fa569fa..392ccda 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2001-11-20 Keith Seitz + + * top.c (gdb_init): Call init_ui_hook before initializing + the default UI. + 2001-11-19 Elena Zannoni * config/powerpc/nm-linux.h (ppc_register_u_addr): Add extern diff --git a/gdb/top.c b/gdb/top.c index dfb33a9..7ddd346 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -182,7 +182,10 @@ static void stop_sig (int); /* Hooks for alternate command interfaces. */ /* Called after most modules have been initialized, but before taking users - command file. */ + command file. + + If the UI fails to initialize and it wants GDB to continue + using the default UI, then it should clear this hook before returning. */ void (*init_ui_hook) (char *argv0); @@ -2034,6 +2037,11 @@ gdb_init (char *argv0) set_language (language_c); expected_language = current_language; /* don't warn about the change. */ + /* Allow another UI to initialize. If the UI fails to initialize, and + it wants GDB to revert to the CLI, it should clear init_ui_hook. */ + if (init_ui_hook) + init_ui_hook (argv0); + #ifdef UI_OUT /* Install the default UI */ if (!init_ui_hook) @@ -2050,7 +2058,4 @@ gdb_init (char *argv0) } } #endif - - if (init_ui_hook) - init_ui_hook (argv0); } -- cgit v1.1