* -nowindows (-nw) option cancels MI interpreter
@ 2008-04-09 17:41 Marc Khouzam
2008-04-09 17:48 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Marc Khouzam @ 2008-04-09 17:41 UTC (permalink / raw)
To: gdb
Hi,
the -nowindows option to GDB caused the interpreter to be forced to be CONSOLE.
This means that something like
gdb -i=mi -nw
is equivalent to
gdb -i=console -nw
I would expect that the MI interpreter would not be affected by the -nw option...
It is also confusing (although a quick workaround)
that, because of the order options are read does matters
gdb -nw -i=mi
will work.
From what I gather, there are two GUI interpreters: Insight and TUI.
Is that correct?
I was thinking that the -nw option should force the console
interpreter only if the current interpreter is one of the two GUI ones.
This problem is not of great impact, but it did cause me to waste
some time figuring out why DSF was suddently broken (once I added the -nw)
The patch below explains.
It does not fix the fact that:
gdb -nw -i=tui
and
gdb -i=tui -nw
don't behave the same (same for insight).
diff -u -r1.67 main.c
--- gdb/main.c 14 Mar 2008 17:21:07 -0000 1.67
+++ gdb/main.c 9 Apr 2008 16:47:19 -0000
@@ -160,6 +160,7 @@
char *homedir;
int i;
+ size_t len;
long time_at_startup = get_run_time ();
@@ -410,9 +411,25 @@
use_windows = 1;
break;
case OPT_NOWINDOWS:
- /* -nw is equivalent to -i=console. */
- xfree (interpreter_p);
- interpreter_p = xstrdup (INTERP_CONSOLE);
+ /* -nw is equivalent to -i=console, but only replace the
+ interpreter in the case it was a GUI interpreter. */
+ len = sizeof(interpreter_p) < sizeof(INTERP_INSIGHT) ?
+ sizeof(interpreter_p) : sizeof(INTERP_INSIGHT);
+ if (memcmp (interpreter_p, INTERP_INSIGHT, len) == 0)
+ {
+ xfree (interpreter_p);
+ interpreter_p = xstrdup (INTERP_CONSOLE);
+ }
+ else
+ {
+ len = sizeof(interpreter_p) < sizeof(INTERP_TUI) ?
+ sizeof(interpreter_p) : sizeof(INTERP_TUI);
+ if (memcmp (interpreter_p, INTERP_TUI, len) == 0)
+ {
+ xfree (interpreter_p);
+ interpreter_p = xstrdup (INTERP_CONSOLE);
+ }
+ }
use_windows = 0;
break;
case 'f':
==
Marc Khouzam
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: -nowindows (-nw) option cancels MI interpreter
2008-04-09 17:41 -nowindows (-nw) option cancels MI interpreter Marc Khouzam
@ 2008-04-09 17:48 ` Daniel Jacobowitz
2008-04-09 17:54 ` Bob Rossi
2008-04-09 20:29 ` Michael Snyder
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2008-04-09 17:48 UTC (permalink / raw)
To: Marc Khouzam; +Cc: gdb
On Wed, Apr 09, 2008 at 01:24:29PM -0400, Marc Khouzam wrote:
> Hi,
>
> the -nowindows option to GDB caused the interpreter to be forced to be CONSOLE.
> This means that something like
> gdb -i=mi -nw
> is equivalent to
> gdb -i=console -nw
>
> I would expect that the MI interpreter would not be affected by the -nw option...
-nw is completely equivalent to -i=console. So it's sensitive to
where you put it on the command line. I think it's easier to improve
the manual...
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: -nowindows (-nw) option cancels MI interpreter
2008-04-09 17:48 ` Daniel Jacobowitz
@ 2008-04-09 17:54 ` Bob Rossi
2008-04-09 21:04 ` Daniel Jacobowitz
2008-04-09 20:29 ` Michael Snyder
1 sibling, 1 reply; 5+ messages in thread
From: Bob Rossi @ 2008-04-09 17:54 UTC (permalink / raw)
To: Marc Khouzam, gdb
On Wed, Apr 09, 2008 at 01:35:39PM -0400, Daniel Jacobowitz wrote:
> On Wed, Apr 09, 2008 at 01:24:29PM -0400, Marc Khouzam wrote:
> > Hi,
> >
> > the -nowindows option to GDB caused the interpreter to be forced to be CONSOLE.
> > This means that something like
> > gdb -i=mi -nw
> > is equivalent to
> > gdb -i=console -nw
> >
> > I would expect that the MI interpreter would not be affected by the -nw option...
>
> -nw is completely equivalent to -i=console. So it's sensitive to
> where you put it on the command line. I think it's easier to improve
> the manual...
Really? At one point, the cygwin build would automatically pop up
insight if you run gdb. So, I do -nw -a2 to start gdb. When I switch to
mi mode in the future, what should I put?
Bob Rossi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: -nowindows (-nw) option cancels MI interpreter
2008-04-09 17:48 ` Daniel Jacobowitz
2008-04-09 17:54 ` Bob Rossi
@ 2008-04-09 20:29 ` Michael Snyder
1 sibling, 0 replies; 5+ messages in thread
From: Michael Snyder @ 2008-04-09 20:29 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Marc Khouzam, gdb
On Wed, 2008-04-09 at 13:35 -0400, Daniel Jacobowitz wrote:
> On Wed, Apr 09, 2008 at 01:24:29PM -0400, Marc Khouzam wrote:
> > Hi,
> >
> > the -nowindows option to GDB caused the interpreter to be forced to be CONSOLE.
> > This means that something like
> > gdb -i=mi -nw
> > is equivalent to
> > gdb -i=console -nw
> >
> > I would expect that the MI interpreter would not be affected by the -nw option...
>
> -nw is completely equivalent to -i=console. So it's sensitive to
> where you put it on the command line. I think it's easier to improve
> the manual...
I suppose, back in the day, we thought of MI as loosely
equivalent to "windowing interface". But there could be
present or future MI clients that aren't windowing interfaces.
Maybe calls for a re-think.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: -nowindows (-nw) option cancels MI interpreter
2008-04-09 17:54 ` Bob Rossi
@ 2008-04-09 21:04 ` Daniel Jacobowitz
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2008-04-09 21:04 UTC (permalink / raw)
To: Bob Rossi; +Cc: Marc Khouzam, gdb
On Wed, Apr 09, 2008 at 01:40:35PM -0400, Bob Rossi wrote:
> Really? At one point, the cygwin build would automatically pop up
> insight if you run gdb. So, I do -nw -a2 to start gdb. When I switch to
> mi mode in the future, what should I put?
Just -i=mi (or -i=mi<number>).
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-04-09 17:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-09 17:41 -nowindows (-nw) option cancels MI interpreter Marc Khouzam
2008-04-09 17:48 ` Daniel Jacobowitz
2008-04-09 17:54 ` Bob Rossi
2008-04-09 21:04 ` Daniel Jacobowitz
2008-04-09 20:29 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox