* create a watchpoint with trace functionality
@ 2009-10-21 13:37 martin mangard
2009-10-21 14:35 ` Michael Snyder
0 siblings, 1 reply; 4+ messages in thread
From: martin mangard @ 2009-10-21 13:37 UTC (permalink / raw)
To: gdb
Hello
I'm trying to trace the value of a global status variable of an
application. This variable is changed from various code positions. I
would like to log/trace each change of this variable without stopping
the application (at least for a long time) in order to perform a
longterm test. I'm currently using a hardware-watchpoint
Is there a possibility to configure a "autocontinue" after a
watchpoint-event? Which means that the changed value is printed and
the execution continues without any user interaction (pressing "c")?
Is ist possible to set a tracepoint on a change of a memory area?
Martin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: create a watchpoint with trace functionality
2009-10-21 13:37 create a watchpoint with trace functionality martin mangard
@ 2009-10-21 14:35 ` Michael Snyder
2009-10-21 14:55 ` Nicholas Mc Guire
0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2009-10-21 14:35 UTC (permalink / raw)
To: martin mangard; +Cc: gdb
martin mangard wrote:
> Hello
>
> I'm trying to trace the value of a global status variable of an
> application. This variable is changed from various code positions. I
> would like to log/trace each change of this variable without stopping
> the application (at least for a long time) in order to perform a
> longterm test. I'm currently using a hardware-watchpoint
>
> Is there a possibility to configure a "autocontinue" after a
> watchpoint-event? Which means that the changed value is printed and
> the execution continues without any user interaction (pressing "c")?
Yes, sure. See below.
> Is ist possible to set a tracepoint on a change of a memory area?
A tracepoint is different from a watchpoint, and no, I don't
remember that you can do that with a tracepoint (I could be
wrong). But if you just want your "log" to be written to the
console or captured as text to a file, this is easy.
(gdb) watch ival3
Hardware watchpoint 2: ival3
(gdb) commands 2
Type commands for when breakpoint 2 is hit, one per line.
End with a line saying just "end".
> continue
> end
(gdb) continue
Continuing.
Hardware watchpoint 2: ival3
Old value = -1
New value = 0
0x080484c4 in main ()
at
/data/home/msnyder/cvs/localhost/quilt/gdb/testsuite/gdb.base/watchpoint.c:137
137 ival3 = count; ival4 = count;
Hardware watchpoint 2: ival3
Old value = 0
New value = 1
0x080484c4 in main ()
at
/data/home/msnyder/cvs/localhost/quilt/gdb/testsuite/gdb.base/watchpoint.c:137
137 ival3 = count; ival4 = count;
Hardware watchpoint 2: ival3
Old value = 1
New value = 2
0x080484c4 in main ()
at
/data/home/msnyder/cvs/localhost/quilt/gdb/testsuite/gdb.base/watchpoint.c:137
137 ival3 = count; ival4 = count;
Hardware watchpoint 2: ival3
Old value = 2
New value = 3
0x080484c4 in main ()
at
/data/home/msnyder/cvs/localhost/quilt/gdb/testsuite/gdb.base/watchpoint.c:137
137 ival3 = count; ival4 = count;
Hardware watchpoint 2: ival3
Old value = 3
New value = 4
0x080484f4 in main ()
at
/data/home/msnyder/cvs/localhost/quilt/gdb/testsuite/gdb.base/watchpoint.c:141
141 ival3 = count; ival4 = count;
Program exited normally.
(gdb)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: create a watchpoint with trace functionality
2009-10-21 14:35 ` Michael Snyder
@ 2009-10-21 14:55 ` Nicholas Mc Guire
2009-10-25 12:57 ` Michael Snyder
0 siblings, 1 reply; 4+ messages in thread
From: Nicholas Mc Guire @ 2009-10-21 14:55 UTC (permalink / raw)
To: Michael Snyder, y; +Cc: martin mangard, gdb
On Wed, 21 Oct 2009, Michael Snyder wrote:
> martin mangard wrote:
>> Hello
>>
>> I'm trying to trace the value of a global status variable of an
>> application. This variable is changed from various code positions. I
>> would like to log/trace each change of this variable without stopping
>> the application (at least for a long time) in order to perform a
>> longterm test. I'm currently using a hardware-watchpoint
>>
>> Is there a possibility to configure a "autocontinue" after a
>> watchpoint-event? Which means that the changed value is printed and
>> the execution continues without any user interaction (pressing "c")?
>
> Yes, sure. See below.
>
>> Is ist possible to set a tracepoint on a change of a memory area?
>
> A tracepoint is different from a watchpoint, and no, I don't
> remember that you can do that with a tracepoint (I could be
> wrong).
you are right - no support for that in tracepoints - tracepoints are just
like breakpoints just that they execute the bytecode provided
rather than stoping the process and calling the gdb-frontend. But
I guess that due to the invasive nature of watchpoints (execution timing wise)
it would not make that much sense to have a that behavior in tracepoints as
the prime intention of tracepoints is to allow debugging without breaking
the temporal behoavior too badly (the impact is of course still significant).
hofrat
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: create a watchpoint with trace functionality
2009-10-21 14:55 ` Nicholas Mc Guire
@ 2009-10-25 12:57 ` Michael Snyder
0 siblings, 0 replies; 4+ messages in thread
From: Michael Snyder @ 2009-10-25 12:57 UTC (permalink / raw)
To: Nicholas Mc Guire; +Cc: y, martin mangard, gdb
Nicholas Mc Guire wrote:
> On Wed, 21 Oct 2009, Michael Snyder wrote:
>
>> martin mangard wrote:
>>> Hello
>>>
>>> I'm trying to trace the value of a global status variable of an
>>> application. This variable is changed from various code positions. I
>>> would like to log/trace each change of this variable without stopping
>>> the application (at least for a long time) in order to perform a
>>> longterm test. I'm currently using a hardware-watchpoint
>>>
>>> Is there a possibility to configure a "autocontinue" after a
>>> watchpoint-event? Which means that the changed value is printed and
>>> the execution continues without any user interaction (pressing "c")?
>> Yes, sure. See below.
>>
>>> Is ist possible to set a tracepoint on a change of a memory area?
>> A tracepoint is different from a watchpoint, and no, I don't
>> remember that you can do that with a tracepoint (I could be
>> wrong).
>
> you are right - no support for that in tracepoints - tracepoints are just
> like breakpoints just that they execute the bytecode provided
> rather than stoping the process and calling the gdb-frontend. But
> I guess that due to the invasive nature of watchpoints (execution timing wise)
> it would not make that much sense to have a that behavior in tracepoints as
> the prime intention of tracepoints is to allow debugging without breaking
> the temporal behoavior too badly (the impact is of course still significant).
Hardware watchpoints associated with tracepoints would make sense.
Software watchpoints wouldn't.
And of course, there are resource limits associated with hardware
watchpoints.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-10-25 2:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-21 13:37 create a watchpoint with trace functionality martin mangard
2009-10-21 14:35 ` Michael Snyder
2009-10-21 14:55 ` Nicholas Mc Guire
2009-10-25 12:57 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox