* Pending breakpoints and scripts
@ 2004-02-09 20:02 Andrew Cagney
2004-02-09 22:32 ` Daniel Jacobowitz
0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2004-02-09 20:02 UTC (permalink / raw)
To: gdb
Anyone noticed this?
(top-gdb) run testsuite/gdb.base/advance
Starting program: ...
Setting up the environment for debugging gdb.
Function "internal_error" not defined.
Breakpoint 1 (internal_error) pending.
Function "info_command" not defined.
Breakpoint 2 (info_command) pending.
(top-gdb)
It's caused by this:
if (!query ("Make breakpoint pending on future shared library
load? ")
)
return rc;
The old behavior was: when in batch mode, throw an error (and hence
abandon the script) if the breakpoint insert fails.
The new behavior is: when in batch mode, always insert the breakpoint.
when not in batch mode never throw an error.
For the existing behavior to be restored the query's logic would need to
be reversed (ask the oposite question) and then re-throw the error. A
/pending qualifier could then be added.
Thoughts?
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-09 20:02 Pending breakpoints and scripts Andrew Cagney
@ 2004-02-09 22:32 ` Daniel Jacobowitz
2004-02-10 21:22 ` Andrew Cagney
0 siblings, 1 reply; 25+ messages in thread
From: Daniel Jacobowitz @ 2004-02-09 22:32 UTC (permalink / raw)
To: gdb
On Mon, Feb 09, 2004 at 03:02:19PM -0500, Andrew Cagney wrote:
> Anyone noticed this?
>
> (top-gdb) run testsuite/gdb.base/advance
> Starting program: ...
> Setting up the environment for debugging gdb.
> Function "internal_error" not defined.
> Breakpoint 1 (internal_error) pending.
> Function "info_command" not defined.
> Breakpoint 2 (info_command) pending.
> (top-gdb)
>
> It's caused by this:
>
> if (!query ("Make breakpoint pending on future shared library
> load? ")
> )
> return rc;
>
> The old behavior was: when in batch mode, throw an error (and hence
> abandon the script) if the breakpoint insert fails.
>
> The new behavior is: when in batch mode, always insert the breakpoint.
> when not in batch mode never throw an error.
>
> For the existing behavior to be restored the query's logic would need to
> be reversed (ask the oposite question) and then re-throw the error. A
> /pending qualifier could then be added.
>
> Thoughts?
I'd rather not reverse the question. We could check from_tty at the
call site, and not set pending breakpoints if no tty...
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-09 22:32 ` Daniel Jacobowitz
@ 2004-02-10 21:22 ` Andrew Cagney
2004-02-10 22:26 ` Daniel Jacobowitz
0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2004-02-10 21:22 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
> On Mon, Feb 09, 2004 at 03:02:19PM -0500, Andrew Cagney wrote:
>
>> Anyone noticed this?
>>
>> (top-gdb) run testsuite/gdb.base/advance
>> Starting program: ...
>> Setting up the environment for debugging gdb.
>> Function "internal_error" not defined.
>> Breakpoint 1 (internal_error) pending.
>> Function "info_command" not defined.
>> Breakpoint 2 (info_command) pending.
>> (top-gdb)
>>
>> It's caused by this:
>>
>> if (!query ("Make breakpoint pending on future shared library
>> load? ")
>> )
>> return rc;
>>
>> The old behavior was: when in batch mode, throw an error (and hence
>> abandon the script) if the breakpoint insert fails.
>>
>> The new behavior is: when in batch mode, always insert the breakpoint.
>> when not in batch mode never throw an error.
>>
>> For the existing behavior to be restored the query's logic would need to
>> be reversed (ask the oposite question) and then re-throw the error. A
>> /pending qualifier could then be added.
>>
>> Thoughts?
>
>
> I'd rather not reverse the question. We could check from_tty at the
> call site, and not set pending breakpoints if no tty...
Why?
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-10 21:22 ` Andrew Cagney
@ 2004-02-10 22:26 ` Daniel Jacobowitz
2004-02-11 3:48 ` System calls debugging MuthuKumar-Hotpop
2004-02-11 14:31 ` Pending breakpoints and scripts Andrew Cagney
0 siblings, 2 replies; 25+ messages in thread
From: Daniel Jacobowitz @ 2004-02-10 22:26 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb
On Tue, Feb 10, 2004 at 04:22:41PM -0500, Andrew Cagney wrote:
> >On Mon, Feb 09, 2004 at 03:02:19PM -0500, Andrew Cagney wrote:
> >
> >>Anyone noticed this?
> >>
> >>(top-gdb) run testsuite/gdb.base/advance
> >>Starting program: ...
> >>Setting up the environment for debugging gdb.
> >>Function "internal_error" not defined.
> >>Breakpoint 1 (internal_error) pending.
> >>Function "info_command" not defined.
> >>Breakpoint 2 (info_command) pending.
> >>(top-gdb)
> >>
> >>It's caused by this:
> >>
> >> if (!query ("Make breakpoint pending on future shared library
> >>load? ")
> >>)
> >> return rc;
> >>
> >>The old behavior was: when in batch mode, throw an error (and hence
> >>abandon the script) if the breakpoint insert fails.
> >>
> >>The new behavior is: when in batch mode, always insert the breakpoint.
> >>when not in batch mode never throw an error.
> >>
> >>For the existing behavior to be restored the query's logic would need to
> >>be reversed (ask the oposite question) and then re-throw the error. A
> >>/pending qualifier could then be added.
> >>
> >>Thoughts?
> >
> >
> >I'd rather not reverse the question. We could check from_tty at the
> >call site, and not set pending breakpoints if no tty...
>
> Why?
Well, how would you word it? It makes more intuitive sense to me to
answer 'y' to create something special and 'n' to do nothing, than the
other way around.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 25+ messages in thread
* System calls debugging
2004-02-10 22:26 ` Daniel Jacobowitz
@ 2004-02-11 3:48 ` MuthuKumar-Hotpop
2004-02-12 9:58 ` how to include subdirectories too, for the source directory murugesan
2004-02-11 14:31 ` Pending breakpoints and scripts Andrew Cagney
1 sibling, 1 reply; 25+ messages in thread
From: MuthuKumar-Hotpop @ 2004-02-11 3:48 UTC (permalink / raw)
Cc: gdb
Hello deBUGies,
Is there any way to debug what are all the "system calls" usage and process happening over on the program.
I have written a simple program which gets the a string.I have made it to wait for the input and using that process-id,
I have attached the process with gdb.Now the "where" command gives the stackframes about the system calls information.
To find the processings of other system calls what is the way.
Regards,
Muthu.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-10 22:26 ` Daniel Jacobowitz
2004-02-11 3:48 ` System calls debugging MuthuKumar-Hotpop
@ 2004-02-11 14:31 ` Andrew Cagney
2004-02-11 14:47 ` Daniel Jacobowitz
1 sibling, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2004-02-11 14:31 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
>> >I'd rather not reverse the question. We could check from_tty at the
>> >call site, and not set pending breakpoints if no tty...
>
>>
>> Why?
>
>
> Well, how would you word it? It makes more intuitive sense to me to
> answer 'y' to create something special and 'n' to do nothing, than the
> other way around.
Something like:
"Discard breakpoint, rather than mark it pending?"
is a guess.
The real problem here is with batch scripts, the change breaks existing
script behavior (which is never a good thing).
How about this, we introduce:
nquery()
yquery()
where the default (batch mode, and when return is pressed is n/y
respectively). We'd need the language police to look over the interface
but should otherwize be ok.
Andrew
PS: There's a GUI bug here also. The query doesn't contain the error
message (cf my recent change to internal-error where I made certain each
query contained the full context of the question).
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-11 14:31 ` Pending breakpoints and scripts Andrew Cagney
@ 2004-02-11 14:47 ` Daniel Jacobowitz
2004-02-17 19:24 ` Andrew Cagney
2004-02-19 22:42 ` [RFA]: Patch for pending " Jeff Johnston
0 siblings, 2 replies; 25+ messages in thread
From: Daniel Jacobowitz @ 2004-02-11 14:47 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb
On Wed, Feb 11, 2004 at 09:31:23AM -0500, Andrew Cagney wrote:
>
> >>>I'd rather not reverse the question. We could check from_tty at the
> >>>call site, and not set pending breakpoints if no tty...
> >
> >>
> >>Why?
> >
> >
> >Well, how would you word it? It makes more intuitive sense to me to
> >answer 'y' to create something special and 'n' to do nothing, than the
> >other way around.
>
> Something like:
>
> "Discard breakpoint, rather than mark it pending?"
>
> is a guess.
That's why I don't want to reverse the question - I find that really
unintuitive. Perhaps it's just me.
> The real problem here is with batch scripts, the change breaks existing
> script behavior (which is never a good thing).
>
> How about this, we introduce:
> nquery()
> yquery()
> where the default (batch mode, and when return is pressed is n/y
> respectively). We'd need the language police to look over the interface
> but should otherwize be ok.
Works for me.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 25+ messages in thread
* how to include subdirectories too, for the source directory
2004-02-11 3:48 ` System calls debugging MuthuKumar-Hotpop
@ 2004-02-12 9:58 ` murugesan
2004-02-12 13:07 ` Bob Rossi
0 siblings, 1 reply; 25+ messages in thread
From: murugesan @ 2004-02-12 9:58 UTC (permalink / raw)
To: gdb
Hello all,
I need to include a directory (including it's subdirectories ). I did
that with
gdb --directory=home --directory=/home/sub1 --directory=/home/sub2
............
Is there a way to get out from this riddle to include recursively the
subdirectories.
Thanks
Murugesan
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: how to include subdirectories too, for the source directory
2004-02-12 9:58 ` how to include subdirectories too, for the source directory murugesan
@ 2004-02-12 13:07 ` Bob Rossi
2004-02-13 4:23 ` murugesan
0 siblings, 1 reply; 25+ messages in thread
From: Bob Rossi @ 2004-02-12 13:07 UTC (permalink / raw)
To: murugesan; +Cc: gdb
On Thu, Feb 12, 2004 at 03:27:40PM +0530, murugesan wrote:
> Hello all,
> I need to include a directory (including it's subdirectories ). I did
> that with
> gdb --directory=home --directory=/home/sub1 --directory=/home/sub2
> ............
>
> Is there a way to get out from this riddle to include recursively the
> subdirectories.
Generate the names given a directory with a command. For example,
(find directoryName -type d | perl -pi -e 's/(.*)/--directory=$1/')
That will generate a '--directory=dir' for every directory in
directoryName.
What you need looks like it can easily be accomplished outside of GDB.
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: how to include subdirectories too, for the source directory
2004-02-12 13:07 ` Bob Rossi
@ 2004-02-13 4:23 ` murugesan
0 siblings, 0 replies; 25+ messages in thread
From: murugesan @ 2004-02-13 4:23 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb
Thanks BOB &Michael.
I am off way in my attempt.
Regards,
Murugesan
----- Original Message -----
From: Bob Rossi
To: murugesan
Cc: gdb@sources.redhat.com
Sent: Thursday, February 12, 2004 6:37 PM
Subject: Re: how to include subdirectories too, for the source directory
On Thu, Feb 12, 2004 at 03:27:40PM +0530, murugesan wrote:
> Hello all,
> I need to include a directory (including it's subdirectories ). I did
> that with
> gdb --directory=home --directory=/home/sub1 --directory=/home/sub2
> ............
>
> Is there a way to get out from this riddle to include recursively the
> subdirectories.
Generate the names given a directory with a command. For example,
(find directoryName -type d | perl -pi -e 's/(.*)/--directory=$1/')
That will generate a '--directory=dir' for every directory in
directoryName.
What you need looks like it can easily be accomplished outside of GDB.
Bob Rossi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-11 14:47 ` Daniel Jacobowitz
@ 2004-02-17 19:24 ` Andrew Cagney
2004-02-17 19:31 ` Daniel Jacobowitz
2004-02-19 22:42 ` [RFA]: Patch for pending " Jeff Johnston
1 sibling, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2004-02-17 19:24 UTC (permalink / raw)
To: Daniel Jacobowitz, J. Johnston; +Cc: gdb
> The real problem here is with batch scripts, the change breaks existing
>> script behavior (which is never a good thing).
>>
>> How about this, we introduce:
>> nquery()
>> yquery()
>> where the default (batch mode, and when return is pressed is n/y
>> respectively). We'd need the language police to look over the interface
>> but should otherwize be ok.
>
>
> Works for me.
Lets see if we can pin down the interface (adding JeffJ to the CC list):
nquery("A question?")
A question? [n]:
- press return => implied "n"
- batch mode => implied "n"
that would mean here:
> if (!query ("Make breakpoint pending on future shared library load? ")
nquery ("Make breakpoint pending on future shared library load?");
Make breakpoint pending on future shared library load? [n]:
- press return => old behavior
- batch mode => old behavior
- "y" => new behavior
Looking at the "set breakpoint pending":
yes - implies the above is "y"
no - implies that the above is "n"
auto - implies that the query occures
Jeff, work for you?
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-17 19:24 ` Andrew Cagney
@ 2004-02-17 19:31 ` Daniel Jacobowitz
2004-02-17 19:39 ` Andrew Cagney
0 siblings, 1 reply; 25+ messages in thread
From: Daniel Jacobowitz @ 2004-02-17 19:31 UTC (permalink / raw)
To: Andrew Cagney; +Cc: J. Johnston, gdb
On Tue, Feb 17, 2004 at 02:24:32PM -0500, Andrew Cagney wrote:
> >The real problem here is with batch scripts, the change breaks existing
> >>script behavior (which is never a good thing).
> >>
> >>How about this, we introduce:
> >> nquery()
> >> yquery()
> >>where the default (batch mode, and when return is pressed is n/y
> >>respectively). We'd need the language police to look over the interface
> >>but should otherwize be ok.
> >
> >
> >Works for me.
>
> Lets see if we can pin down the interface (adding JeffJ to the CC list):
>
> nquery("A question?")
>
> A question? [n]:
>
> - press return => implied "n"
> - batch mode => implied "n"
How would you feel about "[n/y]"? Otherwise, I like this.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-17 19:31 ` Daniel Jacobowitz
@ 2004-02-17 19:39 ` Andrew Cagney
2004-02-17 19:41 ` Daniel Jacobowitz
0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2004-02-17 19:39 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: J. Johnston, gdb
> On Tue, Feb 17, 2004 at 02:24:32PM -0500, Andrew Cagney wrote:
>
>> >The real problem here is with batch scripts, the change breaks existing
>
>> >>script behavior (which is never a good thing).
>> >>
>> >>How about this, we introduce:
>> >> nquery()
>> >> yquery()
>> >>where the default (batch mode, and when return is pressed is n/y
>> >>respectively). We'd need the language police to look over the interface
>> >>but should otherwize be ok.
>
>> >
>> >
>> >Works for me.
>
>>
>> Lets see if we can pin down the interface (adding JeffJ to the CC list):
>>
>> nquery("A question?")
>>
>> A question? [n]:
>>
>> - press return => implied "n"
>> - batch mode => implied "n"
>
>
> How would you feel about "[n/y]"? Otherwise, I like this.
As in?
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-17 19:39 ` Andrew Cagney
@ 2004-02-17 19:41 ` Daniel Jacobowitz
2004-02-17 20:07 ` Jeff Johnston
2004-02-17 20:13 ` Andrew Cagney
0 siblings, 2 replies; 25+ messages in thread
From: Daniel Jacobowitz @ 2004-02-17 19:41 UTC (permalink / raw)
To: gdb
On Tue, Feb 17, 2004 at 02:39:05PM -0500, Andrew Cagney wrote:
> >On Tue, Feb 17, 2004 at 02:24:32PM -0500, Andrew Cagney wrote:
> >
> >>>The real problem here is with batch scripts, the change breaks existing
> >
> >>>>script behavior (which is never a good thing).
> >>>>
> >>>>How about this, we introduce:
> >>>> nquery()
> >>>> yquery()
> >>>>where the default (batch mode, and when return is pressed is n/y
> >>>>respectively). We'd need the language police to look over the
> >>interface >>but should otherwize be ok.
> >
> >>>
> >>>
> >>>Works for me.
> >
> >>
> >>Lets see if we can pin down the interface (adding JeffJ to the CC list):
> >>
> >>nquery("A question?")
> >>
> >> A question? [n]:
> >>
> >> - press return => implied "n"
> >> - batch mode => implied "n"
> >
> >
> >How would you feel about "[n/y]"? Otherwise, I like this.
>
> As in?
nquery("A question?");
A question? (n or y) <CURSOR>
or
A question? [n/y]: <CURSOR>
Simply to clarify that it is a yes-no question.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-17 19:41 ` Daniel Jacobowitz
@ 2004-02-17 20:07 ` Jeff Johnston
2004-02-17 20:14 ` Andrew Cagney
2004-02-17 20:13 ` Andrew Cagney
1 sibling, 1 reply; 25+ messages in thread
From: Jeff Johnston @ 2004-02-17 20:07 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
Daniel Jacobowitz wrote:
> On Tue, Feb 17, 2004 at 02:39:05PM -0500, Andrew Cagney wrote:
>
>>>On Tue, Feb 17, 2004 at 02:24:32PM -0500, Andrew Cagney wrote:
>>>
>>>
>>>>>The real problem here is with batch scripts, the change breaks existing
>>>
>>>>>>script behavior (which is never a good thing).
>>>>>>
>>>>>>How about this, we introduce:
>>>>>> nquery()
>>>>>> yquery()
>>>>>>where the default (batch mode, and when return is pressed is n/y
>>>>>>respectively). We'd need the language police to look over the
>>>>
>>>>interface >>but should otherwize be ok.
>>>
>>>>>
>>>>>Works for me.
>>>
Me too.
>>>>Lets see if we can pin down the interface (adding JeffJ to the CC list):
>>>>
>>>>nquery("A question?")
>>>>
>>>> A question? [n]:
>>>>
>>>> - press return => implied "n"
>>>> - batch mode => implied "n"
>>>
>>>
>>>How would you feel about "[n/y]"? Otherwise, I like this.
>>
>>As in?
>
>
> nquery("A question?");
> A question? (n or y) <CURSOR>
>
> or
>
> A question? [n/y]: <CURSOR>
>
> Simply to clarify that it is a yes-no question.
>
I agree you have to indicate a yes/no question. Would it be clearer to add
square brackets around the default in each case ([y] or n) vs (y or [n])? This
is closer to the old query which was (y or n).
-- Jeff J.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-17 19:41 ` Daniel Jacobowitz
2004-02-17 20:07 ` Jeff Johnston
@ 2004-02-17 20:13 ` Andrew Cagney
2004-02-17 20:15 ` Daniel Jacobowitz
1 sibling, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2004-02-17 20:13 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
>> >>Lets see if we can pin down the interface (adding JeffJ to the CC list):
>> >>
>> >>nquery("A question?")
>> >>
>> >> A question? [n]:
>> >>
>> >> - press return => implied "n"
>> >> - batch mode => implied "n"
>
>> >
>> >
>> >How would you feel about "[n/y]"? Otherwise, I like this.
>
>>
>> As in?
>
>
> nquery("A question?");
> A question? (n or y) <CURSOR>
>
> or
>
> A question? [n/y]: <CURSOR>
>
> Simply to clarify that it is a yes-no question.
Er, ...
> How about this, we introduce:
> nquery()
> yquery()
> where the default (batch mode, and when return is pressed is n/y
> respectively).
with what you suggest, how is the user to differientiate the
consequences of entering return when presented with either of:
nquery("A question?")
A question? [y/n]:
and
yquery("A question?")
A question? [y/n]:
something like:
A question? (y or n) [n]:
would be needed (which would be getting into redundant verbage).
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-17 20:07 ` Jeff Johnston
@ 2004-02-17 20:14 ` Andrew Cagney
2004-02-17 20:15 ` Daniel Jacobowitz
0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2004-02-17 20:14 UTC (permalink / raw)
To: Jeff Johnston; +Cc: Daniel Jacobowitz, gdb
> I agree you have to indicate a yes/no question. Would it be clearer to add square brackets around the default in each case ([y] or n) vs (y or [n])? This is closer to the old query which was (y or n).
That appears to work. " (y or n) [n]: " is getting too long.
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-17 20:14 ` Andrew Cagney
@ 2004-02-17 20:15 ` Daniel Jacobowitz
0 siblings, 0 replies; 25+ messages in thread
From: Daniel Jacobowitz @ 2004-02-17 20:15 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Jeff Johnston, gdb
On Tue, Feb 17, 2004 at 03:14:30PM -0500, Andrew Cagney wrote:
> >I agree you have to indicate a yes/no question. Would it be clearer to
> >add square brackets around the default in each case ([y] or n) vs (y or
> >[n])? This is closer to the old query which was (y or n).
>
> That appears to work. " (y or n) [n]: " is getting too long.
Fine by me.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-17 20:13 ` Andrew Cagney
@ 2004-02-17 20:15 ` Daniel Jacobowitz
2004-02-17 20:30 ` Andrew Cagney
0 siblings, 1 reply; 25+ messages in thread
From: Daniel Jacobowitz @ 2004-02-17 20:15 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb
On Tue, Feb 17, 2004 at 03:13:19PM -0500, Andrew Cagney wrote:
>
> >>>>Lets see if we can pin down the interface (adding JeffJ to the CC list):
> >>>>
> >>>>nquery("A question?")
> >>>>
> >>>> A question? [n]:
> >>>>
> >>>> - press return => implied "n"
> >>>> - batch mode => implied "n"
> >
> >>>
> >>>
> >>>How would you feel about "[n/y]"? Otherwise, I like this.
> >
> >>
> >>As in?
> >
> >
> >nquery("A question?");
> > A question? (n or y) <CURSOR>
> >
> >or
> >
> > A question? [n/y]: <CURSOR>
> >
> >Simply to clarify that it is a yes-no question.
>
> Er, ...
>
> > How about this, we introduce:
> > nquery()
> > yquery()
> > where the default (batch mode, and when return is pressed is n/y
> > respectively).
>
> with what you suggest, how is the user to differientiate the
> consequences of entering return when presented with either of:
> nquery("A question?")
> A question? [y/n]:
> and
> yquery("A question?")
> A question? [y/n]:
> something like:
> A question? (y or n) [n]:
> would be needed (which would be getting into redundant verbage).
Easy, it would be:
> nquery("A question?")
> A question? [n/y]:
> yquery("A question?")
> A question? [y/n]:
If you want to use (y or n) [y], then that's fine by me too.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-17 20:15 ` Daniel Jacobowitz
@ 2004-02-17 20:30 ` Andrew Cagney
2004-02-17 20:35 ` Daniel Jacobowitz
0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cagney @ 2004-02-17 20:30 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
> with what you suggest, how is the user to differientiate the
>> consequences of entering return when presented with either of:
>> nquery("A question?")
>> A question? [y/n]:
>> and
>> yquery("A question?")
>> A question? [y/n]:
>> something like:
>> A question? (y or n) [n]:
>> would be needed (which would be getting into redundant verbage).
>
>
> Easy, it would be:
This is a joke, right?
>> nquery("A question?")
>> A question? [n/y]:
>
>
>> yquery("A question?")
>> A question? [y/n]:
>
>
> If you want to use (y or n) [y], then that's fine by me too.
Jeff's come up with a workable solution.
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-17 20:30 ` Andrew Cagney
@ 2004-02-17 20:35 ` Daniel Jacobowitz
0 siblings, 0 replies; 25+ messages in thread
From: Daniel Jacobowitz @ 2004-02-17 20:35 UTC (permalink / raw)
To: gdb
On Tue, Feb 17, 2004 at 03:30:27PM -0500, Andrew Cagney wrote:
> >with what you suggest, how is the user to differientiate the
> >>consequences of entering return when presented with either of:
> >> nquery("A question?")
> >> A question? [y/n]:
> >>and
> >> yquery("A question?")
> >> A question? [y/n]:
> >>something like:
> >> A question? (y or n) [n]:
> >>would be needed (which would be getting into redundant verbage).
> >
> >
> >Easy, it would be:
>
> This is a joke, right?
No, it was a serious suggestion. It's pretty standard for the first
option to be the default. If you don't like it, that's fine, Jeff's
suggestion works for me also.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 25+ messages in thread
* [RFA]: Patch for pending breakpoints and scripts
2004-02-11 14:47 ` Daniel Jacobowitz
2004-02-17 19:24 ` Andrew Cagney
@ 2004-02-19 22:42 ` Jeff Johnston
2004-02-23 15:56 ` Andrew Cagney
1 sibling, 1 reply; 25+ messages in thread
From: Jeff Johnston @ 2004-02-19 22:42 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Andrew Cagney, gdb
[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]
Daniel Jacobowitz wrote:
> On Wed, Feb 11, 2004 at 09:31:23AM -0500, Andrew Cagney wrote:
>
>>>>>I'd rather not reverse the question. We could check from_tty at the
>>>>>call site, and not set pending breakpoints if no tty...
>>>
>>>>Why?
>>>
>>>
>>>Well, how would you word it? It makes more intuitive sense to me to
>>>answer 'y' to create something special and 'n' to do nothing, than the
>>>other way around.
>>
>>Something like:
>>
>>"Discard breakpoint, rather than mark it pending?"
>>
>>is a guess.
>
>
> That's why I don't want to reverse the question - I find that really
> unintuitive. Perhaps it's just me.
>
>
>>The real problem here is with batch scripts, the change breaks existing
>>script behavior (which is never a good thing).
>>
>>How about this, we introduce:
>> nquery()
>> yquery()
>>where the default (batch mode, and when return is pressed is n/y
>>respectively). We'd need the language police to look over the interface
>>but should otherwize be ok.
>
>
> Works for me.
>
Ok, please review the attached patches.
gdb/ChangeLog:
2004-02-19 Jeff Johnston <jjohnstn@redhat.com>
* defs.h (nquery, yquery): New prototypes.
* breakpoint.c (break_command_1): Use new nquery interface.
* utils.c (defaulted_query, nquery, yquery): New functions.
gdb/testsuite/ChangeLog:
2004-02-19 Jeff Johnston <jjohnstn@redhat.com>
* lib/gdb.exp (gdb_breakpoint): Update query string to match
new nquery format.
* gdb.base/pending.exp: Ditto.
[-- Attachment #2: query.patch --]
[-- Type: text/plain, Size: 5555 bytes --]
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.142
diff -u -p -r1.142 defs.h
--- defs.h 18 Feb 2004 00:21:00 -0000 1.142
+++ defs.h 19 Feb 2004 21:51:40 -0000
@@ -405,6 +405,8 @@ extern void null_cleanup (void *);
extern int myread (int, char *, int);
extern int query (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern int nquery (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern int yquery (const char *, ...) ATTR_FORMAT (printf, 1, 2);
extern void init_page_info (void);
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.115
diff -u -p -r1.115 utils.c
--- utils.c 10 Feb 2004 19:08:13 -0000 1.115
+++ utils.c 19 Feb 2004 21:51:40 -0000
@@ -1339,6 +1339,145 @@ query (const char *ctlstr, ...)
}
\f
+/* This function supports the nquery() and yquery() functions.
+ Ask user a y-or-n question and return 0 if answer is no, 1 if
+ answer is yes, or default the answer to the specified default.
+ DEFCHAR is either 'y' or 'n' and refers to the default answer.
+ CTLSTR is the control string and should end in "? ". It should
+ not say how to answer, because we do that.
+ ARGS are the arguments passed along with the CTLSTR argument to
+ printf. */
+
+static int
+defaulted_query (const char *ctlstr, const char defchar, va_list args)
+{
+ int answer;
+ int ans2;
+ int retval;
+ int def_value;
+ char def_answer, not_def_answer;
+ char *y_string, *n_string;
+
+ /* Set up according to which answer is the default. */
+ if (defchar == 'y')
+ {
+ def_value = 1;
+ def_answer = 'Y';
+ not_def_answer = 'N';
+ y_string = "[y]";
+ n_string = "n";
+ }
+ else
+ {
+ def_value = 0;
+ def_answer = 'N';
+ not_def_answer = 'Y';
+ y_string = "y";
+ n_string = "[n]";
+ }
+
+ if (query_hook)
+ {
+ return query_hook (ctlstr, args);
+ }
+
+ /* Automatically answer default value if input is not from a terminal. */
+ if (!input_from_terminal_p ())
+ return def_value;
+
+ while (1)
+ {
+ wrap_here (""); /* Flush any buffered output */
+ gdb_flush (gdb_stdout);
+
+ if (annotation_level > 1)
+ printf_filtered ("\n\032\032pre-%cquery\n", defchar);
+
+ vfprintf_filtered (gdb_stdout, ctlstr, args);
+ printf_filtered ("(%s or %s) ", y_string, n_string);
+
+ if (annotation_level > 1)
+ printf_filtered ("\n\032\032%cquery\n", defchar);
+
+ wrap_here ("");
+ gdb_flush (gdb_stdout);
+
+ answer = fgetc (stdin);
+ clearerr (stdin); /* in case of C-d */
+ if (answer == EOF) /* C-d */
+ {
+ retval = def_value;
+ break;
+ }
+ /* Eat rest of input line, to EOF or newline */
+ if (answer != '\n')
+ do
+ {
+ ans2 = fgetc (stdin);
+ clearerr (stdin);
+ }
+ while (ans2 != EOF && ans2 != '\n' && ans2 != '\r');
+
+ if (answer >= 'a')
+ answer -= 040;
+ /* Check answer. For the non-default, the user must specify
+ the non-default explicitly. */
+ if (answer == not_def_answer)
+ {
+ retval = !def_value;
+ break;
+ }
+ /* Otherwise, for the default, the user may either specify
+ the required input or have it default by entering nothing. */
+ if (answer == def_answer || answer == '\n' ||
+ answer == '\r' || answer == EOF)
+ {
+ retval = def_value;
+ break;
+ }
+ /* Invalid entries are not defaulted and require another selection. */
+ printf_filtered ("Please answer %s or %s.\n",
+ y_string, n_string);
+ }
+
+ if (annotation_level > 1)
+ printf_filtered ("\n\032\032post-%cquery\n", defchar);
+ return retval;
+}
+\f
+
+/* Ask user a y-or-n question and return 0 if answer is no, 1 if
+ answer is yes, or 0 if answer is defaulted.
+ Takes three args which are given to printf to print the question.
+ The first, a control string, should end in "? ".
+ It should not say how to answer, because we do that. */
+
+int
+nquery (const char *ctlstr, ...)
+{
+ va_list args;
+
+ va_start (args, ctlstr);
+ return defaulted_query (ctlstr, 'n', args);
+ va_end (args);
+}
+
+/* Ask user a y-or-n question and return 0 if answer is no, 1 if
+ answer is yes, or 1 if answer is defaulted.
+ Takes three args which are given to printf to print the question.
+ The first, a control string, should end in "? ".
+ It should not say how to answer, because we do that. */
+
+int
+yquery (const char *ctlstr, ...)
+{
+ va_list args;
+
+ va_start (args, ctlstr);
+ return defaulted_query (ctlstr, 'y', args);
+ va_end (args);
+}
+
/* Print an error message saying that we couldn't make sense of a
\^mumble sequence in a string or character constant. START and END
indicate a substring of some larger string that contains the
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.158
diff -u -p -r1.158 breakpoint.c
--- breakpoint.c 3 Feb 2004 22:47:40 -0000 1.158
+++ breakpoint.c 19 Feb 2004 21:51:40 -0000
@@ -5103,7 +5103,7 @@ break_command_1 (char *arg, int flag, in
error_output_message (NULL, err_msg);
xfree (err_msg);
- if (!query ("Make breakpoint pending on future shared library load? "))
+ if (!nquery ("Make breakpoint pending on future shared library load? "))
return rc;
copy_arg = xstrdup (addr_start);
addr_string = ©_arg;
[-- Attachment #3: query.testsuite.patch --]
[-- Type: text/plain, Size: 2349 bytes --]
Index: lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.48
diff -u -p -r1.48 gdb.exp
--- lib/gdb.exp 10 Feb 2004 21:00:15 -0000 1.48
+++ lib/gdb.exp 19 Feb 2004 22:04:49 -0000
@@ -275,7 +275,7 @@ proc gdb_breakpoint { function } {
-re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {}
- -re "Make breakpoint pending.*y or n. $" {
+ -re "Make breakpoint pending.*y or \\\[n\\\]. $" {
send_gdb "n\n"
exp_continue
}
Index: gdb.base/pending.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pending.exp,v
retrieving revision 1.2
diff -u -p -r1.2 pending.exp
--- gdb.base/pending.exp 9 Feb 2004 10:55:24 -0000 1.2
+++ gdb.base/pending.exp 19 Feb 2004 22:04:49 -0000
@@ -111,7 +111,7 @@ if [target_info exists gdb_stub] {
#
gdb_test_multiple "break pendfunc1" "set pending breakpoint" {
- -re ".*Make breakpoint pending.*y or n. $" {
+ -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
gdb_test "y" "Breakpoint.*pendfunc1.*pending." "set pending breakpoint"
}
}
@@ -142,7 +142,7 @@ gdb_test "info break" \
# Test not setting a pending breakpoint
#
gdb_test_multiple "break pendfunc2" "Don't set pending breakpoint" {
- -re ".*Make breakpoint pending.*y or n. $" {
+ -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
gdb_test "n" "" "Don't set pending breakpoint"
}
}
@@ -192,7 +192,7 @@ gdb_test "info break" \
#
gdb_test_multiple "break pendshr.c:26 if x > 3" "Set pending breakpoint 2" {
- -re ".*Make breakpoint pending.*y or n. $" {
+ -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
gdb_test "y" "Breakpoint.*pendshr.c:26.*pending." \
"Set pending breakpoint 2"
}
@@ -247,7 +247,7 @@ gdb_breakpoint "main"
# Set non-existent pending breakpoint
#
gdb_test_multiple "break imaginary" "set imaginary pending breakpoint" {
- -re ".*Make breakpoint pending.*y or n. $" {
+ -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
gdb_test "y" "Breakpoint.*imaginary.*pending." \
"set imaginary pending breakpoint"
}
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFA]: Patch for pending breakpoints and scripts
2004-02-19 22:42 ` [RFA]: Patch for pending " Jeff Johnston
@ 2004-02-23 15:56 ` Andrew Cagney
0 siblings, 0 replies; 25+ messages in thread
From: Andrew Cagney @ 2004-02-23 15:56 UTC (permalink / raw)
To: Jeff Johnston; +Cc: Daniel Jacobowitz, gdb
> - if (!query ("Make breakpoint pending on future shared library load? "))
> + if (!nquery ("Make breakpoint pending on future shared library load? "))
Yes, ok.
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
2004-02-09 22:27 Pending " Michael Elizabeth Chastain
@ 2004-02-09 22:38 ` Andrew Cagney
0 siblings, 0 replies; 25+ messages in thread
From: Andrew Cagney @ 2004-02-09 22:38 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: gdb
> Thoughts?
>
>
> You might not agree with this thought ... push back the branch cut until
> there haven't been any new "breakpoint pending" issues surfaced for a
> week.
>
> (Kind of a brutal thought, I know)
Well, looking at the math:
- I post the enable tui patch today (...)
- wait a week
- I commit the enable tui patch (which will make a mess)
- wait a week
- branch
that puts the branch at ~22.
I think enabling the TUI will make this breakpoint stuff look like a ripple.
(I'm obviously going to have to commit the TUI stuff earlier :-/)
Andrew
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Pending breakpoints and scripts
@ 2004-02-09 22:27 Michael Elizabeth Chastain
2004-02-09 22:38 ` Andrew Cagney
0 siblings, 1 reply; 25+ messages in thread
From: Michael Elizabeth Chastain @ 2004-02-09 22:27 UTC (permalink / raw)
To: cagney, gdb
> Thoughts?
You might not agree with this thought ... push back the branch cut until
there haven't been any new "breakpoint pending" issues surfaced for a
week.
(Kind of a brutal thought, I know)
Michael C
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2004-02-23 15:56 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-09 20:02 Pending breakpoints and scripts Andrew Cagney
2004-02-09 22:32 ` Daniel Jacobowitz
2004-02-10 21:22 ` Andrew Cagney
2004-02-10 22:26 ` Daniel Jacobowitz
2004-02-11 3:48 ` System calls debugging MuthuKumar-Hotpop
2004-02-12 9:58 ` how to include subdirectories too, for the source directory murugesan
2004-02-12 13:07 ` Bob Rossi
2004-02-13 4:23 ` murugesan
2004-02-11 14:31 ` Pending breakpoints and scripts Andrew Cagney
2004-02-11 14:47 ` Daniel Jacobowitz
2004-02-17 19:24 ` Andrew Cagney
2004-02-17 19:31 ` Daniel Jacobowitz
2004-02-17 19:39 ` Andrew Cagney
2004-02-17 19:41 ` Daniel Jacobowitz
2004-02-17 20:07 ` Jeff Johnston
2004-02-17 20:14 ` Andrew Cagney
2004-02-17 20:15 ` Daniel Jacobowitz
2004-02-17 20:13 ` Andrew Cagney
2004-02-17 20:15 ` Daniel Jacobowitz
2004-02-17 20:30 ` Andrew Cagney
2004-02-17 20:35 ` Daniel Jacobowitz
2004-02-19 22:42 ` [RFA]: Patch for pending " Jeff Johnston
2004-02-23 15:56 ` Andrew Cagney
2004-02-09 22:27 Pending " Michael Elizabeth Chastain
2004-02-09 22:38 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox