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: [RFA] new set/show multiple-choice-auto-select commands


> > This has been a very practical solution when in interactive mode
> > (ie when a user is driving the session), but an annoyance when driving
> > the debugger with a tool.
> 
> Please explain why, I'm not sure I understand.  When driving GDB with
> a tool, the tool is responsible for doing TRT, so why is this a
> nuisance?  And how does your solution alleviates that nuisance?

The "tool" in this case was a GDB script, and the customer didn't
want to see the menus in the output. And also, some of the AdaCore
engineers were tired of seeing the menu when they were always selecting
the "all" choice. So it's not a matter of the tool doing TRT.

Note that "nuisance" is stronger than what I meant: It's annoying
*sometimes* to have to deal with the menu. Each individual has its
own preferences, and this option allows you to configure GDB accordingly.

> Can you please give an example of the behavior under each one of these
> settings?  I'm afraid I cannot judge the suggestion without
> understanding its effect on the users.

Sure. When the setting is "off", the behavior is unchanged, and when
the expression has multiple matches, the output will look like this:

    (gdb) b normal_menu
    [0] cancel
    [1] all
    [2] pck.normal_menu at pck.adb:6
    [3] pck.normal_menu at pck.adb:11
    >

At this point, if you select 0 (cancel):

    > 0
    cancelled
    (gdb)

If you select 1 (all):

    > 1
    Breakpoint 1 at 0x8049517: file pck.adb, line 6.
    Breakpoint 2 at 0x804951d: file pck.adb, line 11.
    warning: Multiple breakpoints were set.
    Use the "delete" command to delete unwanted breakpoints.

And if you select either 2 or 3 (one specific location):

    > 2
    Breakpoint 4 at 0x8049517: file pck.adb, line 6.

When the setting is "all", then it's the same as the user always
selecting "1" (all) everytime the menu is displayed, except that
the menu is no longer displayed and all locations are always
selected:

    (gdb) set multiple-choice-auto-select all

    (gdb) b normal_menu
    Breakpoint 5 at 0x8049517: file pck.adb, line 6.
    Breakpoint 6 at 0x804951d: file pck.adb, line 11.
    warning: Multiple breakpoints were set.
    Use the "delete" command to delete unwanted breakpoints.

And, if the setting is "cancel", it's the same as the user always
selecting "0" (cancel) everytime. Similarly, the menu is never
displayed, a message is printed explaining that the expression
is ambiguous and has been canceled.

   (gdb) b normal_menu
   canceled because the command is ambiguous and the multiple-choice menu
   has been deactivated.  See set/show multiple-choice-auto-select.

> > +    error (_("\
> > +canceled because the command is ambiguous and the multiple-choice menu\n\
> > +has been deactivated.  See set/show multiple-choice-auto-select."));
> 
> Shouldn't "canceled" be capitalized?

Yes, you're right.

> The first line of the command's doc string should be a complete
> sentence, or at least a complete phrase.  That's because some help
> commands only display the first line (and stop at the first comma or
> period in that line, IIRC).

We can fix that too.

-- 
Joel


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