<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">You only show one thread in your example. Did another thread have a valid stop reason? lldb shouldn’t be stopping for no reason anywhere…<div class=""><br class=""></div><div class="">Jim</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 18, 2016, at 4:08 PM, Jeffrey Tan via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Btw: the breakpoint I set is:<div class="">"b BigGrepMasterAsync.cpp:171" which is not in any of the stopped stack frames.</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Mar 18, 2016 at 3:47 PM, Jeffrey Tan <span dir="ltr" class=""><<a href="mailto:jeffrey.fudan@gmail.com" target="_blank" class="">jeffrey.fudan@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hi,<div class=""><br class=""></div><div class="">Our IDE(wrapping lldb using python) works fine on Linux for simple hello world cases. While trying a real world case, I found whenever we set a source line breakpoint, then trigger the code path, lldb will send a stopped state process event, with thread.GetStopReason() being None and with weird callstack. Any ideas why do I get this stop stack(code is listed at the end)? I have verified that if I do not set breakpoint and trigger the same code path does not cause this stop event to generate.</div><div class=""><br class=""></div><div class=""><div class="">bt</div><div class="">* thread #1: tid = 952490, 0x00007fd7cb2daa83 libc.so.6`__GI_epoll_wait + 51, name = 'biggrep_master_'</div><div class=""> * frame #0: 0x00007fd7cb2daa83 libc.so.6`__GI_epoll_wait + 51</div><div class=""> frame #1: 0x000000000271189f biggrep_master_server_async`epoll_dispatch(base=0x00007fd7ca970800, arg=0x00007fd7ca62c1e0, tv=<unavailable>) + 127 at epoll.c:315</div><div class=""> frame #2: 0x000000000270f6d1 biggrep_master_server_async`event_base_loop(base=0x00007fd7ca970800, flags=<unavailable>) + 225 at event.c:524</div><div class=""> frame #3: 0x00000000025f9378 biggrep_master_server_async`folly::EventBase::loopBody(this=0x00007fd7ca945180, flags=0) + 834 at EventBase.cpp:335</div><div class=""> frame #4: 0x00000000025f900b biggrep_master_server_async`folly::EventBase::loop(this=0x00007fd7ca945180) + 29 at EventBase.cpp:287</div><div class=""> frame #5: 0x00000000025fa053 biggrep_master_server_async`folly::EventBase::loopForever(this=0x00007fd7ca945180) + 109 at EventBase.cpp:435</div><div class=""> frame #6: 0x0000000001e24b72 biggrep_master_server_async`apache::thrift::ThriftServer::serve(this=0x00007fd7ca96d710) + 110 at ThriftServer.cpp:365</div><div class=""> frame #7: 0x00000000004906bc biggrep_master_server_async`facebook::services::ServiceFramework::startFramework(this=0x00007ffc06776140, waitUntilStop=true) + 1942 at ServiceFramework.cpp:885</div><div class=""> frame #8: 0x000000000048fe6d biggrep_master_server_async`facebook::services::ServiceFramework::go(this=0x00007ffc06776140, waitUntilStop=true) + 35 at ServiceFramework.cpp:775</div><div class=""> frame #9: 0x00000000004219a7 biggrep_master_server_async`main(argc=1, argv=0x00007ffc067769d8) + 2306 at BigGrepMasterServerAsync.cpp:134</div><div class=""> frame #10: 0x00007fd7cb1ed0f6 libc.so.6`__libc_start_main + 246</div><div class=""> frame #11: 0x0000000000420bfc biggrep_master_server_async`_start + 41 at start.S:122</div></div><div class=""><br class=""></div><div class="">Here is the code snippet of handling code:</div><div class=""><div class="">def _handle_process_event(self, event):</div><div class=""> # Ignore non-stopping events.</div><div class=""> if lldb.SBProcess.GetRestartedFromEvent(event):</div><div class=""> log_debug('Non stopping event: %s' % str(event))</div><div class=""> return</div><div class=""><br class=""></div><div class=""> process = lldb.SBProcess.GetProcessFromEvent(event)<br class=""></div><div class=""> if process.state == lldb.eStateStopped:</div><div class=""> self._send_paused_notification(process)</div><div class=""> elif process.state == lldb.eStateExited:</div><div class=""> exit_message = 'Process(%d) exited with: %u' % (</div><div class=""> process.GetProcessID(),</div><div class=""> process.GetExitStatus())</div><div class=""> if process.GetExitDescription():</div><div class=""> exit_message += (', ' + process.GetExitDescription())</div><div class=""> self._send_user_output('log', exit_message)</div><div class=""> self.should_quit = True</div><div class=""> else:</div><div class=""> self._send_notification('Debugger.resumed', None)</div><div class=""><br class=""></div><div class=""> event_type = event.GetType()</div><div class=""> if event_type == lldb.SBProcess.eBroadcastBitSTDOUT:</div><div class=""> # Read stdout from inferior.</div><div class=""> process_output = ''</div><div class=""> while True:</div><div class=""> output_part = process.GetSTDOUT(1024)</div><div class=""> if not output_part or len(output_part) == 0:</div><div class=""> break</div><div class=""> process_output += output_part</div><div class=""> self._send_user_output('log', process_output)</div></div></div>
</blockquote></div><br class=""></div>
_______________________________________________<br class="">lldb-dev mailing list<br class=""><a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev<br class=""></div></blockquote></div><br class=""></div></body></html>