From: lueck@gurgi.zk3.dec.com (Greg Lueck Development Environment)
Subject: Re: question about ATOM, the alpha architecture analysis tool
Date: 1995/12/01 [thread overview]
Message-ID: <49nd3p$hm3@lead.zk3.dec.com> (raw)
In-Reply-To: 49igof$nct@agate.berkeley.edu
Rich,
This is as good a place as any to post Atom questions. I presume you
have a pre-release copy of the next Atom version since the interfaces
you ask about are not in the released version. Are you a Digital Unix
V4.0 field test site?
Atom tools consist of two parts, an instrumentation half and an analysis
half. The instrumentation half (the "*.inst.c" file) only has a static
view of the application. There are a number of navigation interfaces,
some of which can be used to look at each instruction in the
application. The analysis half of an Atom tool contains routines that
are invoked while the application runs. These routines can be used to
gather dynamic information about the application. If you just want to
statically analyze the application, you just need to write the
instrumentation half of the tool.
Here's a simple example that looks at every instruction in the
application:
#include <cmplrs/atom.inst.h>
Instrument(int iargc, char ** iargv, Obj *o)
{
Proc * p;
Block * b;
Inst * i;
for (p = GetFirstObjProc(o); p; p = GetNextProc(p)) {
for (b = GetFirstBlock(p); b; b = GetNextBlock(b)) {
for (i = GetFirstInst(b); i; i = GetNextInst(i)) {
if (GetInstClass(i) == ClassLoad) {
printf("Load instruction at 0x%lx\n", InstPC(i));
}
}
}
}
}
This traverses the procedures, basic blocks, and instructions in the
order that they appear in the application. The order is not the dynamic
execution order.
If you prefer to see the raw bit patterns for the instructions, you can
use the GetObjInstArray() interface. However, there is no way to
convert a single raw instruction to an "Inst *". You can get some
information from raw instructions by casting to the "union alpha_instruction"
type defined in <alpha/inst.h>. This allows you to pick out the opcode,
register fields, etc.
The "Inst *" type defined in <cmplrs/atom.inst.h> is intentionally left
as a pointer to an opaque structure. This allows Atom's internal
definition of an "Inst" to change without affecting compatibility with
existing Atom tools.
Hope this helps.
--
-------------------------------------------------------------------------------
Greg Lueck Opinions expressed herein are my own.
lueck@zk3.dec.com
-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------
Greg Lueck Opinions expressed herein are my own.
lueck@zk3.dec.com
-------------------------------------------------------------------------------
prev parent reply other threads:[~1995-12-01 5:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-11-29 5:00 question about ATOM, the alpha architecture analysis tool Richard Fromm
1995-11-30 5:00 ` John Henning
1995-12-02 5:00 ` Dirk Grunwald
1995-12-03 5:00 ` John Henning
1995-12-01 5:00 ` Greg Lueck Development Environment [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox