* [RFA] top.c: initialize other UIs before cli
@ 2001-11-07 16:33 Keith Seitz
2001-11-07 17:25 ` Keith Seitz
0 siblings, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2001-11-07 16:33 UTC (permalink / raw)
To: gdb-patches; +Cc: Elena Zannoni
Hi,
There is currently a little problem with init_ui_hook: if the UI fails to
initialize (and we should fall back to "gdb -nw"), then the CLI will NOT
get initialized properly.
This results because init_ui_hook does not return any status indicating
the failure.
This simple change will correct this anomaly without altering init_ui_hook
semantics, i.e., it is absolutely the least intrusive.
?
Keith
ChangeLog
2001-11-19 Keith Seitz <keiths@redhat.com>
* top.c (gdb_init): Call init_ui_hook before initializing
the default UI.
Patch
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.48
diff -u -p -r1.48 top.c
--- top.c 2001/11/10 21:34:56 1.48
+++ top.c 2001/11/19 20:01:19
@@ -2034,6 +2034,9 @@ gdb_init (char *argv0)
set_language (language_c);
expected_language = current_language; /* don't warn about the change. */
+ if (init_ui_hook)
+ init_ui_hook (argv0);
+
#ifdef UI_OUT
/* Install the default UI */
if (!init_ui_hook)
@@ -2050,7 +2053,4 @@ gdb_init (char *argv0)
}
}
#endif
-
- if (init_ui_hook)
- init_ui_hook (argv0);
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFA] top.c: initialize other UIs before cli
2001-11-07 16:33 [RFA] top.c: initialize other UIs before cli Keith Seitz
@ 2001-11-07 17:25 ` Keith Seitz
2001-11-08 2:06 ` Elena Zannoni
0 siblings, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2001-11-07 17:25 UTC (permalink / raw)
To: gdb-patches; +Cc: Elena Zannoni
Sorry for the self-reply, but I didn't add any comments on this little
hack...
Reposted below.
On Mon, 19 Nov 2001, Keith Seitz wrote:
> Hi,
>
> There is currently a little problem with init_ui_hook: if the UI fails to
> initialize (and we should fall back to "gdb -nw"), then the CLI will NOT
> get initialized properly.
>
> This results because init_ui_hook does not return any status indicating
> the failure.
>
> This simple change will correct this anomaly without altering init_ui_hook
> semantics, i.e., it is absolutely the least intrusive.
>
> ?
> Keith
>
> ChangeLog
> 2001-11-19 Keith Seitz <keiths@redhat.com>
>
> * top.c (gdb_init): Call init_ui_hook before initializing
> the default UI.
>
> Patch
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.48
diff -u -p -r1.48 top.c
--- top.c 2001/11/10 21:34:56 1.48
+++ top.c 2001/11/19 21:01:02
@@ -182,8 +182,11 @@ 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);
/* This hook is called from within gdb's many mini-event loops which could
@@ -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);
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFA] top.c: initialize other UIs before cli
2001-11-07 17:25 ` Keith Seitz
@ 2001-11-08 2:06 ` Elena Zannoni
2001-11-08 4:07 ` Keith Seitz
0 siblings, 1 reply; 4+ messages in thread
From: Elena Zannoni @ 2001-11-08 2:06 UTC (permalink / raw)
To: Keith Seitz; +Cc: gdb-patches, Elena Zannoni
Keith Seitz writes:
> Sorry for the self-reply, but I didn't add any comments on this little
> hack...
>
> Reposted below.
>
Whoops. Sorry Keith, I approved it w/o cc-ing the list.
For the record, approved.
Elena
> On Mon, 19 Nov 2001, Keith Seitz wrote:
>
> > Hi,
> >
> > There is currently a little problem with init_ui_hook: if the UI fails to
> > initialize (and we should fall back to "gdb -nw"), then the CLI will NOT
> > get initialized properly.
> >
> > This results because init_ui_hook does not return any status indicating
> > the failure.
> >
> > This simple change will correct this anomaly without altering init_ui_hook
> > semantics, i.e., it is absolutely the least intrusive.
> >
> > ?
> > Keith
> >
> > ChangeLog
> > 2001-11-19 Keith Seitz <keiths@redhat.com>
> >
> > * top.c (gdb_init): Call init_ui_hook before initializing
> > the default UI.
> >
> > Patch
> Index: top.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/top.c,v
> retrieving revision 1.48
> diff -u -p -r1.48 top.c
> --- top.c 2001/11/10 21:34:56 1.48
> +++ top.c 2001/11/19 21:01:02
> @@ -182,8 +182,11 @@ 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);
>
> /* This hook is called from within gdb's many mini-event loops which could
> @@ -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);
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] top.c: initialize other UIs before cli
2001-11-08 2:06 ` Elena Zannoni
@ 2001-11-08 4:07 ` Keith Seitz
0 siblings, 0 replies; 4+ messages in thread
From: Keith Seitz @ 2001-11-08 4:07 UTC (permalink / raw)
To: gdb-patches
On Tue, 20 Nov 2001, Elena Zannoni wrote:
> Keith Seitz writes:
> > Sorry for the self-reply, but I didn't add any comments on this little
> > hack...
> >
> > Reposted below.
> >
>
> Whoops. Sorry Keith, I approved it w/o cc-ing the list.
>
> For the record, approved.
Committed.
Thanks!
Keith
> > On Mon, 19 Nov 2001, Keith Seitz wrote:
> >
> > > Hi,
> > >
> > > There is currently a little problem with init_ui_hook: if the UI fails to
> > > initialize (and we should fall back to "gdb -nw"), then the CLI will NOT
> > > get initialized properly.
> > >
> > > This results because init_ui_hook does not return any status indicating
> > > the failure.
> > >
> > > This simple change will correct this anomaly without altering init_ui_hook
> > > semantics, i.e., it is absolutely the least intrusive.
> > >
> > > ?
> > > Keith
> > >
> > > ChangeLog
> > > 2001-11-19 Keith Seitz <keiths@redhat.com>
> > >
> > > * top.c (gdb_init): Call init_ui_hook before initializing
> > > the default UI.
> > >
> > > Patch
> > Index: top.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/top.c,v
> > retrieving revision 1.48
> > diff -u -p -r1.48 top.c
> > --- top.c 2001/11/10 21:34:56 1.48
> > +++ top.c 2001/11/19 21:01:02
> > @@ -182,8 +182,11 @@ 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);
> >
> > /* This hook is called from within gdb's many mini-event loops which could
> > @@ -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);
> > }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-11-20 16:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-07 16:33 [RFA] top.c: initialize other UIs before cli Keith Seitz
2001-11-07 17:25 ` Keith Seitz
2001-11-08 2:06 ` Elena Zannoni
2001-11-08 4:07 ` Keith Seitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox