Questions tagged [watchpoint]

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.

98 questions
77
votes
1 answer

Watchpoint a fixed address

For my current embedded application I am trying to put GDB watch point at a fixed memory address. As an example, my application updates the following address: 0x10793ad0. In order to be sure which part of the code is corrupting the value, I tried…
maniac_inside
  • 908
  • 1
  • 7
  • 8
42
votes
4 answers

How do I set persistent and conditional watchpoints on locally scoped variables?

If I set a watchpoint for a variable local to the current scope, it will be auto deleted when going out of the scope. Is there any way to set it once and keep it auto alive whenever entering the same scope? Is there anyway to set conditional…
Tim
  • 1
  • 141
  • 372
  • 590
22
votes
5 answers

Is it possible to set a gdb watchpoint programmatically?

I want to set a watchpoint (break on hardware write) temporarily in my C++ program to find memory corruption. I've seen all the ways to do it manually through gdb, but I would like to actually set the watchpoint via some method in my code so I don't…
Neil
  • 11,059
  • 3
  • 31
  • 56
20
votes
4 answers

Tracking variable or memory change in Xcode?

Is there any way to track variable changes or memory changes in Xcode? I'm looking for functionality like Visual Studio's data breakpoint. I want to know where my object's view frame is being changed. I want to set a breakpoint at a member variable…
SeniorLee
  • 805
  • 1
  • 12
  • 25
20
votes
2 answers

Is it possible to set watchpoints on Swift properties?

In Objective-C, I would sometimes set watchpoints in LLDB to let me know when instance variables had changed. Can I do this with Swift properties too? Right now, the only way I can achieve this is: adding a didSet handler to the property and…
Bill
  • 44,502
  • 24
  • 122
  • 213
13
votes
4 answers

GDB hardware watchpoint very slow - why?

On a large C application, I have set a hardware watchpoint on a memory address as follows: (gdb) watch *0x12F5D58 Hardware watchpoint 3: *0x12F5D58 As you can see, it's a hardware watchpoint, not software, which would explain the slowness. Now the…
Laurynas Biveinis
  • 10,547
  • 4
  • 53
  • 66
11
votes
1 answer

How can I set a C/C++ memory watchpoint in vscode?

In gdb I can type watch &variable, then continue and gdb will break whenever something writes to that address. I am using vscode to debug and want to do the same thing (This is different from the watch window, which will only show variable values…
jozxyqk
  • 16,424
  • 12
  • 91
  • 180
10
votes
2 answers

Conditional breakpoint by caller in Java eclipse

I am trying to track a change of a value using watchpoint in a Java program in Eclipse debugger. The class hierarchy is pretty complex and the value I am tracking is wrapped in container, which is used on many places. To be more specific, there is a…
Radium
  • 564
  • 3
  • 17
9
votes
2 answers

In XCode 6 how can you set a watchpoint without stopping execution?

You can easily set a watchpoint in XCode by following these steps (btw if there is a simpler way, I'd like to know it...): - Run your program - Set a breakpoint in the code where your variable is used - when reaching breakpoint, use a right click on…
DrMad
  • 490
  • 3
  • 12
9
votes
1 answer

GDB: How to force a watchpoint to not be deleted after a function returned?

Watchpoints on function-local variables usually get removed upon the function return, with a message «Watchpoint 7 deleted because the program has left the block in». Illustration: struct mystruct{ int a, b, c; }; void MyFunc(){ mystruct…
Hi-Angel
  • 4,933
  • 8
  • 63
  • 86
8
votes
5 answers

Is there a free python debugger that has watchpoints?

pdb and winpdb both seem to be missing this essential (to me) feature. I saw something suggesting WingIDE has it but I'd prefer a solution that is free, and if I do have to pay, I'd prefer to pay for something that is better than Wing.
John
  • 14,944
  • 12
  • 57
  • 57
8
votes
2 answers

gdb watchpoint on struct variables

I have a structure like this : struct A { int a; char b; }; this structure is referenced at various places in a large code. The pointer to this struct is passed on to different functions and accordingly the variables…
KernelMonk
  • 311
  • 1
  • 5
  • 9
7
votes
3 answers

Hardware watchpoints - how do they work?

How do GDB watchpoints work? Can similar functionality be implemented to harness byte level access at defined locations?
Kapil
  • 836
  • 2
  • 8
  • 20
7
votes
1 answer

Debugging with gdbserver and qemu, how to set watchpoint on a control register, cr3

I'm debugging a kernel and i want to know when the cr3 register is changed. I know how to set a watchpoint on a general purpose register like eax and others. The problem is, since gdb does not have access to control registers, setting a watchpoint…
Mahouk
  • 902
  • 9
  • 28
7
votes
2 answers

iphone Xcode 3.1.4 3.1.2 SDK, watchpoints don't work?

If I try to set a watchpoint I get a gdb error: " can't clear hardware watchpoints without the 'Z2' (write-watchpoint) packet " Then it seems to corrupt the device (on restarting the device it complains that the OS is too old for the SDK, even…
user193521
1
2 3 4 5 6 7