When I use SBDebugger::SetAsync(true), the process is not stopped at scanf, so it does not wait for input. The process does stop and wait for input when SetAsync(false). Unfortunately, when building a GUI on top of the C++ API, I have to SetAsync(true).
Is there some way to resolve this?
I think you will have to provide a bit more context to get help. I.e.,
what is the full sequence of debugger commands you are issuing, and
what is the inferior process doing?
You have to consume the events from the debugger's listener (unless you specify a different listener in your SBLaunchInfo or SBAttachInfo).
We have python code that can show you how to consume events:
svn cat http://llvm.org/svn/llvm-project/lldb/trunk/examples/python/process_events.py
So even though your process might be stopped, until you consume the stop event, the process will claim it is running or launching.
The process broadcasts process event state changes (changing from running to stopped, or stopped to running).
If you have more detailed questions, please let me know.