[Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

Vadim Macagon via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 21 19:35:23 PDT 2015

enlight added inline comments.

Comment at: tools/lldb-mi/MICmdCmdExec.cpp:92
@@ +91,3 @@
+        const char *pCmd = bProcessMustStopAtEntry ? "process launch -s" : "process launch";
+        const lldb::ReturnStatus rtn = rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(pCmd, m_lldbResult);
+        MIunused(rtn);
KLapshin wrote:
> KLapshin wrote:
> > enlight wrote:
> > > The process should be launched through the SB API, not the command interpreter. I'm not very familiar with the SB API but I'd try using the **lldb::eLaunchFlagStopAtEntry** flag with **SBLaunchInfo::SetLaunchFlags()**.
> > You are right, no doubt - this is clear what Target and Process API direct usage is faster and straightforward manner.
> > 
> > Just couple words regarding why interpreter used instead here - patch was prepared at moment when lldb-MI had lack synchronization (via Listener) with lldb Core, so setting corresponding flag gave random results - app may stop or not. Via interpreter it worked fine always - that's why I stated "more reliable" in review header.
> > 
> > I will check if flag pass is enough currently - this will make patch shorter and clearer.
> Also - in many other places lldb-MI still use interpreter for cmds.
Yes, it's unfortunate that the interpreter is used to implement some commands, this will be cleaned up in due time I hope. I just don't want new code using the interpreter unless absolutely necessary, it should be possible to (eventually) do everything through the SB API. If the SB API doesn't work as expected please file a bug,



More information about the lldb-commits mailing list