public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/11613] New: hardware watchpoint missed for -O2 -g inferior
@ 2010-05-19 19:51 jan dot kratochvil at redhat dot com
  2010-05-19 19:52 ` [Bug breakpoints/11613] " jan dot kratochvil at redhat dot com
  0 siblings, 1 reply; 3+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-05-19 19:51 UTC (permalink / raw)
  To: gdb-prs

==> 1.c <==
int
g (int j)
{
  int l = j + 2;
  return l;
}
extern int f (int i);
int
main (int argc, char **argv)
{
  f (1);
  return 0;
}

==> 2.c <==
extern int g (int j);
int
f (int i)
{
  i++;
  g (2);
  return g (i);
}


gcc 1.c 2.s -Wall -o 1 -m32
# Tested with gcc-4.4.3-4.fc12.x86_64 but 1.c -> 2.s is attached precompiled.

Works using 'set can-use-hw-watchpoints 0' workaround:

$ gdb -nx -ex 'set can-use-hw-watchpoints 0' -ex 'b f' -ex r -ex 'p i' -ex
'watch i' -ex 'adv 7' -ex 'p i' ./1
$1 = 1
Watchpoint 2: i
Watchpoint 2: i

Old value = 1
New value = 2
f (i=2) at 2.c:6
6	  g (2);
$2 = 2


Does not work without the workaround:
$ gdb -nx -ex 'b f' -ex r -ex 'p i' -ex 'watch i' -ex 'adv 7' -ex 'p i' ./1
$1 = 1
Hardware watchpoint 2: i
f (i=2) at 2.c:7
7	  return g (i);
$2 = 2
The value has changed but the breakpoint has not triggered.

 <2><3e>: Abbrev Number: 3 (DW_TAG_formal_parameter)
    <3f>   DW_AT_name        : i
    <43>   DW_AT_type        : <0x4c>
    <47>   DW_AT_location    : 0x0      (location list)
Contents of the .debug_loc section:
    Offset   Begin    End      Expression
    00000000 080483d0 080483da (DW_OP_fbreg: 0)
    00000000 080483da 080483f1 (DW_OP_breg3: 1; DW_OP_stack_value)
    00000000 <End of list>

-- 
           Summary: hardware watchpoint missed for -O2 -g inferior
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jan dot kratochvil at redhat dot com
                CC: gdb-prs at sourceware dot org,sergiodj at redhat dot com
GCC target triplet: i386-unknown-linux-gnu


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug breakpoints/11613] hardware watchpoint missed for -O2 -g inferior
  2010-05-19 19:51 [Bug breakpoints/11613] New: hardware watchpoint missed for -O2 -g inferior jan dot kratochvil at redhat dot com
@ 2010-05-19 19:52 ` jan dot kratochvil at redhat dot com
  0 siblings, 0 replies; 3+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-05-19 19:52 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jan dot kratochvil at redhat dot com  2010-05-19 19:52 -------
Created an attachment (id=4802)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4802&action=view)
2.s precompiled code.


-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug breakpoints/11613] hardware watchpoint missed for -O2 -g inferior
       [not found] <bug-11613-4717@http.sourceware.org/bugzilla/>
@ 2011-05-16 20:56 ` tromey at redhat dot com
  0 siblings, 0 replies; 3+ messages in thread
From: tromey at redhat dot com @ 2011-05-16 20:56 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

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

--- Comment #2 from Tom Tromey <tromey at redhat dot com> 2011-05-16 20:55:33 UTC ---
Maybe location lists could refine the bounds of the scope
used to decide when a watchpoint expression should be
reparsed.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2011-05-16 20:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-19 19:51 [Bug breakpoints/11613] New: hardware watchpoint missed for -O2 -g inferior jan dot kratochvil at redhat dot com
2010-05-19 19:52 ` [Bug breakpoints/11613] " jan dot kratochvil at redhat dot com
     [not found] <bug-11613-4717@http.sourceware.org/bugzilla/>
2011-05-16 20:56 ` tromey at redhat 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).