Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch]: inform user that a watchpoint is hit
@ 2009-08-14 13:15 Chandru
  2009-08-15 10:57 ` Doug Evans
  0 siblings, 1 reply; 9+ messages in thread
From: Chandru @ 2009-08-14 13:15 UTC (permalink / raw)
  To: gdb-patches

When a program is restarted within gdb, the initial breakpoint hit messages are
not outputted on to the screen. Inform the user that a watchpoint has been hit

Signed-off-by: Chandru Siddalingappa <chandru@ilinux.vnet.ibm.com>
---

--- gdb/breakpoint.c.orig	2009-08-14 17:53:06.000000000 +0530
+++ gdb/breakpoint.c	2009-08-14 17:54:02.000000000 +0530
@@ -842,6 +842,9 @@ update_watchpoint (struct breakpoint *b,
   struct bp_location *loc;
   bpstat bs;
 
+  if (breakpoint_enabled (b))
+      mention(b);
+
   unlink_locations_from_global_list (b);
   for (loc = b->loc; loc;)
     {


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

* Re: [patch]: inform user that a watchpoint is hit
  2009-08-14 13:15 [patch]: inform user that a watchpoint is hit Chandru
@ 2009-08-15 10:57 ` Doug Evans
  2009-08-15 12:22   ` Chandru
  0 siblings, 1 reply; 9+ messages in thread
From: Doug Evans @ 2009-08-15 10:57 UTC (permalink / raw)
  To: Chandru; +Cc: gdb-patches

On Fri, Aug 14, 2009 at 3:32 AM, Chandru<chandru@in.ibm.com> wrote:
> When a program is restarted within gdb, the initial breakpoint hit messages are
> not outputted on to the screen. Inform the user that a watchpoint has been hit
>
> Signed-off-by: Chandru Siddalingappa <chandru@ilinux.vnet.ibm.com>
> ---
>
> --- gdb/breakpoint.c.orig       2009-08-14 17:53:06.000000000 +0530
> +++ gdb/breakpoint.c    2009-08-14 17:54:02.000000000 +0530
> @@ -842,6 +842,9 @@ update_watchpoint (struct breakpoint *b,
>   struct bp_location *loc;
>   bpstat bs;
>
> +  if (breakpoint_enabled (b))
> +      mention(b);
> +
>   unlink_locations_from_global_list (b);
>   for (loc = b->loc; loc;)
>     {
>

Hi.
If we're stopping because of a watchpoint and not reporting it, that's bad.
But it seems odd that this is happening, and simple experiments don't
reveal anything.
Do you have a testcase?


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

* Re: [patch]: inform user that a watchpoint is hit
  2009-08-15 10:57 ` Doug Evans
@ 2009-08-15 12:22   ` Chandru
  2009-08-18 17:31     ` Doug Evans
  0 siblings, 1 reply; 9+ messages in thread
From: Chandru @ 2009-08-15 12:22 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

Doug Evans wrote:
> On Fri, Aug 14, 2009 at 3:32 AM, Chandru<chandru@in.ibm.com> wrote:
>   
>> When a program is restarted within gdb, the initial breakpoint hit messages are
>> not outputted on to the screen. Inform the user that a watchpoint has been hit
>>
>> Signed-off-by: Chandru Siddalingappa <chandru@ilinux.vnet.ibm.com>
>> ---
>>
>> --- gdb/breakpoint.c.orig       2009-08-14 17:53:06.000000000 +0530
>> +++ gdb/breakpoint.c    2009-08-14 17:54:02.000000000 +0530
>> @@ -842,6 +842,9 @@ update_watchpoint (struct breakpoint *b,
>>   struct bp_location *loc;
>>   bpstat bs;
>>
>> +  if (breakpoint_enabled (b))
>> +      mention(b);
>> +
>>   unlink_locations_from_global_list (b);
>>   for (loc = b->loc; loc;)
>>     {
>>
>>     
>
> Hi.
> If we're stopping because of a watchpoint and not reporting it, that's bad.
> But it seems odd that this is happening, and simple experiments don't
> reveal anything.
> Do you have a testcase?
>   
yes,

The steps performed to reproduce are:

1) Compile the following program with debug info
2) Run the program.
3) Set a watchpoint for "value1" variable.
4) Run the test and do some checks. 
5) Program exits. Now restart the program execution
6) Expect to see the message of hitting the watchpoint for value1 in main () line 20.

