[lldb-dev] [Bug 25111] SBThread::StepOut erases stack frames and doesn't set return value

via lldb-dev lldb-dev at lists.llvm.org
Fri Oct 9 10:37:08 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=25111

Jim Ingham <jingham at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jingham at apple.com
         Resolution|---                         |INVALID

--- Comment #1 from Jim Ingham <jingham at apple.com> ---
I don't think this has to do with StepOut & the thread return value.  It is
because you are driving lldb in async mode but not fetching any events.  You
either need to wait on the debugger event source, or run in sync mode.  An
example of waiting on events is given in examples/python/process-events.py in
the lldb sources.  Running in sync mode looks like:

 > cat doit.py
import lldb
import os
import time

debugger = lldb.SBDebugger.Create()
# Run the debugger in Sync mode:
debugger.SetAsync(False)
target = debugger.CreateTarget("/tmp/foo")
target.BreakpointCreateByLocation("foo.cpp", 3)
process = target.LaunchSimple([], [], os.getcwd())

thread = process.GetSelectedThread()
thread.StepOut()

value = thread.GetStopReturnValue()
print value

debugger.Terminate()
 > ( setenv PYTHONPATH `lldb -P` ; python doit.py )
(int) $0 = 8

That worked.  You should never have to insert sleeps to get lldb to do what you
want, if you are doing that then either we have bug or you aren't running lldb
in the mode you think you are.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20151009/894f12de/attachment.html>


More information about the lldb-dev mailing list