public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/15800] New: IWBN to override what defaulted_query will do when input is not from terminal
@ 2013-07-29 19:30 dje at google dot com
  2013-07-29 19:38 ` [Bug gdb/15800] " palves at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dje at google dot com @ 2013-07-29 19:30 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15800

            Bug ID: 15800
           Summary: IWBN to override what defaulted_query will do when
                    input is not from terminal
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

When scripting something, and input is not from a terminal, there are some
things that cannot be done.

E.g. skip file foo.c
->
Ignore file pending future shared library load? (y or [n]) [answered N; input
not from terminal]

If foo.c isn't found the default is "N" (No), and there's no way to "reply" Y.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug gdb/15800] IWBN to override what defaulted_query will do when input is not from terminal
  2013-07-29 19:30 [Bug gdb/15800] New: IWBN to override what defaulted_query will do when input is not from terminal dje at google dot com
@ 2013-07-29 19:38 ` palves at redhat dot com
  2013-07-29 20:27 ` dje at google dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: palves at redhat dot com @ 2013-07-29 19:38 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15800

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at redhat dot com

--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
That's possibly to be a too-big-a-hammer.

We tend to be careful with choosing the default action (negative vs positive
wording, query/nquery/yquery).  I can imagine all sorts of wrong answers if we
just switched the default of "query".  IMO, it's better to handle this
query-by-query.

That is, add a "set skip pending on/off/auto/whatnot" for this case, mirroring
"set breakpoint pending".

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug gdb/15800] IWBN to override what defaulted_query will do when input is not from terminal
  2013-07-29 19:30 [Bug gdb/15800] New: IWBN to override what defaulted_query will do when input is not from terminal dje at google dot com
  2013-07-29 19:38 ` [Bug gdb/15800] " palves at redhat dot com
@ 2013-07-29 20:27 ` dje at google dot com
  2013-07-30 13:46 ` palves at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dje at google dot com @ 2013-07-29 20:27 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15800

--- Comment #2 from dje at google dot com ---
Depending on how it is implemented, yes, it could be a bit of a big hammer.

I was expecting to use it like:

(with-query-default "y" "skip file foo.c")

or some such.
[No apologies for having fun with Scheme. :-)]

I used "skip" as an example of a potentially general problem.
For "skip" itself, set "skip pending on/off/auto" or some such
is another way to go (as previously mentioned on IRC).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug gdb/15800] IWBN to override what defaulted_query will do when input is not from terminal
  2013-07-29 19:30 [Bug gdb/15800] New: IWBN to override what defaulted_query will do when input is not from terminal dje at google dot com
  2013-07-29 19:38 ` [Bug gdb/15800] " palves at redhat dot com
  2013-07-29 20:27 ` dje at google dot com
@ 2013-07-30 13:46 ` palves at redhat dot com
  2013-08-02 14:02 ` tromey at redhat dot com
  2013-08-02 17:43 ` dje at google dot com
  4 siblings, 0 replies; 6+ messages in thread
From: palves at redhat dot com @ 2013-07-30 13:46 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15800

--- Comment #3 from Pedro Alves <palves at redhat dot com> ---
(sorry, I was not on IRC then, and well, that doesn't get archived)

> (with-query-default "y" "skip file foo.c")

I still think it's a too big a hammer.  You don't really know which query GDB
will throw at the user.  Sure, usually it'll be the one you want, but sometimes
it won't.  And it's those other times that'll make such generic hammer
annoying.

We could still use a generic wrapping function like:

(wrap-option "skip pending" "on" "skip file foo.c")

With wrap-option working with any GDB option.  It just needs to store the
current value, set it to the second argument, run the command, and then restore
the initial value.  Should be doable in Python already today.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug gdb/15800] IWBN to override what defaulted_query will do when input is not from terminal
  2013-07-29 19:30 [Bug gdb/15800] New: IWBN to override what defaulted_query will do when input is not from terminal dje at google dot com
                   ` (2 preceding siblings ...)
  2013-07-30 13:46 ` palves at redhat dot com
@ 2013-08-02 14:02 ` tromey at redhat dot com
  2013-08-02 17:43 ` dje at google dot com
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2013-08-02 14:02 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15800

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com

--- Comment #4 from Tom Tromey <tromey at redhat dot com> ---
There were threads in the past about this problem, from the MI
perspective.  One further issue is that the queries change over time.

You can nearly do the "with" thing in Python.  However, bug#12188 can
get in the way, depending on the parameter you choose.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug gdb/15800] IWBN to override what defaulted_query will do when input is not from terminal
  2013-07-29 19:30 [Bug gdb/15800] New: IWBN to override what defaulted_query will do when input is not from terminal dje at google dot com
                   ` (3 preceding siblings ...)
  2013-08-02 14:02 ` tromey at redhat dot com
@ 2013-08-02 17:43 ` dje at google dot com
  4 siblings, 0 replies; 6+ messages in thread
From: dje at google dot com @ 2013-08-02 17:43 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15800

--- Comment #5 from dje at google dot com ---
Yeah, defaulted_query is flawed from a scripting point of view.
Consider this bug a discussion for how to fix it.

It's easy enough to add defaulted_query calls to code without remembering that
every one screws the user wanting to script that command unless extra steps are
taken, but do we want (effectively) a user-settable option for every
defaulted_query?

E.g.

          if (pending_break_support == AUTO_BOOLEAN_AUTO
              && !nquery (_("Make %s pending on future shared library load? "),
                          bptype_string (type_wanted)))

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-02 17:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-29 19:30 [Bug gdb/15800] New: IWBN to override what defaulted_query will do when input is not from terminal dje at google dot com
2013-07-29 19:38 ` [Bug gdb/15800] " palves at redhat dot com
2013-07-29 20:27 ` dje at google dot com
2013-07-30 13:46 ` palves at redhat dot com
2013-08-02 14:02 ` tromey at redhat dot com
2013-08-02 17:43 ` dje at google dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).