Daniel Jacobowitz | 1 Mar 2008 05:39

Re: hbreak.exp: Test hardware breakpoints

On Wed, Feb 27, 2008 at 03:11:38PM +0000, Maciej W. Rozycki wrote:
>  Daniel, have you got any further with this patch you proposed?  I can see 
> it has not been included in the tree.

I have checked in the updated version, which is attached.

>  Here is my gdb.base/hbreak.exp test case again, updated according to your 
> suggestion so that hardware breakpoints are only inserted once the target 
> has been placed into the execution mode.  It passes on i386-linux natively 
> and with the mipsisa32-sde-elf target using the 
> mips-sim-sde32/-EB/-march=mips32r2 and mips-sim-sde32/-EL/-march=mips32r2 
> boards.  It reports the cases correctly as unsupported on mips-linux 
> natively and with the mipsisa32-sde-elf target using the 
> mips-sim-sde32/-EB/-march=mips32r2 and mips-sim-sde32/-EL/-march=mips32r2 
> boards.

It fails using gdbserver.  The first failure looks like this:

(gdb) continue
Continuing.
Warning:
Cannot insert hardware breakpoint 10.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.

(gdb) FAIL: gdb.base/hbreak.exp: run until function breakpoint

"target remote" has hardware breakpoint support, but this particular
remote target does not.  Unfortunately we do not detect the error
and I am not sure how to make it do so.  There is a
(Continue reading)

Tom Tromey | 1 Mar 2008 05:59
Picon
Favicon

RFC add "convenience functions" to gdb

For quite a while now I've wanted to be able to make a breakpoint
conditional on the current frame's caller.  I was never able to think
of a way to do this.

And, yesterday I was thinking about the 'eval' patch and trying to
understand how I could use it to compile a '.gdbinit' into an
executable and automatically have gdb eval it.  I thought perhaps I
could make a global variable whose value would be the gdb script --
but I couldn't think of how to detect whether or not the symbol
existed.

So, this evening I spent some time adding a new "convenience function"
facility to gdb.  The idea here is that gdb will provide certain
useful functions which can be called during expression evaluation.
Then problems like the above reduce to adding a new internal function
which user scripts can call to query gdb or the inferior.

I chose the syntax $(function arguments) for this.  It is similar to
convenience variables but, as far as I can tell, not valid right now.
Also it is reminiscent of something sort of similar in bash.

This patch only includes a single function, 'caller-matches'.  You can
use it like:

    break somewhere if $(caller-matches main)

This will stop when in 'somewhere' when the caller's function name is
known and has 'main' as a substring.

Obviously this patch is nowhere near complete.  I didn't write
(Continue reading)

Tom Tromey | 1 Mar 2008 07:14
Picon
Favicon

Re: RFC add "convenience functions" to gdb

>>>>> "Tom" == Tom Tromey <tromey <at> redhat.com> writes:

Tom> For quite a while now I've wanted to be able to make a breakpoint
Tom> conditional on the current frame's caller.  I was never able to think
Tom> of a way to do this.

Of course, after sending this, I remembered that Roland told me how,
by setting multiple breakpoints and having the breakpoint in the outer
frame set a convenience variable.

I never remember this when actually debugging, though.  And, I think
convenience functions will have other uses.  So, please consider the
patch even though my example was a bad one.

Tom

Daniel Jacobowitz | 2 Mar 2008 05:24

Re: [rfc] Allow watchpoints on inaccessible memory

On Fri, Feb 29, 2008 at 12:10:00PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 28 Feb 2008 11:17:49 -0500
> > From: Daniel Jacobowitz <drow <at> false.org>
> > Cc: Eli Zaretskii <eliz <at> gnu.org>, Jim Blandy <jimb <at> red-bean.com>
> > 
> > Eli, is the NEWS entry OK?
> 
> Yes, but I think we should mention this feature in the manual as well.

What do you think of the attached?

> Btw, are there any command, either CLI or MI, that print the current
> value of the watched expression?  If there are, we need to fix them
> somehow in the case struct value is NULL.

No, there are no commands that do this; I checked all the uses of
struct breakpoint's val field.

> Also, maybe we should display <PENDING> in "info break" in this case,
> like we do with breakpoints.

That goes in the address field, which we don't use for other
watchpoints.  And we don't print the current value in info break,
so I think this is a full-fledged watchpoint; everything is
displayed as if we could read the value.

--

-- 
Daniel Jacobowitz
CodeSourcery

(Continue reading)

Jan Kratochvil | 2 Mar 2008 09:40
Picon
Favicon

[patch] Fix segfault on a failed watchpoint update