#include <stdio.h>
#include <stdlib.h>

 int value1 = -1;
 int value2 = -1;

 int func1 ()
 {
    value1=2;
    value2=value1;
      return 0;

 }


 int main ()
 {
    int i;

    value1 =3;
    value2 = value1;
    for (i=0; i<2; i++) {
      value1 = i;
      value2 = value1;
    }

    func1();

     return 0;
 }


---------------

(gdb) break main
Breakpoint 1 at 0x8048453: file rawatch.c, line 20.
(gdb) run
Starting program: /home/vrvazque/rawatch

Breakpoint 1, main () at rawatch.c:20
20          value1 =3;
(gdb) rwatch value1
Hardware read watchpoint 2: value1
(gdb) awatch value1
Hardware access (read/write) watchpoint 3: value1
(gdb) cont
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = -1
New value = 3
0x08048462 in main () at rawatch.c:21
21          value2 = value1;
(gdb) cont
...
...
...
(gdb) cont
Continuing.

Program exited normally.
(gdb) run
Starting program: /home/vrvazque/rawatch

Breakpoint 1, main () at rawatch.c:20
20          value1 =3;
(gdb) cont


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

* Re: [patch]: inform user that a watchpoint is hit
  2009-08-15 12:22   ` Chandru
@ 2009-08-18 17:31     ` Doug Evans
  2009-08-19  8:05       ` Chandru
  0 siblings, 1 reply; 9+ messages in thread
From: Doug Evans @ 2009-08-18 17:31 UTC (permalink / raw)
  To: Chandru; +Cc: gdb-patches

On Sat, Aug 15, 2009 at 3:57 AM, Chandru<chandru@in.ibm.com> wrote:
> Doug Evans wrote:
>>
>> On Fri, Aug 14, 2009 at 3:32 AM, Chandru<chandru@in.ibm.com> wrote:
>>
>>>
>>> When a program is restarted within gdb, the initial breakpoint hit
>>> messages are
>>> not outputted on to the screen. Inform the user that a watchpoint has
>>> been hit
>>>
>>> Signed-off-by: Chandru Siddalingappa <chandru@ilinux.vnet.ibm.com>
>>> ---
>>>
>>> --- gdb/breakpoint.c.orig       2009-08-14 17:53:06.000000000 +0530
>>> +++ gdb/breakpoint.c    2009-08-14 17:54:02.000000000 +0530
>>> @@ -842,6 +842,9 @@ update_watchpoint (struct breakpoint *b,
>>>  struct bp_location *loc;
>>>  bpstat bs;
>>>
>>> +  if (breakpoint_enabled (b))
>>> +      mention(b);
>>> +
>>>  unlink_locations_from_global_list (b);
>>>  for (loc = b->loc; loc;)
>>>    {
>>>
>>>
>>
>> Hi.
>> If we're stopping because of a watchpoint and not reporting it, that's
>> bad.
>> But it seems odd that this is happening, and simple experiments don't
>> reveal anything.
>> Do you have a testcase?
>>
>
> yes,
>
> The steps performed to reproduce are:
>
> 1) Compile the following program with debug info
> 2) Run the program.
> 3) Set a watchpoint for "value1" variable.
> 4) Run the test and do some checks. 5) Program exits. Now restart the
> program execution
> 6) Expect to see the message of hitting the watchpoint for value1 in main ()
> line 20.
>
> #include <stdio.h>
> #include <stdlib.h>
>
> int value1 = -1;
> int value2 = -1;
>
> int func1 ()
> {
>   value1=2;
>   value2=value1;
>     return 0;
>
> }
>
>
> int main ()
> {
>   int i;
>
>   value1 =3;
>   value2 = value1;
>   for (i=0; i<2; i++) {
>     value1 = i;
>     value2 = value1;
>   }
>
>   func1();
>
>    return 0;
> }
>
>
> ---------------
>
> (gdb) break main
> Breakpoint 1 at 0x8048453: file rawatch.c, line 20.
> (gdb) run
> Starting program: /home/vrvazque/rawatch
>
> Breakpoint 1, main () at rawatch.c:20
> 20          value1 =3;
> (gdb) rwatch value1
> Hardware read watchpoint 2: value1
> (gdb) awatch value1
> Hardware access (read/write) watchpoint 3: value1
> (gdb) cont
> Continuing.
> Hardware access (read/write) watchpoint 3: value1
>
> Old value = -1
> New value = 3
> 0x08048462 in main () at rawatch.c:21
> 21          value2 = value1;
> (gdb) cont
> ...
> ...
> ...
> (gdb) cont
> Continuing.
>
> Program exited normally.
> (gdb) run
> Starting program: /home/vrvazque/rawatch
>
> Breakpoint 1, main () at rawatch.c:20
> 20          value1 =3;
> (gdb) cont
>
>

Thanks for the testcase!

Here's what I see with current cvs head:
[target = amd64-linux]

gdb$ gcc -g chandru.c
gdb$ ./gdb -nx a.out
GNU gdb (GDB) 6.8.50.20090818-cvs
Copyright (C) 2009 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-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(gdb) b main
Breakpoint 1 at 0x400471: file chandru.c, line 20.
(gdb) r
Starting program: /usr/local/g3/gnu/sourceware/dn/build/obj64/gdb/a.out

Breakpoint 1, main () at chandru.c:20
20        value1 =3;
(gdb) rwatch value1
Hardware read watchpoint 2: value1
(gdb) awatch value1
Hardware access (read/write) watchpoint 3: value1
(gdb) c
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = -1
New value = 3
0x0000000000400481 in main () at chandru.c:21
21        value2 = value1;
(gdb) c
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = 3
New value = 0
main () at chandru.c:24
24          value2 = value1;
(gdb)
Continuing.
Hardware read watchpoint 2: value1

Value = 0
Hardware access (read/write) watchpoint 3: value1

Value = 0
0x000000000040049f in main () at chandru.c:24
24          value2 = value1;
(gdb)
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = 0
New value = 1
main () at chandru.c:24
24          value2 = value1;
(gdb)
Continuing.
Hardware read watchpoint 2: value1

Value = 1
Hardware access (read/write) watchpoint 3: value1

Value = 1
0x000000000040049f in main () at chandru.c:24
24          value2 = value1;
(gdb)
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = 1
New value = 2
func1 () at chandru.c:10
10        value2=value1;
(gdb)
Continuing.
Hardware read watchpoint 2: value1

Value = 2
Hardware access (read/write) watchpoint 3: value1

Value = 2
0x000000000040045c in func1 () at chandru.c:10
10        value2=value1;
(gdb)
Continuing.

Program exited normally.
(gdb) r
Starting program: /usr/local/g3/gnu/sourceware/dn/build/obj64/gdb/a.out

Breakpoint 1, main () at chandru.c:20
20        value1 =3;
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x0000000000400471 in main at chandru.c:20
        breakpoint already hit 1 time
2       read watchpoint keep y                      value1
3       acc watchpoint keep y                      value1
(gdb) c
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = -1
New value = 3
0x0000000000400481 in main () at chandru.c:21
21        value2 = value1;
(gdb)

So in cvs head I'm not seeing a problem (though maybe there's more
needed to recreate it).
Which version of gdb are you using?

[Also, I haven't researched this, but maybe there's some overlap here with
http://sourceware.org/ml/gdb-patches/2009-08/msg00254.html.
Dunno.  Doesn't seem like it but thought I'd point it out.]


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

* Re: [patch]: inform user that a watchpoint is hit
  2009-08-18 17:31     ` Doug Evans
