Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Dirk Grunwald <grunwald@foobar.cs.colorado.edu>
Subject: Re: What is the tool called 'atom' for?
Date: 1998/04/27	[thread overview]
Message-ID: <qxp1zujkne0.fsf@foobar.cs.colorado.edu> (raw)
In-Reply-To: 6i18ie$ao0$1@power42t.hkbu.edu.hk


s11976@net1.hkbu.edu.hk (P.M.Wong ) writes:

> 
> Could someone describe the "atom" analysis tool, e.g. what's it
> for , when should it be used ?
--

ATOM "decompiles" a binary, and allows you to insert "probes" or
instrumentation at different parts. You get to specify where
the instrumentation goes and what it does.

For example, you could bulid a simple branch coverage analysis package
by:

	+ counting all the conditional branches in the program

	+ inserting a 'probe' at each conditional branch that
	  records the frequency of taken/not-taken branches

	+ recording information about the file/line-number
	  of those different branches.

Then, you could 'instrument' any executable, run it as you normally
would, and get your branch coverage information when it's done.

Using this same infrastructure, you can build tools like Purify (in
fact, ATOM comes with such a tool, called 'third degree').

Here's an example of the "instrumentation" code that walks over all
procedures in a program and all basic blocks in the procedure to
locate conditional branches.


Instrument(int argc, char **argv, Obj *obj)
{
   Proc *p;  Block *b; Inst *i;

   for (p = GetFirstObjProc(obj); p != NULL; p = GetNextProc(p)) {
     for (b = GetFirstBlock(p); b != NULL; b = GetNextBlock(b)) {
       i = GetLastInst(b);
       if (IsInstType(i,InstTypeCondBr)) {
	 AddCallInst(i,InstBefore,"CondBranch",branch++,
		     REG_PC,BrCondValue);
       }
     }
   }
}




-- 
Dirk Grunwald                 Assoc. Prof, Univ. of Colorado at Boulder



  reply	other threads:[~1998-04-27  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-27  4:00 What is the tool called 'atom' for? P.M.Wong 
1998-04-27  4:00 ` Dirk Grunwald [this message]
1998-04-28  4:00 ` John P Williams
1998-05-05  4:00   ` Question about printers Antony Si Tou
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