<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Thank you for your help.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">What is the reason for using SBLaunchInfo over calling tgt.Launch with the launch configuration as a set of parameters? Furthermore I do not see a way to set stdout, stdin, and stderr for the launched process by using SBLaunchInfo.<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">I have a question regarding the event loop.</div><div class="gmail_default" style="font-family:monospace,monospace">Is lldb thread-safe enough such that I can run that loop in another std::thread while simultaneously using other debugger functions?</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Kind regards,</div><div class="gmail_default" style="font-family:monospace,monospace">Jayvee<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Fr., 12. Juli 2019 um 19:56 Uhr schrieb Greg Clayton <<a href="mailto:clayborg@gmail.com">clayborg@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">You need to call SBDebugger::Initialize() before calling SBDebugger::Create().<div><br></div><div>Also, please use the <span style="background-color:rgb(255,255,255)">SBLaunchInfo</span> method for launching if possible where you create a <span style="background-color:rgb(255,255,255)">SBLaunchInfo, then call tgt.Launch() with the instance.</span></div><div><span style="background-color:rgb(255,255,255)"><br></span></div><div><span style="background-color:rgb(255,255,255)">Other than that, as Jim said, you need to setup an event loop if you don't use synchronous mode where you wait for events and respond to events. </span></div><div><span style="background-color:rgb(255,255,255)"><br></span></div><div><span style="background-color:rgb(255,255,255)">Greg<br></span><div><br><blockquote type="cite"><div>On Jun 26, 2019, at 4:58 AM, Jayvee Neumann via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:</div><br class="gmail-m_5136867598933145329Apple-interchange-newline"><div><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Dear LLDB developers,</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">I am currently stuck while using the C++ API of LLDB. I am unable to correctly launch a process.</div><div class="gmail_default" style="font-family:monospace,monospace">The code I have written looks as follows:</div><div class="gmail_default" style="font-family:monospace,monospace"><br>int main(int argc, char *argv[]){<br><div style="margin-left:40px"> LLDBSentry senty;<br> SBDebugger dbg(SBDebugger::Create());<br> ...<br> const char *exeFilePath = "./target";<br> const char *arch = "x86_64";<br> const char *platform = "";<br> const char *dependentLibs = ""; <br> SBError error;<br> SBTarget tgt = dbg.CreateTarget(exeFilePath, arch, platform, dependentLibs, error);<br> ...<br> SBListener listen;<br> SBProcess proc = tgt.Launch(<br></div><div style="margin-left:80px"> listen,<br> nullptr,<br> nullptr,<br> nullptr,<br> "targetout.txt",<br> nullptr,<br> "./",<br> eLaunchFlagExec | eLaunchFlagDebug,<br> false,<br> error<br></div><div class="gmail_default" style="font-family:monospace,monospace;margin-left:40px"> );<br>...<br> SBThread thread = proc.GetSelectedThread(); // (1)<br></div></div><div class="gmail_default" style="font-family:monospace,monospace;margin-left:40px">...</div><div class="gmail_default" style="font-family:monospace,monospace">}</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">The complete code (usr.cpp) is added as an attachment to this email.</div><div class="gmail_default" style="font-family:monospace,monospace">Its output is also added as a text file (stdout.txt) to this email.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">The problem I have is, that thread.IsValid() returns null after line (1). Furthermore, the process says, that its state is eStateStopped, when asked via proc.IsStopped() it answers "false", however.<br></div><div class="gmail_default" style="font-family:monospace,monospace">The debugging target is a simple file that writes a hexadecimal number every 10us to stdout. I can see that the target is running, because targetout.txt is growing in size and its content is valid output from "target".</div><div class="gmail_default" style="font-family:monospace,monospace">Can you tell me what my mistake is?</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Kind Regards</div><div class="gmail_default" style="font-family:monospace,monospace">Jayvee<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div></div>
<span id="gmail-m_5136867598933145329cid:f_jxd4t7do1"><usr.cpp></span><span id="gmail-m_5136867598933145329cid:f_jxd4t7df0"><stdout.txt></span>_______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br></div></blockquote></div><br></div></div></blockquote></div>