<div dir="ltr"><div>Hi,</div><div><br></div><div>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.</div>
<div><br></div><div>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:</div>
<div><br></div><div>#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</div><div>#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</div>
<div>#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</div>
<div>#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</div>
<div>#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</div><div>#7  0xb6941f2c in lldb_private::Process::WaitForProcessToStop (this=0xadb01788, timeout=0x0) at /home/chandra/llvm-3.1/tools/lldb/source/Target/Process.cpp:977</div>
<div>#8  0xb6587d98 in CommandObjectProcessLaunch::DoExecute (this=0x80813d0, launch_args=..., result=...) at /home/chandra/llvm-3.1/tools/lldb/source/Commands/CommandObjectProcess.cpp:220</div><div>#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</div>
<div>#10 0xb67215d3 in lldb_private::CommandInterpreter::HandleCommand (this=0x8077fc8, command_line=0x883a614 "process launch", lazy_add_to_history=lldb_private::eLazyBoolYes, result=..., </div><div>    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</div>
<div>#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</div>
<div>#12 0x0805a103 in Driver::HandleIOEvent (this=0xbfffec7c, event=...) at /home/chandra/llvm-3.1/tools/lldb/tools/driver/Driver.cpp:996</div><div>#13 0x0805b516 in Driver::MainLoop (this=0xbfffec7c) at /home/chandra/llvm-3.1/tools/lldb/tools/driver/Driver.cpp:1430</div>
<div>#14 0x0805bbf2 in main (argc=4, argv=0xbfffede4, envp=0xbfffedf8) at /home/chandra/llvm-3.1/tools/lldb/tools/driver/Driver.cpp:1562</div><div><br></div><div>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?</div>
<div><br></div><div><br></div><div>Following is the communication between lldb and simulator for the "process connect --plugin gdb-remote connect://localhost:51000" command.</div><div><br></div><div>Send Packet: QStartNoAckMode: 15 chars</div>
<div>Read Packet:</div><div>Send Packet: QThreadSuffixSupported: 22 chars</div><div>Read Packet:</div><div>Send Packet: QListThreadsInStopReply: 23 chars</div><div>Read Packet: E01</div><div>Send Packet: qHostInfo: 9 chars</div>
<div>Read Packet: cputype:201;cpusubtype:-2;ostype:unknown;vendor:unknown;endian:little;ptrsize:4;</div><div>Send Packet: vCont?: 6 chars</div><div>Read Packet: vCont[;c;s]</div><div>Send Packet: qVAttachOrWaitSupported: 23 chars</div>
<div>Read Packet: </div><div>Send Packet: qC: 2 chars</div><div>Read Packet: QC0</div><div><br></div><div>LLDB sets the status as connected after this communication.</div><div>(snip start)</div><div>    if (pid == LLDB_INVALID_PROCESS_ID)</div>
<div>    {</div><div>        // We don't have a valid process ID, so note that we are connected</div><div>        // and could now request to launch or attach, or get remote process </div><div>        // listings...</div>
<div>        SetPrivateState (eStateConnected);</div><div>    }</div><div>(snip end)</div><div>function: ProcessGDBRemote::DoConnectRemote ()</div><div><br></div><div>Thanks, </div><div>Chandra Kumar R.</div></div>