Hi,

currently GDB HEAD segfaults during one case for the PIE inferiors (failing as
it is the unpatched CVS HEAD), segfault fix attached.

Regards,
Jan

crash reproducibility:

$ runtest --target_board=unix/-fPIE/-pie gdb.base/watchpoint.exp
WARNING: Couldn't find the global config file.
Test Run By jkratoch on Sun Mar  2 09:31:14 2008
Native configuration is x86_64-unknown-linux-gnu

                === gdb tests ===

Schedule of variations:
    unix/-fPIE/-pie

Running target unix/-fPIE/-pie
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ../.././gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
Running ../.././gdb/testsuite/gdb.base/watchpoint.exp ...
FAIL: gdb.base/watchpoint.exp: run to marker1 in test_simple_watchpoint
ERROR: Process no longer exists
ERROR: Couldn't send disable 3 to GDB.
ERROR: Delete all breakpoints in delete_breakpoints (timeout)
ERROR: Delete all breakpoints in delete_breakpoints (timeout)
(Continue reading)

Daniel Jacobowitz | 2 Mar 2008 16:08

Re: [patch] Fix segfault on a failed watchpoint update

On Sun, Mar 02, 2008 at 09:40:50AM +0100, Jan Kratochvil wrote:
> Hi,
> 
> currently GDB HEAD segfaults during one case for the PIE inferiors (failing as
> it is the unpatched CVS HEAD), segfault fix attached.

Thanks, I can see what's wrong.  I'm about to commit another patch
which should fix this (just waiting for doc review, so probably
Monday).  Could you let me know if this fixes it?

http://sourceware.org/ml/gdb-patches/2008-02/msg00472.html

--

-- 
Daniel Jacobowitz
CodeSourcery

Jan Kratochvil | 2 Mar 2008 16:16
Picon
Favicon

Re: [patch] Fix segfault on a failed watchpoint update

On Sun, 02 Mar 2008 16:08:49 +0100, Daniel Jacobowitz wrote:
> On Sun, Mar 02, 2008 at 09:40:50AM +0100, Jan Kratochvil wrote:
> > Hi,
> > 
> > currently GDB HEAD segfaults during one case for the PIE inferiors (failing as
> > it is the unpatched CVS HEAD), segfault fix attached.
> 
> Thanks, I can see what's wrong.  I'm about to commit another patch
> which should fix this (just waiting for doc review, so probably
> Monday).  Could you let me know if this fixes it?
> 
> http://sourceware.org/ml/gdb-patches/2008-02/msg00472.html

Yes, this patch also fixes the segfault.

Thanks,
Jan

Eli Zaretskii | 2 Mar 2008 22:09
Picon

Re: [rfc] Allow watchpoints on inaccessible memory

> Date: Sat, 1 Mar 2008 23:24:32 -0500
> From: Daniel Jacobowitz <drow <at> false.org>
> Cc: gdb-patches <at> sourceware.org, jimb <at> red-bean.com
> 
> On Fri, Feb 29, 2008 at 12:10:00PM +0200, Eli Zaretskii wrote:
> > > Date: Thu, 28 Feb 2008 11:17:49 -0500
> > > From: Daniel Jacobowitz <drow <at> false.org>
> > > Cc: Eli Zaretskii <eliz <at> gnu.org>, Jim Blandy <jimb <at> red-bean.com>
> > > 
> > > Eli, is the NEWS entry OK?
> > 
> > Yes, but I think we should mention this feature in the manual as well.
> 
> What do you think of the attached?

Fine with me, thanks.

> everything is displayed as if we could read the value.

And therein lies the problem, no?

Daniel Jacobowitz | 3 Mar 2008 00:23

Re: [rfc] Allow watchpoints on inaccessible memory

On Sun, Mar 02, 2008 at 11:09:10PM +0200, Eli Zaretskii wrote:
> And therein lies the problem, no?

Do you think it is a problem?  I think they're pretty much normal watchpoints.

--

-- 
Daniel Jacobowitz
CodeSourcery

Eli Zaretskii | 3 Mar 2008 05:26
Picon

Re: [rfc] Allow watchpoints on inaccessible memory

> Date: Sun, 2 Mar 2008 18:23:02 -0500
> From: Daniel Jacobowitz <drow <at> false.org>
> 
> On Sun, Mar 02, 2008 at 11:09:10PM +0200, Eli Zaretskii wrote:
> > And therein lies the problem, no?
> 
> Do you think it is a problem?  I think they're pretty much normal watchpoints.

I disagree, but maybe I'm the only one, and the issue is minor anyway.


Gmane