Hello,
Need pointer on how to create a for loop within gdb that will print something each repetition to a file so that I can view results. How would I go about doing this?

How about using a shell script to start GDB in a loop? Redirect the output to a file.

for ((  i = 0 ;  i <= 10;  i++  ))
do
   gdb yourfile > outputfile
done

thanks for the reply!

I see how that would work but I would rather not step through each iteration and use the print statement (number of iterations is > 1500) on each iteration in gdb. I was just wondering if there was a way within gdb had some way of doing it. I guess I'll just output to file within my code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.