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
2
votes
1 answer
How to set GDB read watchpoint in registers?
I'm trying to set a read watch point in registers.
By reading the user manual. I understood how to set watchpoint in registers
watch [-l|-location] expr [thread thread-id] [mask maskvalue]
Set a watchpoint for an expression. GDB will break when the…

Zzest
- 21
- 2
2
votes
1 answer
Difference software and hardware watchpoint
While reading this documentation,
I did not spot the difference between a software and a hardware watchpoint. I read that a software breakpoint (not watchpoint) replaces an instruction by an incorrect instruction to trigger an interrupt (and then…

J.Doe
- 53
- 5
2
votes
2 answers
gdb does not stop at given hardware watchpoint with x86 cpu
I have debugged QEMU with gdb.
To trace unexpected memory accesses I set a hardware watchpoint at a specific address. However, gdb does not stop while the value in the address is changed. This is the first time I have used hardware watchpoint…

nutsman
- 331
- 2
- 10
2
votes
0 answers
How to watch the memory modification on mips platform
I am debugging a memory corruption issue on MIPS. I want to know who write a certain value to an address.
In x86-64, we can use mprotect+sigsegv+sigtrap to log any memory write access to a specified address.
If I use mprotect, in sigsegv handler, I…

user14944
- 43
- 6
2
votes
0 answers
Application get stuck in GDB with gettimeofday() and watchpoints on registers
I'm just doing some experiments using GDB and playing around with the registers, but I encounter a problem when using the syscall gettimeofday() and a watchpoint on a register.
first let me expose a little example of what I am doing.
ok, here is the…

Trickshot
- 21
- 3
2
votes
2 answers
lldb watchpoint print value and automatically continue
Setting a watchpoint using (lldb) watchpoint set var myvar will pause the program whenever the variable is written to and print out the change of value to the debugging console.
From using this in the Xcode GUI, I know that it is possible to set…

Tim Bodeit
- 9,673
- 3
- 27
- 57
2
votes
2 answers
Eclipse Java Conditional Watchpoint
Eclipse supports conditional breakpoints which break at a particular line when the condition is true.
It also supports watchpoints which break immediately when a given variable is accessed/modified, regardless of the line that caused the…

arcyqwerty
- 10,325
- 4
- 47
- 84
2
votes
2 answers
GNU GDB: customize watchpoint output format
Every time a watchpoint is modified GDB will print the old value and the new value. However, sometimes I don't want to print the value in the default decimal integer format: for instance, if I'm watching *(unsigned*)$ebp to debug a possible stack…

4ae1e1
- 7,228
- 8
- 44
- 77
2
votes
0 answers
How to set a hardware watchpoint from *within* a process?
I want like to set a hardware watchpoint on a variable in a process, from within that same process. Is that possible? How do I do it?
Using Linux 2.6.32 kernel and a PowerPC A2 processor.

atomice
- 3,062
- 17
- 23
2
votes
0 answers
Freescale CodeWarrior : Register watchpoint on HCS08
I need to break the debugging when I-bit of SR (global interrupt mask) changes it's state.
Freescale CodeWarrior 6.1
MCU: HCS08

THX-1138
- 21,316
- 26
- 96
- 160
1
vote
0 answers
Conditional watchpoints on array in GDB
We're in the process of debugging a cloth simulator written in C++ and a common problem is when something modifies velocities to be NaN or some large number.
Currently, this the best way we have to test for this is calling test_velocities_for_NaN()…

cmspice
- 318
- 1
- 6
1
vote
1 answer
Why watchpoint doesn't effect?
I am studying the watchpoint of GDB. I write a simple test code as following:
int main(int argc, char **argv)
{
int x = 30;
int y = 10;
x = y;
return 0;
}
I build it via gcc -g -o wt watch.c. And then I started gdb and did…

mingganz
- 363
- 1
- 7
1
vote
0 answers
gdb not break while set watch
I debug a process with GDB and set watch to break when value in address changed, but it doesn't work!
Here is the initial value:
(gdb) x/s 0x60c010
0x60c010: "aaaaa"
Set a watch break point
(gdb) watch *0x60c010
Hardware watchpoint 2:…

python3.789
- 164
- 9
1
vote
1 answer
Watchpoint doesn't work when reverse executing
Here's a debugging scenario:
Create start breakpoint A and finish breakpoint B.
Start recording. Continue.
Reach breakpoint B.
Set watchpoint to watch writes to some piece of memory.
Reverse continue until watchpoint breaks execution.
Let's…

mathway
- 143
- 11
1
vote
0 answers
gdb and getting the absolute address of a struct field for watching?
I want to do the same as in How to watch a member of a struct for every struct variable that has that type? - but I am on embedded, and have a problem. Say, I want to watch ((TCB_t*)pxReadyTasksLists[1].pxIndex.pxNext.pvOwner).xTaskRunState,…

sdbbs
- 4,270
- 5
- 32
- 87