How to go to the previous line in GDB?

前端 未结 9 822
北荒
北荒 2020-11-29 16:33

Is it possible in gdb to go to a line before the currently executing line. e.g:


void my_fun( somePtrType** arr,int start,int end)
{
 // arr is an array of p         


        
9条回答
  •  广开言路
    2020-11-29 17:33

    Yes, it is possible, and straightforward, now, with real hardware (ie. not just with a VM). GDB-7.0 supports reverse debugging with commands like reverse-step and reverse-continue, on native linux x86 machines.

    There is a tutorial here: http://www.sourceware.org/gdb/wiki/ProcessRecord/Tutorial

提交回复
热议问题