RE: Displaying values in a loop

Dave Korn
2007-04-16T09:28:27Z

On 16 April 2007 09:37, MVD wrote:

> Hi All,
>
> I have a situation like below:
>
> intj=0, k=2;
>
> for(int i=0; i< 3 ; i++)
> {
> j=j+k;
> }
>
> Now, suppose I ran GDB and inside for loop I have to use print j and print k
> to see the current values.
> Does any body have any idea if there is a way to see the values of j and k
> ,in the for loop each time values are changes with out using "print" ?

See the gdb info page, section 8.6 "Automatic display". Sounds like you
want the 'display' command.

cheers,
DaveK
--
Can't think of a witty .sigline today....