From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17531 invoked by alias); 9 Apr 2008 17:24:54 -0000 Received: (qmail 17520 invoked by uid 22791); 9 Apr 2008 17:24:52 -0000 X-Spam-Check-By: sourceware.org Received: from imr1.ericy.com (HELO imr1.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 09 Apr 2008 17:24:31 +0000 Received: from eusrcmw750.eamcs.ericsson.se (eusrcmw750.exu.ericsson.se [138.85.77.50]) by imr1.ericy.com (8.13.1/8.13.1) with ESMTP id m39HOUaY024550 for ; Wed, 9 Apr 2008 12:24:30 -0500 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw750.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Apr 2008 12:24:30 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: -nowindows (-nw) option cancels MI interpreter Date: Wed, 09 Apr 2008 17:41:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA04291048@ecamlmw720.eamcs.ericsson.se> From: "Marc Khouzam" To: X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00073.txt.bz2 Hi, the -nowindows option to GDB caused the interpreter to be forced to be CONS= OLE. This means that something like gdb -i=3Dmi -nw=20 is equivalent to=20 gdb -i=3Dconsole -nw I would expect that the MI interpreter would not be affected by the -nw opt= ion... It is also confusing (although a quick workaround) that, because of the order options are read does matters gdb -nw -i=3Dmi will work. =46rom 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=3Dtui and gdb -i=3Dtui -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; =20 int i; + size_t len; =20 long time_at_startup =3D get_run_time (); =20 @@ -410,9 +411,25 @@ use_windows =3D 1; break; case OPT_NOWINDOWS: - /* -nw is equivalent to -i=3Dconsole. */ - xfree (interpreter_p); - interpreter_p =3D xstrdup (INTERP_CONSOLE); + /* -nw is equivalent to -i=3Dconsole, but only replace the + interpreter in the case it was a GUI interpreter. */ + len =3D sizeof(interpreter_p) < sizeof(INTERP_INSIGHT) ?=20 + sizeof(interpreter_p) : sizeof(INTERP_INSIGHT); + if (memcmp (interpreter_p, INTERP_INSIGHT, len) =3D=3D 0) + { + xfree (interpreter_p); + interpreter_p =3D xstrdup (INTERP_CONSOLE); + } + else + { + len =3D sizeof(interpreter_p) < sizeof(INTERP_TUI) ?=20 + sizeof(interpreter_p) : sizeof(INTERP_TUI); + if (memcmp (interpreter_p, INTERP_TUI, len) =3D=3D 0) + { + xfree (interpreter_p); + interpreter_p =3D xstrdup (INTERP_CONSOLE); + } + } use_windows =3D 0; break; case 'f': =3D=3D=20 Marc Khouzam