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
0
votes
0 answers
How to trap a stack smashing from another thread?
How can I trap a stack smashing from another thread? Is it possible to set up
and clear a watchpoint on the fly to watch the stack canary?
Here is the code we are working with:
void SomeClass::func() {
fA();
fB();
}
void…

Henry Hsuan-Ju Chen
- 13
- 4
0
votes
1 answer
How are GDB Hardware Watchpoints working?
I am interested in how a hardware watchpoint is realized. If I watch for a uint8_t variable by watch varName (watch -> write watch) so in case any data is changed on any bit within the range of the memory location it will be detected?
And how is the…

Toroid
- 117
- 1
- 7
0
votes
0 answers
Data Watchpoints (DWT) on cortex-m4 to detect memory corruption
I am trying to detect memory corruption on a Cortex M4 (STM32F4) using the Data watchpoint and trace (DWT) feature of cortex-m4 boards. I am able to set the watchpoints on a variable but when I access the variable in the code the DebugMon_Handler is…

K. Sai Bharadwaj
- 49
- 6
0
votes
0 answers
Is that possible to set interrupt that breaks when cpu write to many specific addresses?
I asked one of the similar question here.
However, the hardware debug interrupt seems pretty limited.
The ideal mechanism I would like to get is the ability to monitoring multiple variables, and once any of them changes the corresponding handler…

Shore
- 827
- 9
- 24
0
votes
1 answer
Cannot set watchpoint in GDB
I am doing debugging and wanted to check the place where the value of the variable changes .For this I tried setting a watch point by saying something like watch 'structure->somefunc.getvalue()' which is not a simple variable (probably some portion…

Manish
- 1,729
- 5
- 32
- 47
0
votes
1 answer
gdb prints long values watching a variable set with rand()
I'm using a gdb script to watch the changes of a variable using awatch:
#!/bin/bash
# Compile
gcc -Wall -pedantic -g -o demo demo.c
# Exit on compile error
if [ $? -ne 0 ]; then
exit
fi
# Overwrite the contents of trace.gdb with a title
echo…

David Ranieri
- 39,972
- 7
- 52
- 94
0
votes
1 answer
Watchpoint in cortex M4
I have a global constant array const uint32_t p[5] = {1, 2, 3, 4, 5};. I have made it read-protected by
DWT->COMP1 = (uint32_t)&p;
DWT->MASK1 = 6;
DWT->FUNCTION1 = (1 << 11)| (1 << 0) | (1 << 2);
When I access the array…

Jabeen
- 33
- 5
0
votes
3 answers
Watchpoint on STM32 GPIO register
using Keil µVision on a STM32F4 I am trying to add a watchpoint to a GPIO data register, which just does not trigger.
I want the watchpoint to be triggered as soon as output data gets writting into this register.
Setting the watchpoint to the os…

goeck
- 53
- 5
0
votes
0 answers
Setting a watchpoint on an element of an Array - Swift
Question was answered in the comments below
I have an array of objects and a property of the objects keep changing. I want to set a watchpoint on that specific property in a few elements of the array. Is that possible?
I have seen this answer on how…

user1807157
- 101
- 2
- 9
0
votes
1 answer
gdb watchpoint except when triggered in specific locations?
I have a variable getting corrupted. I want to see where this is happening, so a watchpoint is the obvious choice, except this variable frequently gets set (in this case, processing network packets and it gets set once for each packet). I would…

abatie
- 169
- 3
- 10
0
votes
1 answer
Set Read-Write watchpoint with GDB?
I'm trying to trackdown the source of incorrect runtime cpu feature reporting. I'm fairly certain its due to C++ "As-If-Broken" rule, where the language allows the compiler to take a correct program and turn it into an incorrect program.
According…

jww
- 97,681
- 90
- 411
- 885
0
votes
1 answer
Why does a GDB watchpoint stop on an irrelevant line when swapping binary tree nodes?
I am trying to swap two nodes A and B in a binary tree so that the places they are actually stored in memory change but the tree topology is not changed. I added special handling for swapping a node with its parent, but it still seems that it…

hacatu
- 638
- 6
- 15
0
votes
1 answer
LLDB – Set watchpoint on instance variable of arbitrary object
For some weird reason, seguieing back to a view controller changes the userInteractionEnabled of my view's subview _settingsButton which is of UIButton type. I want to know why this happens. After setting a breakpoint in the view controller's code,…

oarfish
- 4,116
- 4
- 37
- 66
0
votes
1 answer
How set breakpoint to class member variable in gdb
How can I set breakpoint (or watchpoint) to member variable in class for all instances of this class?
I have tried set breakpoint on line in class with this member variable but this is not working.

Marcin
- 422
- 6
- 17
0
votes
4 answers
Gdb on multiple instance
I have multiple instances of a particular process running on my system . At some point during the process execution, some of the internal data structures gets overwritten with invalid data. This happens on random instances at random intervals. Is…

Gviz
- 1