top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How watch point works internally in GDB ?

+1 vote
431 views

I eager to know how watch point works in detail ?

posted Oct 3, 2013 by Vikram Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Watch point is very useful when programmer is not able to locate which piece of code is doing wrong.
There are two types of watch point 1. Software watch point and 2. Hardware watch point.
when you are not sure that in which flow or in which iteration data is being corrupted then only two option left either do manually or use watch point.
when you put a watch point on a variable it consider that variable till only its scope. if you have put watch point for a variable which has auto scope. Watch point leave the variable when it goes out of scope. when a program get executed completely then all variables of a program want out of scope that's why you have to apply watch point if you are going to rerun.

answer Oct 4, 2013 by Neeraj Mishra
Similar Questions
+4 votes

in case if is it possible, how you can change and pls explain with some example.

+4 votes

Assume we have three threads and in this case how can we change the priority of threads. If it is possible then please explain with example.

+1 vote

I am working on some JIT compiler and I am using GDB to debut it, my code crashes at some point (segment fault), but it crashes at the jitted code (they are generated on the fly) so I do not get the stack frame information, But I got the following backtrace:

#0 0x**********d98f22 in ?? () // JITTED CODE
#1 0x000000000000001d in ?? () // JITTED CODE
#2 ...callattribuite function....

I am wondering if it is possible for GDB to disassemble the code at location 0x**********d98f22 and display it to me. I tried disas 0x**********d98f22 but GDB complained No function contains specified address.

Any clue?

+1 vote

As far as I know, CORE file contains all the information till Segmentation fault. Then, while debugging core file why we are using executable file(binary) with it.?

...