Skip to content
Snippets Groups Projects
  • Maxim Levitsky's avatar
    4cbf8efc
    scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame · 4cbf8efc
    Maxim Levitsky authored
    
    The code that dumps the stack frame works like that:
    * save current registers
    * overwrite current registers (including rip/rsp) with coroutine snapshot
      in the jmpbuf
    * print backtrace
    * restore the saved registers.
    
    If the user has currently selected a non topmost stack frame in gdb,
    the above code will still restore the selected frame registers,
    but the gdb will then lose the selected frame index, which makes it impossible
    to switch back to frame 0, to continue debugging the executable.
    
    Therefore switch temporarily to the topmost frame of the stack
    for the above code.
    
    Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
    Message-Id: <20201217155436.927320-2-mlevitsk@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    4cbf8efc
    History
    scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame
    Maxim Levitsky authored
    
    The code that dumps the stack frame works like that:
    * save current registers
    * overwrite current registers (including rip/rsp) with coroutine snapshot
      in the jmpbuf
    * print backtrace
    * restore the saved registers.
    
    If the user has currently selected a non topmost stack frame in gdb,
    the above code will still restore the selected frame registers,
    but the gdb will then lose the selected frame index, which makes it impossible
    to switch back to frame 0, to continue debugging the executable.
    
    Therefore switch temporarily to the topmost frame of the stack
    for the above code.
    
    Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
    Message-Id: <20201217155436.927320-2-mlevitsk@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>