@ 2009-08-19  8:05       ` Chandru
  2009-08-19 13:03         ` Jan Kratochvil
  0 siblings, 1 reply; 9+ messages in thread
From: Chandru @ 2009-08-19  8:05 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

Doug Evans wrote:
> So in cvs head I'm not seeing a problem (though maybe there's more
> needed to recreate it).
> Which version of gdb are you using?
>
> [Also, I haven't researched this, but maybe there's some overlap here with
> http://sourceware.org/ml/gdb-patches/2009-08/msg00254.html.
> Dunno.  Doesn't seem like it but thought I'd point it out.]
>   
Hello Doug,
Thanks for trying the test program. What I was referring to was
the messages like the following to be outputted on the screen with
the patch applied..


Program exited normally.
(gdb) r
Starting program: /home/chandru/r
Hardware access (read/write) watchpoint 2: value1
Hardware read watchpoint 3: value1
Hardware access (read/write) watchpoint 2: value1
Hardware read watchpoint 3: value1
Hardware access (read/write) watchpoint 2: value1
Hardware read watchpoint 3: value1
Hardware access (read/write) watchpoint 2: value1
Hardware read watchpoint 3: value1
Hardware access (read/write) watchpoint 2: value1
Hardware read watchpoint 3: value1
Hardware access (read/write) watchpoint 2: value1
Hardware read watchpoint 3: value1

