From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3c1e109d508c942f X-Google-Attributes: gidfee84,public From: Dirk Grunwald Subject: Re: What is the tool called 'atom' for? Date: 1998/04/27 Message-ID: #1/1 X-Deja-AN: 348188258 References: <6i18ie$ao0$1@power42t.hkbu.edu.hk> Organization: University of Colorado Newsgroups: comp.unix.osf.osf1 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