This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Displaying values in a loop


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....


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]