Watchpoint is a point at which program executed via a debugger stops to let the programmer peek into memory and call stack or enter step by step execution mode.
Questions tagged [watchpoint]
98 questions
4
votes
1 answer
GDB watching class member in vector of instances
Here is an extremely simplified version of my class:
Class MyClass {
public:
int sizeDesired;
};
I'm creating a vector of MyClass instances in main:
int main(int argc, char **argv) {
std::vector myvec;
for(int i=0; i<10;…

synaptik
- 8,971
- 16
- 71
- 98
4
votes
1 answer
Are hardware watchpoints available only for certain memory addresses?
I have gdb 7.3 and device that supports hardware watchpoints.
I type such consequent commands:
Breakpoint 1, 0x000db808 in ?? ()
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x000db808
…

Lucky Man
- 1,488
- 3
- 19
- 41
3
votes
1 answer
Prevent gdb from stopping at watchpoints
file main.c:
#include
int main()
{
int i;
for (i=0; i<30 ;i++) {
printf ("%d\n", i);
}
return 0;
}
In gdb, I usually set a breakpoint, then specify a watchpoint as command to be executed on that…
user854270
3
votes
1 answer
Is that possible to set interrupt that breaks when cpu write to an specific address?
Is it possible to make x86 cpu interrupt when specific address is being written?
I want a hardware mechanism to monitor some address's changing.

Shore
- 827
- 9
- 24
3
votes
0 answers
How to use hardware breakpoints in LLDB?
I'm playing with the lldb Python API to set a watchpoint and printing it:
Watchpoint 1: addr = 0x700005451ff0 size = 8 state = enabled type = w
declare @ '/Users/stringer/test.c:945'
new value: 0x000000011a4b1000
hw_index = -1 hit_count…

elmattic
- 12,046
- 5
- 43
- 79
3
votes
0 answers
How to add a software watchpoint following a breakpoint on gdb
I am trying to debug a C program which allocates and frees various instances of a particular structure during its lifetime. At some point, one of these instances is getting corrupted.
To debug it, I would like to set watchpoints shortly after these…

FelipeFR
- 61
- 7
3
votes
2 answers
How to keep watchpoint on variables for Javascript development?
I am working on a WebGL project with Javascript and I'm finding it really difficult to trace an error in my code.
In order to debug the program, I'm in need of a watchpoint checker, so that I can check when does the faulty variable data getting…

kishoredbn
- 2,007
- 4
- 28
- 47
3
votes
1 answer
How to set a gdb watchpoint to a value stored in register?
I'm trying to detect stack overflow in some function, and want to set a watchpoint to a memory pointed by the RSP register. I can't just set a watchpoint to a certain address as the function could be called from a different places. So I want to set…

Hi-Angel
- 4,933
- 8
- 63
- 86
3
votes
2 answers
How to set up gdb watchpoints in a program consisting of many files in C++?
I am trying to set up a watchpoint to monitor a variable in a package consisting of many C++ files.
There are many files
abc.cpp
qwe.cpp
..
xyz.cpp and so on
I want to monitor a variable 'temp' in some function qwerty() in the file abc.cpp
How do I…

Sachin Shetye
- 31
- 2
3
votes
1 answer
What is the lldb equivalent of gdb's rwatch?
I'm in a situation where read watchpoints would be very handy. Looking at lldb's help, I could find the watchpoint command, but it only seems to support write watchpoints (which are admittedly a lot more useful in general, but won't do it in my…

zneak
- 134,922
- 42
- 253
- 328
3
votes
2 answers
GDB: programmatically delete a watchpoint
Is it possible to delete a watchpoint without knowing the watchpoint number?
I am using commands attached to a breakpoint to set a watchpoint on a memory location. I would like to have the watchpoint cleared at another breakpoint, but I can't figure…

leecbaker
- 3,611
- 2
- 35
- 51
2
votes
1 answer
How to monitor resources needed to set watchpoints in gdb?
On x86 GDB uses some special hardware resources (debug registers?) to set watchpoints. In some situations, when there is not enough of that resources, GDB will set the watchpoint, but it won't work.
Is there any way to programmatically monitor the…

user174916
- 97
- 8
2
votes
1 answer
gdb, break vs tbreak and watchpoint
Can anyone tell me what's the difference between break and tbreak regarding watchpoints ?
A have a simple test code :
#include
#include
int main(int argc, char **argv) {
int toto;
toto = 1;
toto = 2;
toto = 3;
return…

Lefinnois
- 21
- 2
2
votes
1 answer
How to implement/set a data breakpoint?
Requirements:
I need to generate an interrupt, when a memory location changes or is written to. From an ISR, I can trigger a blue screen which gives me a nice stack trace with method names.
Approaches:
Testing the value in the timer ISR. Obviously…

kiw
- 748
- 1
- 9
- 18
2
votes
1 answer
How to know what operator at which line changes the value of the variable in TCL
Sometimes you can't understand when the variable value gets changed. And it is necessary to find the line by puting a watchpoint on the variable. How this can be done? Can TCL trace command be usefull in order to get the line where the variable was…

Narek
- 38,779
- 79
- 233
- 389