From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29341 invoked by alias); 17 Apr 2008 16:35:30 -0000 Received: (qmail 29330 invoked by uid 22791); 17 Apr 2008 16:35:30 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 17 Apr 2008 16:34:59 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.63) (envelope-from ) id 1JmX4X-0003zR-P0 for gdb-patches@sources.redhat.com; Thu, 17 Apr 2008 20:34:56 +0400 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.63) (envelope-from ) id 1JmX4M-0003z4-Qn; Thu, 17 Apr 2008 20:34:42 +0400 From: Vladimir Prus Subject: Re: [PATCH] Avoid breakpoint query in MI To: Nick Roberts ,gdb-patches@sources.redhat.com Date: Thu, 17 Apr 2008 16:42:00 -0000 References: <18439.18322.632208.43670@kahikatea.snap.net.nz> User-Agent: KNode/0.10.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit Message-Id: Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00347.txt.bz2 Nick Roberts wrote: > This updates my earlier patch > (http://sourceware.org/ml/gdb-patches/2008-01/msg00421.html) from the thread > "bug in mi when setting breakpoint" started last year by Dodji Seketeli.  It is > simplified by Joel's recent patch for multiple symbols and Vladimir's concept > of top-level interpreter. > > I see the default for multiple-symbols is 'all' (it used to be 'ask', perhaps > this change should be mentioned in NEWS) which might make this change more > acceptable. > > Nick                                           http://www.inet.net.nz/~nickrob > > > 2008-04-18  Nick Roberts   > >         * interps.c (interp_top_level): New function. > >         * interps.h: New extern. > >         * linespec.c: Include interps.h and mi/mi-cmds.h. >         (decode_line_2): When using MI, always set all breakpoints in menu. > > > *** interps.h   15 Mar 2008 18:14:50 +1300      1.14 > --- interps.h   18 Apr 2008 00:47:56 +1200       > *************** extern int current_interp_display_prompt > *** 66,71 **** > --- 66,72 ---- >   extern void current_interp_command_loop (void); >   /* Returns opaque data associated with the top-level interpreter.  */ >   extern void *top_level_interpreter_data (void); > + extern void *interp_top_level (void); Please name this top_level_interpreter. Also, the return type should be "struct interp*". In fact, I have a not-yet-submitted patches which does just that :-) >   >   extern void clear_interpreter_hooks (void); >   > > *** interps.c   15 Mar 2008 18:14:50 +1300      1.23 > --- interps.c   16 Apr 2008 15:37:01 +1200       > *************** interpreter_completer (char *text, char > *** 476,482 **** >     return matches; >   } >   > ! extern void * >   top_level_interpreter_data (void) >   { >     gdb_assert (top_level_interpreter); > --- 476,488 ---- >     return matches; >   } >   > ! void * > ! interp_top_level (void) > ! { > !   return top_level_interpreter;   > ! } > ! > ! void * >   top_level_interpreter_data (void) >   { >     gdb_assert (top_level_interpreter); > > > *** linespec.c  18 Apr 2008 00:10:58 +1200      1.75 > --- linespec.c  18 Apr 2008 00:21:29 +1200       > *************** > *** 36,41 **** > --- 36,43 ---- >   #include "linespec.h" >   #include "exceptions.h" >   #include "language.h" > + #include "interps.h" > + #include "mi/mi-cmds.h" >   >   /* We share this one with symtab.c, but it is not exported widely. */ >   > *************** See set/show multiple-symbol.")); > *** 524,530 **** >   >     /* If select_mode is "all", then do not print the multiple-choice >        menu and act as if the user had chosen choice "1" (all).  */ > !   if (select_mode == multiple_symbols_all) >       args = "1"; >     else >       { > --- 526,533 ---- >   >     /* If select_mode is "all", then do not print the multiple-choice >        menu and act as if the user had chosen choice "1" (all).  */ > !   if (select_mode == multiple_symbols_all > !       || ui_out_is_mi_like_p (interp_ui_out (interp_top_level ()))) >       args = "1"; >     else >       { I think that adding breakpoints on all symbols is better than silently grabbing random symbol, so the above seems fine to me. Can somebody approve the linespec.c bit? - Volodya