This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Avoid breakpoint query in MI


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 Â<nickrob@snap.net.nz>
> 
> ÂÂÂÂÂÂÂÂ* 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






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]