Extract execution log from gdb record in a VirtualBox VM
Asked Answered
S

1

8

I am attempting to use gdb's record feature to generate a list of the instructions executed for the tutorial example

I can use gdb record to step forward and back successfully and save the execution log to a file using "record save".

I think what I want to do is "record instruction-history" which from docs

Disassembles instructions from the recorded execution log

But when I attempt this i get the error:

You can't do that when your target is 'record-full'

Attempting to set the record target to btrace returns the error:

Target does not support branch tracing.

I am running gdb 7.6 in a VirtualBox VM, do i need to be running natively or is there some other magic i'm missing.

Senary answered 7/6, 2013 at 19:27 Comment(1)
You should also look into Intel SDE: https://mcmap.net/q/15723/-how-to-run-record-instruction-history-and-function-call-history-in-gdbItch
H
2

Your problem comes from a problem on VirtualBox itself to perform this operation. As you can see in this link, more specifically in this lines:

if (packet->support != PACKET_ENABLE)
    error (_("Target does not support branch tracing."));

This problem is explained here.

But VirtualBox does NOT
emulate certain debugging features of modern x86 CPUs like branch target
store or performance counters.

My best guess is to install some other VirtualBox features that allow you to perform such operations, or switch to a new virtual environment.

I'll keep searching for information.

Homologue answered 26/12, 2013 at 17:26 Comment(2)
Excellent bit of research Jean, I am no longer researching this problem but great to get an answer anyway, going to mark as solution but will change the title to reflect the Virtual Box specific nature of the question.Senary
The cpuinfo flag needed is intel_pt: stackoverflow.com/questions/22507169/…Itch

© 2022 - 2024 — McMap. All rights reserved.