How to run record instruction-history and function-call-history in GDB?

前端 未结 2 727
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-03 15:32

(EDIT: per the first answer below the current \"trick\" seems to be using an Atom processor. But I hope some gdb guru can answer if this is a fundamental limitation, or whet

2条回答
  •  日久生厌
    2020-12-03 15:54

    At least a partial answer (for the "am I doing it wrong" aspect) - from gdb-7.6.50.20140108/gdb/NEWS

    * A new record target "record-btrace" has been added.  The new target
      uses hardware support to record the control-flow of a process.  It
      does not support replaying the execution, but it implements the
      below new commands for investigating the recorded execution log.
      This new recording method can be enabled using:
    
    record btrace
    
      The "record-btrace" target is only available on Intel Atom processors
      and requires a Linux kernel 2.6.32 or later.
    
    * Two new commands have been added for record/replay to give information
      about the recorded execution without having to replay the execution.
      The commands are only supported by "record btrace".
    
    record instruction-history      prints the execution history at
                                    instruction granularity
    
    record function-call-history    prints the execution history at
                                    function granularity

    It's not often that I envy the owner of an Atom processor ;-)

    I'll edit the question to refocus upon the question of workarounds or plans for future support.

提交回复
热议问题