<div dir="ltr"><div style>Thanks for the reply.</div><div><br></div><div>I enabled <span style="font-size:13px;font-family:arial,sans-serif">the packet logging in LLDB.</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><div><font face="arial, sans-serif">(lldb) log enable gdb-remote packets</font></div><div><font face="arial, sans-serif">(lldb) process connect --plugin gdb-remote connect://localhost:51000</font></div><div>
<font face="arial, sans-serif"><   1> send packet: +</font></div><div><font face="arial, sans-serif">history[1] tid=0xb1d819d0 <   1> send packet: +</font></div><div><font face="arial, sans-serif"><  26> send packet: $QThreadSuffixSupported#e4</font></div>
<div><font face="arial, sans-serif"><   1> read packet: +</font></div><div><font face="arial, sans-serif"><   4> read packet: $#00</font></div><div><font face="arial, sans-serif"><   1> send packet: +</font></div>
<div><font face="arial, sans-serif"><  27> send packet: $QListThreadsInStopReply#21</font></div><div><font face="arial, sans-serif"><   1> read packet: +</font></div><div><font face="arial, sans-serif"><   7> read packet: $E01#a6</font></div>
<div><font face="arial, sans-serif"><   1> send packet: +</font></div><div><font face="arial, sans-serif"><  10> send packet: $vCont?#49</font></div><div><font face="arial, sans-serif"><   1> read packet: +</font></div>
<div><font face="arial, sans-serif"><  15> read packet: $vCont[;c;s]#0e</font></div><div><font face="arial, sans-serif"><   1> send packet: +</font></div><div><font face="arial, sans-serif"><  27> send packet: $qVAttachOrWaitSupported#38</font></div>
<div><font face="arial, sans-serif"><   1> read packet: +</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><   6> send packet: $qC#b4</font></div><div><font face="arial, sans-serif"><   1> read packet: +</font></div>
<div><font face="arial, sans-serif"><   7> read packet: $QC0#c4</font></div><div><font face="arial, sans-serif"><   1> send packet: +</font></div><div><font face="arial, sans-serif">(lldb) run</font></div></div>
<div><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif">After this lldb just hangs. lldb doesn't send any packet after the 'run' command. I debugged by inserting a breakpoint in lldb's code which sends the 'A' packet. And that breakpoint was not hit.</font></div>
<div style><font face="arial, sans-serif"><br></font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 21, 2013 at 10:31 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The "process launch" command should send the 'A' packet, and it is waiting for a stop reply response from the 'A' packet. Try enabling the packet logging in LLDB:<br>

<br>
(lldb) log enable gdb-remote packets<br>
(lldb) process connect ...<br>
(lldb) run<br>
<br>
My guess is that the 'A' packet isn't responding with a stop reply packet.<br>
<div><div class="h5"><br>
On Aug 21, 2013, at 7:47 AM, chansarav <<a href="mailto:chansarav@gmail.com">chansarav@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> I am connecting lldb with my simulator through 'gdb-remote' process plugin. After extablishing the connection, I want to issue the 'process launch' command in lldb which should send the arguments packet 'A' to simulator asking it to launch the program.<br>

><br>
> I am facing the problem while issuing the 'process launch' command in lldb. When I give the 'process launch' command, lldb hangs and there is no communication with simulator. When I debugged with gdb, I got the backtrace as follows:<br>

><br>
> #2  0xb6703a6f in lldb_private::Condition::Wait (this=0x8077dac, mutex=..., abstime=0x0, timed_out=0xbfffaa9f) at /home/chandra/llvm-3.1/tools/lldb/source/Host/common/Condition.cpp:92<br>
> #3  0xb662768d in lldb_private::Predicate<bool>::WaitForValueEqualTo (this=0x8077d90, value=true, abstime=0x0, timed_out=0xbfffaa9f) at /home/chandra/llvm-3.1/tools/lldb/source/Core/../../include/lldb/Host/Predicate.h:317<br>

> #4  0xb662b03f in lldb_private::Listener::WaitForEventsInternal (this=0x8077d3c, timeout=0x0, broadcaster=0xadb0179c, broadcaster_names=0x0, num_broadcaster_names=0, event_type_mask=3, event_sp=...) at /home/chandra/llvm-3.1/tools/lldb/source/Core/Listener.cpp:409<br>

