UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 17895

6.1 EDK - XMD: How can I determine the number of instructions executed in a function?

Description

Keywords: xmd, mb-gdb, instructions, execute, function

Urgency: Standard

General Description:
How can I determine the number of instructions executed in a function?

Solution

To determine the number of instructions a function executes, start two xygwin terminals.

In one terminal run:
$mb-gdb <filename>.elf.

In another window run:
$ xmd
XMD% mbconnect
XMD% dow <filename>.elf

In the mb-gdb debugger gui, click "Run".
Target: Remote/TCP: XMD
Hostname: localhost
Port: 1234
Click "OK".

Now set breakpoints before and after the desired function in the debugger. Once the break point before the function is reached, clear the states by going to the xmd window and enter:
XMD%xstats reset

Go back to the debugger and press "Continue" or step through the code to the next breakpoint.

Finally, you can view, in the XMD window, the number of instructions executed by entering:
XMD% xstats
AR# 17895
Date Created 08/27/2003
Last Updated 04/28/2006
Status Archive
Type General Article