jimingham wrote:

> > then it would queue up a ThreadPlanStepOut that would go to that frame.
> 
> To elaborate on this, today there is no constructor for StepOut that allows 
> one to specify a target frame. This is also something we would need to create 
> for that to work, right?

The main constructor for ThreadStepOut is:

```
  ThreadPlanStepOut(Thread &thread, SymbolContext *addr_context,
                    bool first_insn, bool stop_others, Vote report_stop_vote,
                    Vote report_run_vote, uint32_t frame_idx,
                    LazyBool step_out_avoids_code_without_debug_info,
                    bool continue_to_next_branch = false,
                    bool gather_return_value = true);

```
The `frame_idx` parameter is the frame you step out to.  We use that, for 
instance, to implement "stepping out to the currently selected frame":

`(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x0000000100000330 callem`A at callem.c:2
    frame #1: 0x000000010000035c callem`B at callem.c:6
    frame #2: 0x0000000100000380 callem`C at callem.c:10
    frame #3: 0x00000001000003a4 callem`D at callem.c:14
    frame #4: 0x00000001000003c8 callem`main at callem.c:18
    frame #5: 0x00000001821e2b4c dyld`start
(lldb) up
frame #1: 0x000000010000035c callem`B at callem.c:6
   3    }
   4    
   5    int B (int input) {
-> 6      return A(input);
                 ^
   7    }
   8    
   9    int C (int input) {
(lldb) up
frame #2: 0x0000000100000380 callem`C at callem.c:10
   7    }
   8    
   9    int C (int input) {
-> 10     return B(input);
                 ^
   11   }
   12   
   13   int D (int input) {
(lldb) fin
Process 68455 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step out
Return value: (int) $0 = 500

    frame #0: 0x00000001000003a4 callem`D at callem.c:14
   11   }
   12   
   13   int D (int input) {
-> 14     return C(input);
          ^
   15   }
   16   
   17   int main() {
Target 0: (callem) stopped.
`

https://github.com/llvm/llvm-project/pull/135866
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to