cerebrou
cerebrou

Reputation: 5550

Rerunning debugging Python with gdb

I am debugging a C++ program with gdb. After running gdb python, I set the breakpoints and run the program. However, after I quit the program, I leave the gdb debugger altogether.

If I make a change in my code and would like rerun the program, I have to do the whole process again. Run 'gdb python`, type the breakpoints (because the commands are not in the history), etc.

Is there a more efficient way to deal with this debugging problem?

Upvotes: 0

Views: 220

Answers (2)

cerebrou
cerebrou

Reputation: 5550

I realized Ctrl +C does the job @EmployedRussian is talking about.

Upvotes: 0

Employed Russian
Employed Russian

Reputation: 213789

I leave the gdb debugger altogether

Why? Don't do that.

Instead, leave GDB running, rebuild your program (in another terminal), then use GDB run command again to re-run the rebuilt program.

Upvotes: 1

Related Questions