Breakpoint 1, main () at rwatch.c:20
20          value1 =3;
(gdb)

I was using a distribution supplied gdb-6.8.50 and found that upstream
gdb shows the same behaviour.  gdb-6.6 outputs these messages
without the patch when a program is restarted.

Thanks,
Chandru


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

* Re: [patch]: inform user that a watchpoint is hit
  2009-08-19  8:05       ` Chandru
@ 2009-08-19 13:03         ` Jan Kratochvil
  2009-08-24 11:27           ` Chandru
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Kratochvil @ 2009-08-19 13:03 UTC (permalink / raw)
  To: Chandru; +Cc: Doug Evans, gdb-patches

On Wed, 19 Aug 2009 09:56:37 +0200, Chandru wrote:
> What I was referring to was the messages like the following to be outputted
> on the screen with the patch applied..
>
> Program exited normally.
> (gdb) r
> Starting program: /home/chandru/r
> Hardware access (read/write) watchpoint 2: value1
> Hardware read watchpoint 3: value1
> Hardware access (read/write) watchpoint 2: value1
> Hardware read watchpoint 3: value1
> Hardware access (read/write) watchpoint 2: value1
> Hardware read watchpoint 3: value1
> Hardware access (read/write) watchpoint 2: value1
> Hardware read watchpoint 3: value1
> Hardware access (read/write) watchpoint 2: value1
> Hardware read watchpoint 3: value1
> Hardware access (read/write) watchpoint 2: value1
> Hardware read watchpoint 3: value1
>
> Breakpoint 1, main () at rwatch.c:20
> 20          value1 =3;
> (gdb)
>
> I was using a distribution supplied gdb-6.8.50 and found that upstream
> gdb shows the same behaviour.  gdb-6.6 outputs these messages
> without the patch when a program is restarted.

This is not reproducible for me.
* Which distribution?
* Which exact NVR (name-version-release) of the distribution package?
* The URL http://sourceware.org/ml/gdb-patches/2009-08/msg00254.html was
  referring to 4 patches, do you have all of them applied?
  (but these 4 patches have no effect on this testcase for me, shown as
  "archer-jankratochvil-watchpoint" below)
* Please provide both the testcase and complete GDB run screenshot in the same
  mail.  Once you refer to "rawatch.c", second time "rwatch.c".
  When you provide a screenshot refer to all the exact versions and possible
  patches applied to it.
* Provide the architecture in use (x86_64? i686? could it be ppc64?).
* Provide even the compiler version used.
* Provide the kernel version in use due to various ptrace syscall bugsin the
  past and present (asking primarily for the possibility of ppc64 in use and
  the watchpoints on it).


Thanks,
Jan

$ cat >rwatch.c
#include <stdio.h>
#include <stdlib.h>

int value1 = -1;
int value2 = -1;

int func1 ()
{
   value1=2;
   value2=value1;
     return 0;

}


int main ()
{
   int i;

   value1 =3;
   value2 = value1;
   for (i=0; i<2; i++) {
     value1 = i;
     value2 = value1;
   }

   func1();

    return 0;
}
$ gcc -o rwatch rwatch.c -Wall -g
$ ~/redhat/gdb-clean/gdb/gdb -nx ./rwatch
GNU gdb (GDB) 6.8.50.20090819-cvs
Copyright (C) 2009 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/>...
(gdb) break main
Breakpoint 1 at 0x4004a5: file rwatch.c, line 20.
(gdb) run
Starting program: /home/jkratoch/t/rwatch 

Breakpoint 1, main () at rwatch.c:20
20	   value1 =3;
(gdb) rwatch value1
Hardware read watchpoint 2: value1
(gdb) awatch value1
Hardware access (read/write) watchpoint 3: value1
(gdb) cont
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = -1
New value = 3
0x00000000004004b5 in main () at rwatch.c:21
21	   value2 = value1;
(gdb) 
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = 3
New value = 0
main () at rwatch.c:24
24	     value2 = value1;
(gdb) 
Continuing.
Hardware read watchpoint 2: value1

Value = 0
Hardware access (read/write) watchpoint 3: value1

Value = 0
0x00000000004004d3 in main () at rwatch.c:24
24	     value2 = value1;
(gdb) 
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = 0
New value = 1
main () at rwatch.c:24
24	     value2 = value1;
(gdb) 
Continuing.
Hardware read watchpoint 2: value1

Value = 1
Hardware access (read/write) watchpoint 3: value1

Value = 1
0x00000000004004d3 in main () at rwatch.c:24
24	     value2 = value1;
(gdb) 
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = 1
New value = 2
func1 () at rwatch.c:10
10	   value2=value1;
(gdb) 
Continuing.
Hardware read watchpoint 2: value1

Value = 2
Hardware access (read/write) watchpoint 3: value1

Value = 2
0x0000000000400490 in func1 () at rwatch.c:10
10	   value2=value1;
(gdb) 
Continuing.

Program exited normally.
(gdb) run
Starting program: /home/jkratoch/t/rwatch 

Breakpoint 1, main () at rwatch.c:20
20	   value1 =3;
(gdb) c
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = -1
New value = 3
0x00000000004004b5 in main () at rwatch.c:21
21	   value2 = value1;
(gdb) q
A debugging session is active.

	Inferior 2 [process 7180] will be killed.

Quit anyway? (y or n) y
$ ~/redhat/archer-jankratochvil-watchpoint/gdb/gdb -nx ./rwatch
GNU gdb (GDB) 6.8.50.20090818-cvs
Copyright (C) 2009 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/>...
(gdb) break main
Breakpoint 1 at 0x4004a5: file rwatch.c, line 20.
(gdb) run
Starting program: /home/jkratoch/t/rwatch 

Breakpoint 1, main () at rwatch.c:20
20	   value1 =3;
(gdb) rwatch value1
Hardware read watchpoint 2: value1
(gdb) awatch value1
Hardware access (read/write) watchpoint 3: value1
(gdb) cont
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = -1
New value = 3
0x00000000004004b5 in main () at rwatch.c:21
21	   value2 = value1;
(gdb) 
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = 3
New value = 0
main () at rwatch.c:24
24	     value2 = value1;
(gdb) 
Continuing.
Hardware read watchpoint 2: value1

Value = 0
Hardware access (read/write) watchpoint 3: value1

Value = 0
0x00000000004004d3 in main () at rwatch.c:24
24	     value2 = value1;
(gdb) 
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = 0
New value = 1
main () at rwatch.c:24
24	     value2 = value1;
(gdb) 
Continuing.
Hardware read watchpoint 2: value1

Value = 1
Hardware access (read/write) watchpoint 3: value1

Value = 1
0x00000000004004d3 in main () at rwatch.c:24
24	     value2 = value1;
(gdb) 
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = 1
New value = 2
func1 () at rwatch.c:10
10	   value2=value1;
(gdb) 
Continuing.
Hardware read watchpoint 2: value1

Value = 2
Hardware access (read/write) watchpoint 3: value1

Value = 2
0x0000000000400490 in func1 () at rwatch.c:10
10	   value2=value1;
(gdb) 
Continuing.

Program exited normally.
(gdb) run
Starting program: /home/jkratoch/t/rwatch 

Breakpoint 1, main () at rwatch.c:20
20	   value1 =3;
(gdb) cont
Continuing.
Hardware access (read/write) watchpoint 3: value1

Old value = -1
New value = 3
0x00000000004004b5 in main () at rwatch.c:21
21	   value2 = value1;
(gdb) q
A debugging session is active.

	Inferior 2 [process 7244] will be killed.

Quit anyway? (y or n) y
$ readelf -wi rwatch|grep producer
    < c>   DW_AT_producer    : (indirect string, offset: 0x1c): GNU C 4.4.0 20090506 (Red Hat 4.4.0-4)	
$ rpm -q gcc
gcc-4.4.0-4.x86_64
$ cat /proc/version 
Linux version 2.6.29.5-191.fc11.x86_64 (mockbuild@x86-5.fedora.phx.redhat.com) (gcc version 4.4.0 20090506 (Red Hat 4.4.0-4) (GCC) ) #1 SMP Tue Jun 16 23:23:21 EDT 2009
$ rpm -q kernel
kernel-2.6.29.5-191.fc11.x86_64
$ cat /etc/fedora-release 
Fedora release 11 (Leonidas)
$ _


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

* Re: [patch]: inform user that a watchpoint is hit
  2009-08-19 13:03         ` Jan Kratochvil
@ 2009-08-24 11:27           ` Chandru
  2009-08-27  7:45             ` Chandru
  0 siblings, 1 reply; 9+ messages in thread
From: Chandru @ 2009-08-24 11:27 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: Doug Evans, gdb-patches

Jan Kratochvil wrote:
> This is not reproducible for me.
> * Which distribution?
> * Which exact NVR (name-version-release) of the distribution package?
> * The URL http://sourceware.org/ml/gdb-patches/2009-08/msg00254.html was
>   referring to 4 patches, do you have all of them applied?
>   (but these 4 patches have no effect on this testcase for me, shown as
>   "archer-jankratochvil-watchpoint" below)
> * Please provide both the testcase and complete GDB run screenshot in the same
>   mail.  Once you refer to "rawatch.c", second time "rwatch.c".
>   When you provide a screenshot refer to all the exact versions and possible
>   patches applied to it.
> * Provide the architecture in use (x86_64? i686? could it be ppc64?).
> * Provide even the compiler version used.
> * Provide the kernel version in use due to various ptrace syscall bugsin the
>   past and present (asking primarily for the possibility of ppc64 in use and
>   the watchpoints on it).
>
>
> Thanks,
> Jan
>
>   
Hello Jan and Doug,

Thanks for your mails. I today downloaded gdb-6.6 and gdb-6.8.50.20090824.
gdb-6.6 outputs the messages as follows when the program is restarted


