If I set up a break point and if GDB hits the break points, then it shows the line of the code. If I enter n or next, then GDB prints out the next line of the code.
I was wondering if there is a way I can trace the actual line of code being executed through GDB.
For example, if I enter n or next 100 times then I will get traces of 100 lines of code. I want to do this automatically not by entering n or next.
Note that collecting
nexttrace like you appear to desire is exceedingly unlikely to help you debug actual problem in any realistically sized program: most of the time programs spend in loops, and executingnextrepeatedly will just give you a never-ending stream of loop repetitions.That said, you can achieve what you want like this: