This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: hbreak.exp: Test hardware breakpoints
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb-patches at sourceware dot org, "Maciej W. Rozycki" <macro at linux-mips dot org>, Mark Kettenis <kettenis at gnu dot org>
- Date: Tue, 23 Oct 2007 17:46:20 +0100 (BST)
- Subject: Re: hbreak.exp: Test hardware breakpoints
- References: <Pine.LNX.4.61.0709121858320.17380@perivale.mips.com> <20070921230133.GB28500@caradoc.them.org> <Pine.LNX.4.61.0709241211010.17776@perivale.mips.com> <20070924113241.GA7618@caradoc.them.org> <Pine.LNX.4.61.0709261448190.23821@perivale.mips.com> <20070930011752.GA21283@caradoc.them.org>
On Sat, 29 Sep 2007, Daniel Jacobowitz wrote:
> Maciej posted a patch to test hardware breakpoints. It passes on
> i386-linux, using current HEAD GDB. I wanted to see what would happen
> when the test was run against gdbserver, which does not support
> hardware breakpoints on i386 (yet). We encountered the long-standing
> bug that nm-i386.h overrides target.h using #define; this means that
> a native i386 GDB incorrectly tries to use ptrace even when connected
> to a remote target.
>
> I saw two ways to test: build a cross debugger or fix the bug. I
> fixed the bug. Unfortunately that broke the test:
>
> (gdb) hbreak main
> No hardware breakpoint support in the target.
> UNSUPPORTED: gdb.base/hbreak.exp: hardware breakpoints
>
> This is "target exec", since we have not yet started the program.
> While we were using #define to override GDB's defaults, this worked;
> every target, even exec, claimed to support watchpoints. Now that
> only "target child" supports hardware watchpoints, you can't insert
> hardware breakpoints before the program is running.
>
> This is the status quo on other targets too.
>
> How do you all feel about leaving the hbreak-before-run problem for
> another day, and adjusting the test to start the program running
> before trying hbreak?
Have we reached any conclusion on this matter? I cannot seem to find
any...
I am certainly fine to adjust the test script, at least for now -- no
problem. The question is how problematic, if at all, the change is to
people in actual debugging. For example, how often is a hardware
breakpoint used locally before a program is started:
(gdb) hbreak foo
(gdb) run
How about:
(gdb) break main
(gdb) run
[main() hit]
(gdb) hbreak foo
(gdb) continue
[foo() hit]
(gdb) run
And similarly for remote targets -- presumably having to define a
breakpoint before a connection is opened to the target is a non-issue, but
how about:
(gdb) target bar
(gdb) load
(gdb) hbreak foo
(gdb) run
[foo() hit]
(gdb) target bar
Not that these cases bother me terribly much, but they should be noted and
dismissed if not important enough.
Maciej