public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* HW breakpoint on Linux x86 native
@ 2012-07-16 16:39 Michael Eager
  2012-07-16 17:32 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Eager @ 2012-07-16 16:39 UTC (permalink / raw)
  To: gdb

Hi --

I noticed that the FSF version of gdb builds without hw
break support for x86 native.  The version of gdb distributed
by RedHat includes a patch to turn this feature on, with a
comment about gdb-6.6 compatibility.

Can someone tell me why hw bp is not enabled by default
for native x86?

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

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

* Re: HW breakpoint on Linux x86 native
  2012-07-16 16:39 HW breakpoint on Linux x86 native Michael Eager
@ 2012-07-16 17:32 ` Daniel Jacobowitz
  2012-07-16 18:17   ` Michael Eager
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2012-07-16 17:32 UTC (permalink / raw)
  To: Michael Eager; +Cc: gdb

On Mon, Jul 16, 2012 at 12:39 PM, Michael Eager <eager@eagerm.com> wrote:
> Hi --
>
> I noticed that the FSF version of gdb builds without hw
> break support for x86 native.  The version of gdb distributed
> by RedHat includes a patch to turn this feature on, with a
> comment about gdb-6.6 compatibility.
>
> Can someone tell me why hw bp is not enabled by default
> for native x86?

Can you be a little more specific about what is not enabled by
default?  Hardware breakpoints are certainly supported.

-- 
Thanks,
Daniel

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

* Re: HW breakpoint on Linux x86 native
  2012-07-16 17:32 ` Daniel Jacobowitz
@ 2012-07-16 18:17   ` Michael Eager
  2012-07-16 18:43     ` Jan Kratochvil
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Eager @ 2012-07-16 18:17 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

On 07/16/2012 10:32 AM, Daniel Jacobowitz wrote:
> On Mon, Jul 16, 2012 at 12:39 PM, Michael Eager <eager@eagerm.com> wrote:
>> Hi --
>>
>> I noticed that the FSF version of gdb builds without hw
>> break support for x86 native.  The version of gdb distributed
>> by RedHat includes a patch to turn this feature on, with a
>> comment about gdb-6.6 compatibility.
>>
>> Can someone tell me why hw bp is not enabled by default
>> for native x86?
>
> Can you be a little more specific about what is not enabled by
> default?  Hardware breakpoints are certainly supported.

In i386-linux-nat.c, _initialize_i386_linux_nat() calls
i386_use_watchpoints() which sets to_can_use_hw_breakpoint =
i386_can_use_hw_breakpoint in the target_ops returned by
linux_target().  Looks fine.

When running a local process, the target vector is different,
created by init_exec_ops() in exec.c.  This defaults to
to_can_use_hw_breakpoint = reply_zero().

RH has a patch which forces the test in their gdb-7.3.1 release:

+/* Red Hat backward compatibility with gdb-6.8.  */
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1



-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


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

* Re: HW breakpoint on Linux x86 native
  2012-07-16 18:17   ` Michael Eager
@ 2012-07-16 18:43     ` Jan Kratochvil
  2012-07-16 18:55       ` Michael Eager
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kratochvil @ 2012-07-16 18:43 UTC (permalink / raw)
  To: Michael Eager; +Cc: Daniel Jacobowitz, gdb

On Mon, 16 Jul 2012 20:17:43 +0200, Michael Eager wrote:
> When running a local process, the target vector is different,
> created by init_exec_ops() in exec.c.  This defaults to
> to_can_use_hw_breakpoint = reply_zero().
> 
> RH has a patch which forces the test in their gdb-7.3.1 release:

http://pkgs.fedoraproject.org/gitweb/?p=gdb.git;a=blob_plain;f=gdb-bz541866-rwatch-before-run.patch;hb=master

It seems to be fixed in FSF GDB since 7.4 by:

[RFA 2/3] Demote to sw watchpoint only in update_watchpoint
http://sourceware.org/ml/gdb-patches/2011-04/msg00292.html
http://sourceware.org/ml/gdb-patches/2011-05/msg00042.html
commit efa8e67a1ea2d6f90d86efc31076f24e67940f8e
Author: Thiago Jung Bauermann <bauerman@br.ibm.com>
Date:   Thu May 5 22:52:09 2011 +0000
        Demote to sw watchpoint only in update_watchpoint.

Do you really run gdb-7.4+?

(Going to drop the Fedora patch now, thanks for the notification.)


Thanks,
Jan

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

* Re: HW breakpoint on Linux x86 native
  2012-07-16 18:43     ` Jan Kratochvil
@ 2012-07-16 18:55       ` Michael Eager
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Eager @ 2012-07-16 18:55 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: Daniel Jacobowitz, gdb

On 07/16/2012 11:43 AM, Jan Kratochvil wrote:
> On Mon, 16 Jul 2012 20:17:43 +0200, Michael Eager wrote:
>> When running a local process, the target vector is different,
>> created by init_exec_ops() in exec.c.  This defaults to
>> to_can_use_hw_breakpoint = reply_zero().
>>
>> RH has a patch which forces the test in their gdb-7.3.1 release:
>
> http://pkgs.fedoraproject.org/gitweb/?p=gdb.git;a=blob_plain;f=gdb-bz541866-rwatch-before-run.patch;hb=master
>
> It seems to be fixed in FSF GDB since 7.4 by:
>
> [RFA 2/3] Demote to sw watchpoint only in update_watchpoint
> http://sourceware.org/ml/gdb-patches/2011-04/msg00292.html
> http://sourceware.org/ml/gdb-patches/2011-05/msg00042.html
> commit efa8e67a1ea2d6f90d86efc31076f24e67940f8e
> Author: Thiago Jung Bauermann <bauerman@br.ibm.com>
> Date:   Thu May 5 22:52:09 2011 +0000
>          Demote to sw watchpoint only in update_watchpoint.
>
> Do you really run gdb-7.4+?

$ gdb t
GNU gdb (GDB) 7.4.50.20120710-cvs
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/t...done.
(gdb) l
1       #include <stdio.h>
2
3       int main (void)
4       {
5         int a, b, c;
6
7         a = 5;
8         b = 10;
9         c = b - a;
10        if (c == 5)
(gdb) hb 8
No hardware breakpoint support in the target.
(gdb) b 8
Breakpoint 1 at 0x4004db: file t.c, line 8.
(gdb) quit



-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


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

end of thread, other threads:[~2012-07-16 18:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-16 16:39 HW breakpoint on Linux x86 native Michael Eager
2012-07-16 17:32 ` Daniel Jacobowitz
2012-07-16 18:17   ` Michael Eager
2012-07-16 18:43     ` Jan Kratochvil
2012-07-16 18:55       ` Michael Eager

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).