> #5  0xb662b1f7 in lldb_private::Listener::WaitForEventForBroadcasterWithType (this=0x8077d3c, timeout=0x0, broadcaster=0xadb0179c, event_type_mask=3, event_sp=...) at /home/chandra/llvm-3.1/tools/lldb/source/Core/Listener.cpp:440<br>

> #6  0xb69421ec in lldb_private::Process::WaitForStateChangedEvents (this=0xadb01788, timeout=0x0, event_sp=...) at /home/chandra/llvm-3.1/tools/lldb/source/Target/Process.cpp:1069<br>
> #7  0xb6941f2c in lldb_private::Process::WaitForProcessToStop (this=0xadb01788, timeout=0x0) at /home/chandra/llvm-3.1/tools/lldb/source/Target/Process.cpp:977<br>
> #8  0xb6587d98 in CommandObjectProcessLaunch::DoExecute (this=0x80813d0, launch_args=..., result=...) at /home/chandra/llvm-3.1/tools/lldb/source/Commands/CommandObjectProcess.cpp:220<br>
> #9  0xb672c999 in lldb_private::CommandObjectParsed::Execute (this=0x80813d0, args_string=0xb4d667bc "", result=...) at /home/chandra/llvm-3.1/tools/lldb/source/Interpreter/CommandObject.cpp:856<br>
> #10 0xb67215d3 in lldb_private::CommandInterpreter::HandleCommand (this=0x8077fc8, command_line=0x883a614 "process launch", lazy_add_to_history=lldb_private::eLazyBoolYes, result=...,<br>
>     override_context=0x0, repeat_on_empty_command=true, no_context_switching=false) at /home/chandra/llvm-3.1/tools/lldb/source/Interpreter/CommandInterpreter.cpp:1571<br>
> #11 0xb64e0ced in lldb::SBCommandInterpreter::HandleCommand (this=0xbfffc2cc, command_line=0x883a614 "process launch", result=..., add_to_history=true) at /home/chandra/llvm-3.1/tools/lldb/source/API/SBCommandInterpreter.cpp:97<br>

> #12 0x0805a103 in Driver::HandleIOEvent (this=0xbfffec7c, event=...) at /home/chandra/llvm-3.1/tools/lldb/tools/driver/Driver.cpp:996<br>
> #13 0x0805b516 in Driver::MainLoop (this=0xbfffec7c) at /home/chandra/llvm-3.1/tools/lldb/tools/driver/Driver.cpp:1430<br>
> #14 0x0805bbf2 in main (argc=4, argv=0xbfffede4, envp=0xbfffedf8) at /home/chandra/llvm-3.1/tools/lldb/tools/driver/Driver.cpp:1562<br>
><br>
> Though I am analyzing on this, Can someone help me in finding out what goes wrong while trying to launch a program in simulator through 'gdb-remote' process plugin?<br>
><br>
><br>
> Following is the communication between lldb and simulator for the "process connect --plugin gdb-remote connect://localhost:51000" command.<br>
><br>
> Send Packet: QStartNoAckMode: 15 chars<br>
> Read Packet:<br>
> Send Packet: QThreadSuffixSupported: 22 chars<br>
> Read Packet:<br>
> Send Packet: QListThreadsInStopReply: 23 chars<br>
> Read Packet: E01<br>
> Send Packet: qHostInfo: 9 chars<br>
> Read Packet: cputype:201;cpusubtype:-2;ostype:unknown;vendor:unknown;endian:little;ptrsize:4;<br>
> Send Packet: vCont?: 6 chars<br>
> Read Packet: vCont[;c;s]<br>
> Send Packet: qVAttachOrWaitSupported: 23 chars<br>
> Read Packet:<br>
> Send Packet: qC: 2 chars<br>
> Read Packet: QC0<br>
><br>
> LLDB sets the status as connected after this communication.<br>
> (snip start)<br>
>     if (pid == LLDB_INVALID_PROCESS_ID)<br>
>     {<br>
>         // We don't have a valid process ID, so note that we are connected<br>
>         // and could now request to launch or attach, or get remote process<br>
>         // listings...<br>
>         SetPrivateState (eStateConnected);<br>
>     }<br>
> (snip end)<br>
> function: ProcessGDBRemote::DoConnectRemote ()<br>
><br>
> Thanks,<br>
> Chandra Kumar R.<br>
</div></div>> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br>
</blockquote></div><br></div>