Program exited normally.
(gdb) r
Starting program: /home/chandru/rawatch
Hardware read watchpoint 2: value1
Hardware access (read/write) watchpoint 3: value1
Hardware read watchpoint 2: value1
Hardware access (read/write) watchpoint 3: value1
Hardware read watchpoint 2: value1
Hardware access (read/write) watchpoint 3: value1

Breakpoint 1, main () at rawatch.c:20
20          value1 =3;
(gdb)



whereas gdb-6.8.50.20090824 doesn't.

Program exited normally.
(gdb) r
Starting program: /home/chandru/rawatch

Breakpoint 1, main () at rawatch.c:20
20          value1 =3;
(gdb)



It is not the case that the read or access watchpoints are not being hit.
Just the messages like 'Hardware read watchpoint 2: value1' and
'Hardware access (read/write) watchpoint 3: value1'  are not shown
on the screen when the program is restarted and the condition

if (breakpoint_enabled (b))
      mention(b);


only helped to see those messages. It is only the first occurrence of the
watchpoints that the messages don't get displayed for. We could see the
messages for later occurrences of the watchpoints on value1. Hence this
is just a cosmetic issue and doesn't look like a architecture or a kernel
specific issue.

Thanks,
Chandru


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

* Re: [patch]: inform user that a watchpoint is hit
  2009-08-24 11:27           ` Chandru
@ 2009-08-27  7:45             ` Chandru
  2009-08-27  8:26               ` Jan Kratochvil
  0 siblings, 1 reply; 9+ messages in thread
From: Chandru @ 2009-08-27  7:45 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: Doug Evans, gdb-patches

Chandru wrote:
>>  
> Hello Jan and Doug,
>
> Thanks for your mails. I today downloaded gdb-6.6 and 
> gdb-6.8.50.20090824.
> gdb-6.6 outputs the messages as follows when the program is restarted
>
>
> Program exited normally.
> (gdb) r
> Starting program: /home/chandru/rawatch
> Hardware read watchpoint 2: value1
> Hardware access (read/write) watchpoint 3: value1
> Hardware read watchpoint 2: value1
> Hardware access (read/write) watchpoint 3: value1
> Hardware read watchpoint 2: value1
> Hardware access (read/write) watchpoint 3: value1
>
> Breakpoint 1, main () at rawatch.c:20
> 20          value1 =3;
> (gdb)
>
>
>
> whereas gdb-6.8.50.20090824 doesn't.
>
> Program exited normally.
> (gdb) r
> Starting program: /home/chandru/rawatch
>
> Breakpoint 1, main () at rawatch.c:20
> 20          value1 =3;
> (gdb)
>
>
>
> It is not the case that the read or access watchpoints are not being hit.
> Just the messages like 'Hardware read watchpoint 2: value1' and
> 'Hardware access (read/write) watchpoint 3: value1'  are not shown
> on the screen when the program is restarted and the condition
>
> if (breakpoint_enabled (b))
>      mention(b);
>
>
> only helped to see those messages. It is only the first occurrence of the
> watchpoints that the messages don't get displayed for. We could see the
> messages for later occurrences of the watchpoints on value1. Hence this
> is just a cosmetic issue and doesn't look like a architecture or a kernel
> specific issue.
>
> Thanks,
> Chandru
>
Hello Jan/Doug,

does this make sense or we need to do nothing over here ?,

Thanks,
Chandru


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

* Re: [patch]: inform user that a watchpoint is hit
  2009-08-27  7:45             ` Chandru
