Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

System(pause) in Unix?

I normally use a debugger such as cgdb so I thankfully hadn't needed to resort to system calls for debugging, until now.

I have a binary that takes around 30 minutes to load in gdb and frequently crashes the debugger thereafter, probably due to the very large number of symbols. This makes my normal workflow (loading gdb, adding breakpoints, identifying problem variables, etc.) untenable.

In windows I would at this point begin adding lots of cout and system("pause") (poor man's breakpoint) statements throughout my code; but how do I do this in a unix-like environment?
by

1 Answer

Bharatv4tg1
You may want to read from cin to get a poor man’s pause – it will wait for you to type an Enter, rather than resuming while you’re getting coffee (as sleep() will).

Login / Signup to Answer the Question.