1

I am using (an adapted version of) gdb on Ubuntu to debug an embedded system we have connected through the USB port using gdbserver.

The benchmark program in question is tested against a native compilation on the Linux machine. For the native run I can use the time command to get a convinient time measurement of the run:

> time ./prog.e

Can I use a similar mechanism in gdb? For example, to measure time until the next breakpoint, something like:

(gdb) time c
ysap
  • 7,723
  • 7
  • 59
  • 122

1 Answers1

0

See description of maintenance time here.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • Thanks. This could have been awesome if only it timed the "breakpoint event" and not the whole run time since last "c". I tried using it to measure the time of a loop that takes ~15 seconds to compute, but the result I got is 0.01 sec. which I assume is the time it took gdb to print the breakpoint message. – ysap Nov 13 '11 at 10:10
  • "Note that the CPU time printed is for gdb only, it does not include the execution time of the inferior because there's no mechanism currently to compute how much time was spent by gdb and how much time was spent by the program been debugged." Seems to make it useless. – Michael May 20 '13 at 22:57