@ 2009-08-27  8:26               ` Jan Kratochvil
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Kratochvil @ 2009-08-27  8:26 UTC (permalink / raw)
  To: Chandru; +Cc: Doug Evans, gdb-patches

On Thu, 27 Aug 2009 09:36:55 +0200, Chandru wrote:
> Chandru wrote:
>> whereas gdb-6.8.50.20090824 doesn't.
>>
>> Program exited normally.
>> (gdb) r
>> Starting program: /home/chandru/rawatch
>>
>> Breakpoint 1, main () at rawatch.c:20
>> 20          value1 =3;
>> (gdb)

You did not paste a complete log of GDB from its start. I do not know what is
rawatch.c, I do not know where exactly did you put "Breakpoint 1" etc.

If line 20 is the first line of code of main and you did "break main" then it
is correct the first breakpoint/watchpoint hit is that in main as there could
not be hit any watchpoints before the first line of code being executed.


>> It is not the case that the read or access watchpoints are not being hit.
>> Just the messages like 'Hardware read watchpoint 2: value1' and
>> 'Hardware access (read/write) watchpoint 3: value1'  are not shown
>> on the screen when the program is restarted

As the line 20 is hit before any of the watchpoints are hit it is correct GDB
shows only "Breakpoint 1" at that moment.  If you do "continue" GDB should
show some of the watchpoints get hit.


>> It is only the first occurrence of the
>> watchpoints that the messages don't get displayed for.

I do not see any copy-paste showing any wrong behavior for gdb-6.8.50.20090824.
My tests also did not reproduce any wrong behavior.


> does this make sense or we need to do nothing over here ?,

Only gdb-6.8.50.20090824 is relevant here.  We cannot change gdb-6.6 even if
it was buggy.


Regards,
Jan


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

end of thread, other threads:[~2009-08-27  7:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-14 13:15 [patch]: inform user that a watchpoint is hit Chandru
2009-08-15 10:57 ` Doug Evans
2009-08-15 12:22   ` Chandru
2009-08-18 17:31     ` Doug Evans
2009-08-19  8:05       ` Chandru
2009-08-19 13:03         ` Jan Kratochvil
2009-08-24 11:27           ` Chandru
2009-08-27  7:45             ` Chandru
2009-08-27  8:26               ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox