watchpoint

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

冷暖自知 提交于 2019-12-05 15:04:19
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 obj; obj.a = 2; } int main(){ MyFunc(); } gdb session example (gdb) b 7 Breakpoint 1 at 0x4004f1: file /tmp/test2.cpp, line 7. (gdb) r Starting program: /tmp/test2 Breakpoint 1, MyFunc () at /tmp/test2.cpp:7 7 obj.a = 2; (gdb) wa obj Hardware watchpoint 2: obj (gdb) c Continuing. Hardware watchpoint 2: obj Old value = {a = 4195600, b = 0, c = 4195328} New

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

泪湿孤枕 提交于 2019-12-04 05:11:38
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 though it's OS 3.1.2). I've got a bug to track down that really would be easy to track down with a watchpoint so this really is a pain. Anybody know if watchpoints are supposed to work? How to get them to work? Unfortunately this is a known bug in OS 3.1.2. There's rumour of a new 3.1.3 build around the corner, but I don't know if that will fix this

Conditional breakpoint by caller in Java eclipse

試著忘記壹切 提交于 2019-12-03 12:59:45
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 container SizeRequirement , which has a property minimum , which I am tracking. This class is used by many layout managers on many places for many components to define requirement for component's sizes. I need to catch exact call, where the value changes/is set for one specific layout manager and one specific component in it. Is it possible to

Watchpoint a fixed address

╄→尐↘猪︶ㄣ 提交于 2019-12-03 04:02:30
问题 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 watch 0x10793ad0 Even though GDB does not print any error after this, it is not able to break during execution even though I verified the value is getting modified at between start and end of execution. Questions: Can I really put watch at a fixed

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

对着背影说爱祢 提交于 2019-11-30 13:57:31
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 the variable and select 'Watch "nameOfTheVariable"' - Continue execution. The only problem is that execution will stop every time the variable value changes. I would like XCode to continue the execution without stopping, i.e. merely display the value changes in the console output. This feature seems available in command line mode, and although I

Tracking variable or memory change in Xcode?

醉酒当歌 提交于 2019-11-28 06:55:20
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 and run it. Then I could determine where it's changed. Sedate Alien Xcode uses gdb (or lldb , but that's another story) to implement its debugging functionality. gdb has the ability to set hardware watchpoints and hence so does Xcode. This is a useful page for generic debugging of memory errors. Xcode's debugging console window is really just a gdb

Is it possible to set a gdb watchpoint programmatically?

跟風遠走 提交于 2019-11-27 19:30:16
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 have to break into gdb, find out the address, set the watchpoint and then continue. Something like: #define SET_WATCHPOINT(addr) asm ("set break on hardware write %addr") Set hardware watchpoint from child process. #include <signal.h> #include <syscall.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <sys

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

自闭症网瘾萝莉.ら 提交于 2019-11-27 11:58:06
问题 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 watchpoint, like watch var1 if var1==0 ? In my case, the condition does't work. gdb stops whenever var1 's value is changed, instead of untill var1 == 0 is true. My gdb is GNU gdb 6.8-debian. 回答1: I agree with Dave that a conditional breakpoint is the way

Tracking variable or memory change in Xcode?

ⅰ亾dé卋堺 提交于 2019-11-27 01:36:18
问题 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 and run it. Then I could determine where it's changed. 回答1: Xcode uses gdb (or lldb , but that's another story) to implement its debugging functionality. gdb has the ability to set hardware watchpoints and hence so does Xcode. This is a useful page