BPatch_Set.h   BPatch_Set.h 
skipping to change at line 46 skipping to change at line 46
#endif #endif
/*******************************************************/ /*******************************************************/
/* header files */ /* header files */
/*******************************************************/ /*******************************************************/
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include "BPatch_dll.h" #include "BPatch_dll.h"
#include "BPatch_Vector.h" #include "BPatch_Vector.h"
#include <iostream>
#if !defined(DO_INLINE_P) #if !defined(DO_INLINE_P)
#define DO_INLINE_P #define DO_INLINE_P
#endif #endif
#if !defined(DO_INLINE_F) #if !defined(DO_INLINE_F)
#define DO_INLINE_F #define DO_INLINE_F
#endif #endif
/** template struct that will be used for default compare /** template struct that will be used for default compare
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 BPatch_function.h   BPatch_function.h 
skipping to change at line 62 skipping to change at line 62
class BPatch_flowGraph; class BPatch_flowGraph;
class BPatchTranslatorBase; class BPatchTranslatorBase;
class ParameterType; class ParameterType;
class ReturnParameterType; class ReturnParameterType;
class BPatch_function; class BPatch_function;
namespace Dyninst { namespace Dyninst {
namespace ParseAPI { namespace ParseAPI {
class Function; class Function;
Function *convert(const BPatch_function *); PARSER_EXPORT Function *convert(const BPatch_function *);
}; };
namespace PatchAPI { namespace PatchAPI {
class PatchFunction; class PatchFunction;
PatchFunction *convert(const BPatch_function *); PARSER_EXPORT PatchFunction *convert(const BPatch_function *);
}; };
}; };
#ifdef DYNINST_CLASS_NAME #ifdef DYNINST_CLASS_NAME
#undef DYNINST_CLASS_NAME #undef DYNINST_CLASS_NAME
#endif #endif
#define DYNINST_CLASS_NAME BPatch_function #define DYNINST_CLASS_NAME BPatch_function
class BPATCH_DLL_EXPORT BPatch_function : class BPATCH_DLL_EXPORT BPatch_function :
public BPatch_sourceObj, public BPatch_sourceObj,
skipping to change at line 191 skipping to change at line 191
// For users of the library: // For users of the library:
API_EXPORT(Str, (), std::string, getName, ()); API_EXPORT(Str, (), std::string, getName, ());
// BPatch_function::getName // BPatch_function::getName
// Returns <demangled> name of function // Returns <demangled> name of function
API_EXPORT(Buffer, (s, len), API_EXPORT(Buffer, (s, len),
char *,getName,(char *s, int len)); char *,getName,(char *s, int len));
// String interface to mangled name
API_EXPORT(Str, (), std::string, getMangledName, ());
// BPatch_function::getMangledName // BPatch_function::getMangledName
// Returns mangled name of function, same as getName for non-c++ mutat ees // Returns mangled name of function, same as getName for non-c++ mutat ees
API_EXPORT(Int, (s, len), API_EXPORT(Int, (s, len),
char *,getMangledName,(char *s, int len)); char *,getMangledName,(char *s, int len));
// BPatch_function::getTypedName // BPatch_function::getTypedName
// Returns demanged name of function (with type string), may be empty // Returns demanged name of function (with type string), may be empty
API_EXPORT(Int, (s, len), API_EXPORT(Int, (s, len),
 End of changes. 3 change blocks. 
2 lines changed or deleted 5 lines changed or added


 BPatch_module.h   BPatch_module.h 
skipping to change at line 61 skipping to change at line 61
class BPatch_addressSpace; class BPatch_addressSpace;
class BPatch_process; class BPatch_process;
class BPatch_statement; class BPatch_statement;
class func_instance; class func_instance;
class int_variable; class int_variable;
class instPoint; class instPoint;
class AddressSpace; class AddressSpace;
class BPatch_snippet; class BPatch_snippet;
class BPatchSnippetHandle; class BPatchSnippetHandle;
class BPatch_module; class BPatch_module;
class BPatch_object;
namespace Dyninst { namespace Dyninst {
namespace ParseAPI { namespace ParseAPI {
class CodeObject; class CodeObject;
CodeObject *convert(const BPatch_module *); CodeObject *convert(const BPatch_module *);
} }
namespace PatchAPI { namespace PatchAPI {
class PatchObject; class PatchObject;
PatchObject *convert(const BPatch_module *); PatchObject *convert(const BPatch_module *);
class PatchFunction; class PatchFunction;
skipping to change at line 155 skipping to change at line 156
API_EXPORT(Int, (buffer, length), API_EXPORT(Int, (buffer, length),
char *,getFullName,(char *buffer, int length)); char *,getFullName,(char *buffer, int length));
// BPatch_module::libraryName // BPatch_module::libraryName
// Returns name if library, if this module is a shared object // Returns name if library, if this module is a shared object
API_EXPORT(Int, (), API_EXPORT(Int, (),
const char *,libraryName,()); const char *,libraryName,());
// BPatch_module::getObject
// Returns BPatch_object containing this file
API_EXPORT(Int, (),
BPatch_object *, getObject, ());
// BPatch_module::getAddressWidth // BPatch_module::getAddressWidth
// Returns the width (in bytes) of an address in this module // Returns the width (in bytes) of an address in this module
API_EXPORT(Int, (), API_EXPORT(Int, (),
size_t,getAddressWidth,()); size_t,getAddressWidth,());
// BPatch_module::getVariables // BPatch_module::getVariables
// Fills a vector with the global variables that are specified in this module // Fills a vector with the global variables that are specified in this module
API_EXPORT(Int, (vars), API_EXPORT(Int, (vars),
 End of changes. 2 change blocks. 
0 lines changed or deleted 6 lines changed or added


 BPatch_point.h   BPatch_point.h 
skipping to change at line 48 skipping to change at line 48
#include "BPatch_enums.h" #include "BPatch_enums.h"
class InstrucIter; class InstrucIter;
class instPoint; class instPoint;
class miniTramp; class miniTramp;
class BPatch_thread; class BPatch_thread;
class BPatch_image; class BPatch_image;
class BPatch_function; class BPatch_function;
class BPatch_memoryAccess; class BPatch_memoryAccess;
class BPatchSnippetHandle; class BPatchSnippetHandle;
class BPatch_basicBlock;
class BPatch_basicBlockLoop; class BPatch_basicBlockLoop;
class BPatch_point; class BPatch_point;
class BPatch_process; class BPatch_process;
class BPatch_frame; class BPatch_frame;
class BPatch_edge; class BPatch_edge;
class BPatch_snippet; class BPatch_snippet;
class BPatch_addressSpace; class BPatch_addressSpace;
class AddressSpace; class AddressSpace;
class BPatch_register; class BPatch_register;
skipping to change at line 221 skipping to change at line 222
// Returns a BPatch_function representing the function being called at this point. // Returns a BPatch_function representing the function being called at this point.
// If this point is not a call site, returns NULL. // If this point is not a call site, returns NULL.
API_EXPORT(Int, (), API_EXPORT(Int, (),
BPatch_function *,getCalledFunction,()); BPatch_function *,getCalledFunction,());
API_EXPORT(Int, (), API_EXPORT(Int, (),
std::string,getCalledFunctionName,()); std::string,getCalledFunctionName,());
// BPatch_point::getBlock
// Returns block to which this point belongs if such a block exists
// For example, function entry points do not have blocks associated wi
th them.
API_EXPORT(Int, (),
BPatch_basicBlock *,getBlock,());
// BPatch_point::getAddress // BPatch_point::getAddress
// Returns the address of this point in the mutatee // Returns the address of this point in the mutatee
API_EXPORT(Int, (), API_EXPORT(Int, (),
void *,getAddress,()); void *,getAddress,());
// BPatch_point::getMemoryAccess // BPatch_point::getMemoryAccess
// //
 End of changes. 2 change blocks. 
0 lines changed or deleted 10 lines changed or added


 BPatch_process.h   BPatch_process.h 
skipping to change at line 447 skipping to change at line 447
// process state. Note that such steps will be taken whethe r or not // process state. Note that such steps will be taken whethe r or not
// a variable is provided. // a variable is provided.
API_EXPORT(Int, (atomic, modified), API_EXPORT(Int, (atomic, modified),
bool, finalizeInsertionSet, (bool atomic, bool *modified = N ULL)); bool, finalizeInsertionSet, (bool atomic, bool *modified = N ULL));
API_EXPORT(Int, (atomic, modified, catchup_handles), API_EXPORT(Int, (atomic, modified, catchup_handles),
bool, finalizeInsertionSetWithCatchup, (bool atomic, bool *m odified, bool, finalizeInsertionSetWithCatchup, (bool atomic, bool *m odified,
BPatch_Vector<BPatch_catchupInf o> &catchup_handles)); BPatch_Vector<BPatch_catchupInf o> &catchup_handles));
// BPatch_process::setMutationsActive
//
// Turn on/off instrumentation
API_EXPORT(Int, (activate),
bool,setMutationsActive,(bool activate));
// BPatch_process::oneTimeCode // BPatch_process::oneTimeCode
// //
// Have the specified code be executed by the mutatee once. Wait unti l done. // Have the specified code be executed by the mutatee once. Wait unti l done.
API_EXPORT(Int, (expr, err), API_EXPORT(Int, (expr, err),
void *,oneTimeCode,(const BPatch_snippet &expr, bool *err = NULL)); void *,oneTimeCode,(const BPatch_snippet &expr, bool *err = NULL));
// BPatch_process::oneTimeCodeAsync // BPatch_process::oneTimeCodeAsync
// //
// Have the specified code be executed by the mutatee once. Dont wait until done. // Have the specified code be executed by the mutatee once. Dont wait until done.
 End of changes. 1 change blocks. 
7 lines changed or deleted 0 lines changed or added


 CFG.h   CFG.h 
skipping to change at line 37 skipping to change at line 37
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef _PARSER_CFG_H_ #ifndef _PARSER_CFG_H_
#define _PARSER_CFG_H_ #define _PARSER_CFG_H_
#include <vector> #include <vector>
#include <set> #include <set>
#include <map> #include <map>
#include <string> #include <string>
#include "dyntypes.h" #include "dyntypes.h"
#include "IBSTree.h" #include "IBSTree.h"
#include "InstructionSource.h" #include "InstructionSource.h"
#include "ParseContainers.h" #include "ParseContainers.h"
#include "Annotatable.h" #include "Annotatable.h"
#include <iostream> #include <iostream>
namespace Dyninst { namespace Dyninst {
namespace ParseAPI { namespace ParseAPI {
class CFGModifier;
class CodeObject; class CodeObject;
class CFGModifier;
enum EdgeTypeEnum { enum EdgeTypeEnum {
CALL = 0, CALL = 0,
COND_TAKEN, COND_TAKEN,
COND_NOT_TAKEN, COND_NOT_TAKEN,
INDIRECT, INDIRECT,
DIRECT, DIRECT,
FALLTHROUGH, FALLTHROUGH,
CATCH, CATCH,
CALL_FT, // fallthrough after call instruction CALL_FT, // fallthrough after call instruction
skipping to change at line 162 skipping to change at line 162
// (tail calls) // (tail calls)
}; };
EdgeType _type; EdgeType _type;
public: public:
PARSER_EXPORT Edge(Block * source, PARSER_EXPORT Edge(Block * source,
Block * target, Block * target,
EdgeTypeEnum type); EdgeTypeEnum type);
PARSER_EXPORT virtual ~Edge(); PARSER_EXPORT virtual ~Edge();
PARSER_EXPORT virtual Block * src() const { return _source; } PARSER_EXPORT Block * src() const { return _source; }
PARSER_EXPORT virtual Block * trg() const { return _target; } PARSER_EXPORT Block * trg() const { return _target; }
PARSER_EXPORT EdgeTypeEnum type() const { PARSER_EXPORT EdgeTypeEnum type() const {
return static_cast<EdgeTypeEnum>(_type._type_enum); return static_cast<EdgeTypeEnum>(_type._type_enum);
} }
bool sinkEdge() const { return _type._sink != 0; } bool sinkEdge() const { return _type._sink != 0; }
bool interproc() const { bool interproc() const {
return (_type._interproc != 0 || return (_type._interproc != 0 ||
type() == CALL || type() == CALL ||
type() == RET); type() == RET);
} }
skipping to change at line 196 skipping to change at line 196
friend class Parser; friend class Parser;
}; };
/* /*
* Iteration over edges can be controlled by an EdgePredicate. * Iteration over edges can be controlled by an EdgePredicate.
* Edges are returned only if pred(edge) evaluates true. * Edges are returned only if pred(edge) evaluates true.
* *
* EdgePredicates are composable by AND. * EdgePredicates are composable by AND.
*/ */
class EdgePredicate class EdgePredicate
: public iterator_predicate<
EdgePredicate,
Edge *,
Edge *
>
{ {
protected:
EdgePredicate * _next;
public: public:
PARSER_EXPORT EdgePredicate() : _next(NULL) { } PARSER_EXPORT EdgePredicate() { }
PARSER_EXPORT EdgePredicate(EdgePredicate * next) : _next(next) { }
PARSER_EXPORT virtual ~EdgePredicate() { } PARSER_EXPORT virtual ~EdgePredicate() { }
PARSER_EXPORT virtual bool pred_impl(Edge *) const; PARSER_EXPORT virtual bool pred_impl(Edge *) const;
}; PARSER_EXPORT bool operator()(Edge* e) const
{
return pred_impl(e);
}
};
/* may follow branches into the function if there is shared code */ /* may follow branches into the function if there is shared code */
class Intraproc : public EdgePredicate { class Intraproc : public EdgePredicate {
public: public:
PARSER_EXPORT Intraproc() { } PARSER_EXPORT Intraproc() { }
PARSER_EXPORT Intraproc(EdgePredicate * next) : EdgePredicate(next) { }
PARSER_EXPORT ~Intraproc() { } PARSER_EXPORT ~Intraproc() { }
PARSER_EXPORT bool pred_impl(Edge *) const; PARSER_EXPORT bool pred_impl(Edge *) const;
}; };
/* follow interprocedural edges */ /* follow interprocedural edges */
class Interproc : public EdgePredicate { class Interproc : public EdgePredicate {
public: public:
PARSER_EXPORT Interproc() {} PARSER_EXPORT Interproc() {}
PARSER_EXPORT Interproc(EdgePredicate * next) : EdgePredicate(next) { }
PARSER_EXPORT ~Interproc() { } PARSER_EXPORT ~Interproc() { }
PARSER_EXPORT bool pred_impl(Edge *) const; PARSER_EXPORT bool pred_impl(Edge *) const;
}; };
/* /*
* For proper ostritch-like denial of * For proper ostritch-like denial of
* unresolved control flow edges * unresolved control flow edges
*/ */
class NoSinkPredicate : public ParseAPI::EdgePredicate { class NoSinkPredicate : public ParseAPI::EdgePredicate {
public: public:
NoSinkPredicate() { } NoSinkPredicate() { }
NoSinkPredicate(EdgePredicate * next)
: EdgePredicate(next)
{ }
bool pred_impl(ParseAPI::Edge * e) const { bool pred_impl(ParseAPI::Edge * e) const {
return !e->sinkEdge() && EdgePredicate::pred_impl(e); return !e->sinkEdge() && EdgePredicate::pred_impl(e);
} }
}; };
/* doesn't follow branches into the function if there is shared code */ /* doesn't follow branches into the function if there is shared code */
class Function; class Function;
class SingleContext : public EdgePredicate { class SingleContext : public EdgePredicate {
private: private:
Function * _context; Function * _context;
bool _forward; bool _forward;
bool _backward; bool _backward;
public: public:
PARSER_EXPORT SingleContext(Function * f, bool forward, bool backward) : PARSER_EXPORT SingleContext(Function * f, bool forward, bool backward) :
_context(f), _context(f),
_forward(forward), _forward(forward),
_backward(backward) { } _backward(backward) { }
PARSER_EXPORT ~SingleContext() { } PARSER_EXPORT ~SingleContext() { }
PARSER_EXPORT bool pred_impl(Edge *) const; PARSER_EXPORT bool pred_impl(Edge *) const;
}; };
/* Doesn't follow branches into the function if there is shared code. /* Doesn't follow branches into the function if there is shared code.
* Will follow interprocedural call/return edges */ * Will follow interprocedural call/return edges */
class SingleContextOrInterproc : public EdgePredicate { class SingleContextOrInterproc : public EdgePredicate {
private: private:
Function * _context; Function * _context;
bool _forward; bool _forward;
bool _backward; bool _backward;
public: public:
PARSER_EXPORT SingleContextOrInterproc(Function * f, bool forward, bool backward) : PARSER_EXPORT SingleContextOrInterproc(Function * f, bool forward, bool backward) :
_context(f), _context(f),
_forward(forward), _forward(forward),
_backward(backward) { } _backward(backward) { }
PARSER_EXPORT ~SingleContextOrInterproc() { } PARSER_EXPORT ~SingleContextOrInterproc() { }
PARSER_EXPORT bool pred_impl(Edge *) const; PARSER_EXPORT bool pred_impl(Edge *) const;
PARSER_EXPORT bool operator()(Edge* e) const
{
return pred_impl(e);
}
}; };
class CodeObject;
class CodeRegion; class CodeRegion;
class Block : public Dyninst::interval<Address>, class Block : public Dyninst::interval<Address>,
public allocatable { public allocatable {
friend class CFGModifier; friend class CFGModifier;
public: public:
typedef ContainerWrapper< typedef std::vector<Edge*> edgelist;
std::vector<Edge*>,
Edge*,
Edge*,
EdgePredicate
> edgelist;
PARSER_EXPORT Block(CodeObject * o, CodeRegion * r, Address start); PARSER_EXPORT Block(CodeObject * o, CodeRegion * r, Address start);
PARSER_EXPORT virtual ~Block(); PARSER_EXPORT virtual ~Block();
PARSER_EXPORT Address start() const { return _start; } PARSER_EXPORT Address start() const { return _start; }
PARSER_EXPORT Address end() const { return _end; } PARSER_EXPORT Address end() const { return _end; }
PARSER_EXPORT Address lastInsnAddr() const { return _lastInsn; } PARSER_EXPORT Address lastInsnAddr() const { return _lastInsn; }
PARSER_EXPORT Address last() const { return lastInsnAddr(); } PARSER_EXPORT Address last() const { return lastInsnAddr(); }
PARSER_EXPORT Address size() const { return _end - _start; } PARSER_EXPORT Address size() const { return _end - _start; }
skipping to change at line 312 skipping to change at line 302
PARSER_EXPORT CodeRegion * region() const { return _region; } PARSER_EXPORT CodeRegion * region() const { return _region; }
/* Edge access */ /* Edge access */
PARSER_EXPORT const edgelist & sources() const { return _srclist; } PARSER_EXPORT const edgelist & sources() const { return _srclist; }
PARSER_EXPORT const edgelist & targets() const { return _trglist; } PARSER_EXPORT const edgelist & targets() const { return _trglist; }
PARSER_EXPORT bool consistent(Address addr, Address & prev_insn); PARSER_EXPORT bool consistent(Address addr, Address & prev_insn);
PARSER_EXPORT int containingFuncs() const; PARSER_EXPORT int containingFuncs() const;
PARSER_EXPORT void getFuncs(std::vector<Function *> & funcs); PARSER_EXPORT void getFuncs(std::vector<Function *> & funcs);
template<class OutputIterator> void getFuncs(OutputIterator result);
PARSER_EXPORT bool wasUserAdded() const; PARSER_EXPORT bool wasUserAdded() const;
/* interval implementation */ /* interval implementation */
Address low() const { return start(); } Address low() const { return start(); }
Address high() const { return end(); } Address high() const { return end(); }
struct compare { struct compare {
bool operator()(Block * const & b1, Block * const & b2) const { bool operator()(Block * const & b1, Block * const & b2) const {
if(b1->start() < b2->start()) return true; if(b1->start() < b2->start()) return true;
skipping to change at line 353 skipping to change at line 344
void updateEnd(Address addr); void updateEnd(Address addr);
private: private:
CodeObject * _obj; CodeObject * _obj;
CodeRegion * _region; CodeRegion * _region;
Address _start; Address _start;
Address _end; Address _end;
Address _lastInsn; Address _lastInsn;
std::vector<Edge *> _sources;
std::vector<Edge *> _targets;
edgelist _srclist; edgelist _srclist;
edgelist _trglist; edgelist _trglist;
int _func_cnt; int _func_cnt;
bool _parsed; bool _parsed;
friend class Edge; friend class Edge;
friend class Function; friend class Function;
friend class Parser; friend class Parser;
friend class CFGFactory; friend class CFGFactory;
}; };
inline void Block::addSource(Edge * e) inline void Block::addSource(Edge * e)
{ {
_sources.push_back(e); _srclist.push_back(e);
} }
inline void Block::addTarget(Edge * e) inline void Block::addTarget(Edge * e)
{ {
_targets.push_back(e); _trglist.push_back(e);
} }
inline void Block::removeTarget(Edge * e) inline void Block::removeTarget(Edge * e)
{ {
for(unsigned i=0;i<_targets.size();++i) { for(unsigned i=0;i<_trglist.size();++i) {
if(_targets[i] == e) { if(_trglist[i] == e) {
_targets[i] = _targets.back(); _trglist[i] = _trglist.back();
_targets.pop_back(); _trglist.pop_back();
break; break;
} }
} }
} }
inline void Block::removeSource(Edge * e) { inline void Block::removeSource(Edge * e) {
for(unsigned i=0;i<_sources.size();++i) { for(unsigned i=0;i<_srclist.size();++i) {
if(_sources[i] == e) { if(_srclist[i] == e) {
_sources[i] = _sources.back(); _srclist[i] = _srclist.back();
_sources.pop_back(); _srclist.pop_back();
break; break;
} }
} }
} }
enum FuncReturnStatus { enum FuncReturnStatus {
UNSET, UNSET,
NORETURN, NORETURN,
UNKNOWN, UNKNOWN,
RETURN RETURN
}; };
/* Discovery method of functions */ /* Discovery method of functions */
enum FuncSource { enum FuncSource {
RT = 0, // recursive traversal (default) RT = 0, // recursive traversal (default)
HINT, // specified in code object hints HINT, // specified in code object hints
GAP, // gap heuristics GAP, // gap heuristics
GAPRT, // RT from gap-discovered function GAPRT, // RT from gap-discovered function
ONDEMAND, // dynamically discovered ONDEMAND, // dynamically discovered
MODIFICATION, // Added via user modification
_funcsource_end_ _funcsource_end_
}; };
enum StackTamper { enum StackTamper {
TAMPER_UNSET, TAMPER_UNSET,
TAMPER_NONE, TAMPER_NONE,
TAMPER_REL, TAMPER_REL,
TAMPER_ABS, TAMPER_ABS,
TAMPER_NONZERO TAMPER_NONZERO
}; };
skipping to change at line 444 skipping to change at line 433
FuncSource _src; FuncSource _src;
FuncReturnStatus _rs; FuncReturnStatus _rs;
std::string _name; std::string _name;
Block * _entry; Block * _entry;
protected: protected:
PARSER_EXPORT Function(); PARSER_EXPORT Function();
public: public:
bool _is_leaf_function; bool _is_leaf_function;
Address _ret_addr; // return address of a function stored in stack at f unction entry Address _ret_addr; // return address of a function stored in stack at f unction entry
typedef ContainerWrapper< typedef std::vector<Block*> blocklist;
std::vector<Block*>, typedef std::set<Edge*> edgelist;
Block*,
Block*
> blocklist;
typedef ContainerWrapper<
std::set<Edge*>,
Edge*,
Edge*
> edgelist;
PARSER_EXPORT Function(Address addr, string name, CodeObject * obj, PARSER_EXPORT Function(Address addr, string name, CodeObject * obj,
CodeRegion * region, InstructionSource * isource); CodeRegion * region, InstructionSource * isource);
PARSER_EXPORT virtual ~Function(); PARSER_EXPORT virtual ~Function();
PARSER_EXPORT virtual const string & name(); PARSER_EXPORT virtual const string & name();
PARSER_EXPORT Address addr() const { return _start; } PARSER_EXPORT Address addr() const { return _start; }
PARSER_EXPORT CodeRegion * region() const { return _region; } PARSER_EXPORT CodeRegion * region() const { return _region; }
PARSER_EXPORT InstructionSource * isrc() const { return _isrc; } PARSER_EXPORT InstructionSource * isrc() const { return _isrc; }
PARSER_EXPORT CodeObject * obj() const { return _obj; } PARSER_EXPORT CodeObject * obj() const { return _obj; }
PARSER_EXPORT FuncSource src() const { return _src; } PARSER_EXPORT FuncSource src() const { return _src; }
PARSER_EXPORT FuncReturnStatus retstatus() const { return _rs; } PARSER_EXPORT FuncReturnStatus retstatus() const { return _rs; }
PARSER_EXPORT Block * entry() const { return _entry; } PARSER_EXPORT Block * entry() const { return _entry; }
PARSER_EXPORT bool parsed() const { return _parsed; } PARSER_EXPORT bool parsed() const { return _parsed; }
/* Basic block and CFG access */ /* Basic block and CFG access */
PARSER_EXPORT blocklist & blocks(); PARSER_EXPORT blocklist & blocks();
PARSER_EXPORT const blocklist& blocks() const;
PARSER_EXPORT bool contains(Block *b); PARSER_EXPORT bool contains(Block *b);
PARSER_EXPORT edgelist & callEdges(); PARSER_EXPORT const edgelist & callEdges();
PARSER_EXPORT blocklist & returnBlocks(); PARSER_EXPORT const blocklist & returnBlocks();
PARSER_EXPORT blocklist & exitBlocks(); PARSER_EXPORT const blocklist & exitBlocks();
/* Function details */ /* Function details */
PARSER_EXPORT bool hasNoStackFrame() const { return _no_stack_frame; } PARSER_EXPORT bool hasNoStackFrame() const { return _no_stack_frame; }
PARSER_EXPORT bool savesFramePointer() const { return _saves_fp; } PARSER_EXPORT bool savesFramePointer() const { return _saves_fp; }
PARSER_EXPORT bool cleansOwnStack() const { return _cleans_stack; } PARSER_EXPORT bool cleansOwnStack() const { return _cleans_stack; }
/* Parse updates and obfuscation */ /* Parse updates and obfuscation */
PARSER_EXPORT void setEntryBlock(Block *new_entry); PARSER_EXPORT void setEntryBlock(Block *new_entry);
PARSER_EXPORT void set_retstatus(FuncReturnStatus rs); PARSER_EXPORT void set_retstatus(FuncReturnStatus rs);
PARSER_EXPORT void removeBlock( Block* ); PARSER_EXPORT void removeBlock( Block* );
skipping to change at line 515 skipping to change at line 498
static void destroy(Function *f); static void destroy(Function *f);
private: private:
std::vector<Block *> const& blocks_int(); std::vector<Block *> const& blocks_int();
void delayed_link_return(CodeObject * co, Block * retblk); void delayed_link_return(CodeObject * co, Block * retblk);
void finalize(); void finalize();
bool _parsed; bool _parsed;
bool _cache_valid; bool _cache_valid;
blocklist _bl; blocklist _bl;
std::vector<Block *> _blocks;
std::vector<FuncExtent *> _extents; std::vector<FuncExtent *> _extents;
/* rapid lookup for edge predicate tests */ /* rapid lookup for edge predicate tests */
//typedef dyn_hash_map<Address, Block*> blockmap; //typedef dyn_hash_map<Address, Block*> blockmap;
typedef std::map<Address, Block*> blockmap; typedef std::map<Address, Block*> blockmap;
blockmap _bmap; blockmap _bmap;
/* rapid lookup for interprocedural queries */ /* rapid lookup for interprocedural queries */
std::set<Edge *> _call_edges;
edgelist _call_edge_list; edgelist _call_edge_list;
std::vector<Block *> _return_blocks;
blocklist _retBL; blocklist _retBL;
// Superset of return blocks; this includes all blocks where // Superset of return blocks; this includes all blocks where
// execution leaves the function without coming back, including // execution leaves the function without coming back, including
// returns, calls to non-returning calls, tail calls, etc. // returns, calls to non-returning calls, tail calls, etc.
// Might want to include exceptions... // Might want to include exceptions...
std::vector<Block *> _exit_blocks;
blocklist _exitBL; blocklist _exitBL;
/* function details */ /* function details */
bool _no_stack_frame; bool _no_stack_frame;
bool _saves_fp; bool _saves_fp;
bool _cleans_stack; bool _cleans_stack;
StackTamper _tamper; StackTamper _tamper;
Address _tamper_addr; Address _tamper_addr;
/*** Internal parsing methods and state ***/ /*** Internal parsing methods and state ***/
 End of changes. 34 change blocks. 
60 lines changed or deleted 39 lines changed or added


 CFGModifier.h   CFGModifier.h 
skipping to change at line 79 skipping to change at line 79
PARSER_EXPORT static InsertedRegion *insert(CodeObject *obj, PARSER_EXPORT static InsertedRegion *insert(CodeObject *obj,
Address base, void *data, Address base, void *data,
unsigned size); unsigned size);
// Remove blocks from the CFG; the block must be unreachable // Remove blocks from the CFG; the block must be unreachable
// (that is, have no in-edges) unless force is true. // (that is, have no in-edges) unless force is true.
PARSER_EXPORT static bool remove(std::vector<Block *> &, bool force = fa lse); PARSER_EXPORT static bool remove(std::vector<Block *> &, bool force = fa lse);
// As the above, but for functions. // As the above, but for functions.
PARSER_EXPORT static bool remove(Function *); PARSER_EXPORT static bool remove(Function *);
// Label a block as the entry of a new function. If the block is already
an
// entry that function is returned; otherwise we create a new function a
nd
// return it.
PARSER_EXPORT static Function *makeEntry(Block *);
}; };
class InsertedRegion : public CodeRegion { class InsertedRegion : public CodeRegion {
public: public:
PARSER_EXPORT InsertedRegion(Address base, void *data, unsigned size, Ar chitecture arch); PARSER_EXPORT InsertedRegion(Address base, void *data, unsigned size, Ar chitecture arch);
PARSER_EXPORT virtual ~InsertedRegion(); PARSER_EXPORT virtual ~InsertedRegion();
// names: not overriden (as there are no names [yet]) // names: not overriden (as there are no names [yet])
// findCatchBlock: there isn't one // findCatchBlock: there isn't one
 End of changes. 1 change blocks. 
0 lines changed or deleted 7 lines changed or added


 CodeObject.h   CodeObject.h 
skipping to change at line 56 skipping to change at line 56
/** A CodeObject defines a collection of binary code, for example a binary, /** A CodeObject defines a collection of binary code, for example a binary,
dynamic library, archive, memory snapshot, etc. In the context of dynamic library, archive, memory snapshot, etc. In the context of
Dyninst, it maps to an image object. Dyninst, it maps to an image object.
**/ **/
class Parser; // internals class Parser; // internals
class ParseCallback; class ParseCallback;
class ParseCallbackManager; class ParseCallbackManager;
class CFGModifier; class CFGModifier;
class CodeSource;
class CodeObject { class CodeObject {
friend class CFGModifier; friend class CFGModifier;
public: public:
PARSER_EXPORT static void version(int& major, int& minor, int& maintena nce); PARSER_EXPORT static void version(int& major, int& minor, int& maintena nce);
typedef ContainerWrapper< typedef std::set<Function*,Function::less> funclist;
std::set<Function*,Function::less>,
Function*,
Function*
> funclist;
PARSER_EXPORT CodeObject(CodeSource * cs, PARSER_EXPORT CodeObject(CodeSource * cs,
CFGFactory * fact = NULL, CFGFactory * fact = NULL,
ParseCallback * cb = NULL, ParseCallback * cb = NULL,
bool defensiveMode = false); bool defensiveMode = false);
PARSER_EXPORT ~CodeObject(); PARSER_EXPORT ~CodeObject();
/** Parsing interface **/ /** Parsing interface **/
// `hint-based' parsing // `hint-based' parsing
skipping to change at line 108 skipping to change at line 105
// functions // functions
PARSER_EXPORT Function * findFuncByEntry(CodeRegion * cr, Address entry ); PARSER_EXPORT Function * findFuncByEntry(CodeRegion * cr, Address entry );
PARSER_EXPORT int findFuncs(CodeRegion * cr, PARSER_EXPORT int findFuncs(CodeRegion * cr,
Address addr, Address addr,
std::set<Function*> & funcs); std::set<Function*> & funcs);
// Find functions overlapping the range [start,end) // Find functions overlapping the range [start,end)
PARSER_EXPORT int findFuncs(CodeRegion * cr, PARSER_EXPORT int findFuncs(CodeRegion * cr,
Address start, Address end, Address start, Address end,
std::set<Function*> & funcs); std::set<Function*> & funcs);
PARSER_EXPORT funclist & funcs() { return flist; } PARSER_EXPORT const funclist & funcs() { return flist; }
// blocks // blocks
PARSER_EXPORT Block * findBlockByEntry(CodeRegion * cr, Address entry); PARSER_EXPORT Block * findBlockByEntry(CodeRegion * cr, Address entry);
PARSER_EXPORT int findBlocks(CodeRegion * cr, PARSER_EXPORT int findBlocks(CodeRegion * cr,
Address addr, std::set<Block*> & blocks); Address addr, std::set<Block*> & blocks);
PARSER_EXPORT Block * findNextBlock(CodeRegion * cr, Address addr); PARSER_EXPORT Block * findNextBlock(CodeRegion * cr, Address addr);
/* Misc */ /* Misc */
PARSER_EXPORT CodeSource * cs() const { return _cs; } PARSER_EXPORT CodeSource * cs() const { return _cs; }
PARSER_EXPORT CFGFactory * fact() const { return _fact; } PARSER_EXPORT CFGFactory * fact() const { return _fact; }
skipping to change at line 171 skipping to change at line 168
private: private:
CodeSource * _cs; CodeSource * _cs;
CFGFactory * _fact; CFGFactory * _fact;
ParseCallbackManager * _pcb; ParseCallbackManager * _pcb;
Parser * parser; // parser implementation Parser * parser; // parser implementation
bool owns_factory; bool owns_factory;
bool defensive; bool defensive;
funclist flist; funclist& flist;
}; };
// We need CFG.h, which is included by this
template <class OutputIterator>
void Block::getFuncs(OutputIterator result) {
set<Function *> stab;
_obj->findFuncs(region(), start(), stab);
std::copy(stab.begin(), stab.end(), result);
}
}//namespace ParseAPI }//namespace ParseAPI
}//namespace Dyninst }//namespace Dyninst
#endif #endif
 End of changes. 5 change blocks. 
7 lines changed or deleted 12 lines changed or added


 CodeSource.h   CodeSource.h 
skipping to change at line 38 skipping to change at line 38
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef _CODE_SOURCE_H_ #ifndef _CODE_SOURCE_H_
#define _CODE_SOURCE_H_ #define _CODE_SOURCE_H_
#include <map> #include <map>
#include <vector> #include <vector>
#include <utility> #include <utility>
#include <string> #include <string>
#include <Symtab.h> #include "Symtab.h"
#include "IBSTree.h" #include "IBSTree.h"
#include "dyntypes.h" #include "dyntypes.h"
#include "InstructionSource.h" #include "InstructionSource.h"
class StatContainer; class StatContainer;
namespace Dyninst { namespace Dyninst {
namespace ParseAPI { namespace ParseAPI {
skipping to change at line 103 skipping to change at line 103
std::string _name; std::string _name;
}; };
class CodeSource : public Dyninst::InstructionSource { class CodeSource : public Dyninst::InstructionSource {
friend class CFGModifier; friend class CFGModifier;
private: private:
bool _regions_overlap; bool _regions_overlap;
protected: protected:
/* /*
* Imelmentors of CodeSource can fill the following * Implementers of CodeSource can fill the following
* structures with available information. Some * structures with available information. Some
* of this information is optional. * of this information is optional.
*/ */
/* /*
* Named external linkage table (e.g. PLT on ELF). Optional. * Named external linkage table (e.g. PLT on ELF). Optional.
*/ */
mutable std::map<Address, std::string> _linkage; mutable std::map<Address, std::string> _linkage;
/* /*
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 Collections.h   Collections.h 
skipping to change at line 45 skipping to change at line 45
#include "Variable.h" #include "Variable.h"
#include "Serialization.h" #include "Serialization.h"
namespace Dyninst { namespace Dyninst {
namespace SymtabAPI { namespace SymtabAPI {
class Module; class Module;
class Symtab; class Symtab;
class localVar; class localVar;
class DwarfWalker;
/* /*
* This class contains a collection of local variables. * This class contains a collection of local variables.
* Each function will have one of these objects associated with it. * Each function will have one of these objects associated with it.
* This object will store all the local variables within this function. * This object will store all the local variables within this function.
* Note: This class is unaware of scope. * Note: This class is unaware of scope.
*/ */
class localVarCollection : public AnnotationContainer<localVar *> { class localVarCollection : public AnnotationContainer<localVar *> {
std::vector<localVar *> localVars; std::vector<localVar *> localVars;
skipping to change at line 77 skipping to change at line 78
/* /*
* Due to DWARF weirdness, this can be shared between multiple BPatch_modul es. * Due to DWARF weirdness, this can be shared between multiple BPatch_modul es.
* So we reference-count to make life easier. * So we reference-count to make life easier.
*/ */
class typeCollection : public Serializable//, public AnnotatableSparse class typeCollection : public Serializable//, public AnnotatableSparse
{ {
friend class Symtab; friend class Symtab;
friend class Object; friend class Object;
friend class Module; friend class Module;
friend class Type; friend class Type;
friend class DwarfWalker;
dyn_hash_map<std::string, Type *> typesByName; dyn_hash_map<std::string, Type *> typesByName;
dyn_hash_map<std::string, Type *> globalVarsByName; dyn_hash_map<std::string, Type *> globalVarsByName;
dyn_hash_map<int, Type *> typesByID; dyn_hash_map<int, Type *> typesByID;
// DWARF: // DWARF:
/* Cache type collections on a per-image basis. (Since /* Cache type collections on a per-image basis. (Since
BPatch_functions are solitons, we don't have to cache them.) */ BPatch_functions are solitons, we don't have to cache them.) */
static dyn_hash_map< void *, typeCollection * > fileToTypesMap; static dyn_hash_map< void *, typeCollection * > fileToTypesMap;
//static dyn_hash_map<int, std::vector<std::pair<dataClass, Type **> > > deferred_lookups; //static dyn_hash_map<int, std::vector<std::pair<dataClass, Type **> > > deferred_lookups;
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added


 Function.h   Function.h 
skipping to change at line 81 skipping to change at line 81
/***** IA64-Specific Frame Pointer Information *****/ /***** IA64-Specific Frame Pointer Information *****/
SYMTAB_EXPORT bool setFramePtrRegnum(int regnum); SYMTAB_EXPORT bool setFramePtrRegnum(int regnum);
SYMTAB_EXPORT int getFramePtrRegnum() const; SYMTAB_EXPORT int getFramePtrRegnum() const;
/***** PPC64 Linux Specific Information *****/ /***** PPC64 Linux Specific Information *****/
SYMTAB_EXPORT Offset getPtrOffset() const; SYMTAB_EXPORT Offset getPtrOffset() const;
SYMTAB_EXPORT Offset getTOCOffset() const; SYMTAB_EXPORT Offset getTOCOffset() const;
/***** Frame Pointer Information *****/ /***** Frame Pointer Information *****/
SYMTAB_EXPORT bool setFramePtr(std::vector<VariableLocation> *locs); SYMTAB_EXPORT bool setFramePtr(std::vector<VariableLocation> *locs);
SYMTAB_EXPORT std::vector<VariableLocation> &getFramePtrRefForInit();
SYMTAB_EXPORT std::vector<VariableLocation> &getFramePtr(); SYMTAB_EXPORT std::vector<VariableLocation> &getFramePtr();
/***** Local Variable Information *****/ /***** Local Variable Information *****/
SYMTAB_EXPORT bool findLocalVariable(std::vector<localVar *>&vars, std:: string name); SYMTAB_EXPORT bool findLocalVariable(std::vector<localVar *>&vars, std:: string name);
SYMTAB_EXPORT bool getLocalVariables(std::vector<localVar *>&vars); SYMTAB_EXPORT bool getLocalVariables(std::vector<localVar *>&vars);
SYMTAB_EXPORT bool getParams(std::vector<localVar *>&params); SYMTAB_EXPORT bool getParams(std::vector<localVar *>&params);
SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *sb, SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *sb,
const char *tag = "Function") THROW_SPEC (S erializerError); const char *tag = "Function") THROW_SPEC (S erializerError);
SYMTAB_EXPORT unsigned getSize(); SYMTAB_EXPORT unsigned getSize();
SYMTAB_EXPORT bool operator==(const Function &); SYMTAB_EXPORT bool operator==(const Function &);
/* internal helper functions */ /* internal helper functions */
bool addLocalVar(localVar *); bool addLocalVar(localVar *);
bool addParam(localVar *); bool addParam(localVar *);
bool setupParams(); bool setupParams();
private: private:
void expandLocation(const VariableLocation &loc,
std::vector<VariableLocation> &ret);
Type *retType_; Type *retType_;
int framePtrRegNum_; int framePtrRegNum_;
std::vector<VariableLocation> *locs_; std::vector<VariableLocation> frameBase_;
bool frameBaseExpanded_;
unsigned functionSize_; unsigned functionSize_;
}; };
} }
} }
#endif #endif
 End of changes. 3 change blocks. 
2 lines changed or deleted 6 lines changed or added


 Generator.h   Generator.h 
skipping to change at line 60 skipping to change at line 60
class Process; class Process;
class ArchEvent; class ArchEvent;
class Event; class Event;
class Mailbox; class Mailbox;
class PC_EXPORT Generator class PC_EXPORT Generator
{ {
public: public:
static Generator *getDefaultGenerator(); static Generator *getDefaultGenerator();
static void stopDefaultGenerator(); static void stopDefaultGenerator();
static bool startedAnyGenerator;
virtual bool getAndQueueEvent(bool block) = 0; virtual bool getAndQueueEvent(bool block) = 0;
virtual ~Generator(); virtual ~Generator();
typedef void (*gen_cb_func_t)(); typedef void (*gen_cb_func_t)();
static void registerNewEventCB(gen_cb_func_t func); static void registerNewEventCB(gen_cb_func_t func);
static void removeNewEventCB(gen_cb_func_t); static void removeNewEventCB(gen_cb_func_t);
void forceEventBlock();
//State tracking //State tracking
typedef enum { typedef enum {
none, none,
initializing, initializing,
process_blocked, process_blocked,
system_blocked, system_blocked,
decoding, decoding,
statesync, statesync,
handling, handling,
queueing, queueing,
skipping to change at line 119 skipping to change at line 122
virtual ArchEvent *getEvent(bool block) = 0; virtual ArchEvent *getEvent(bool block) = 0;
virtual bool plat_skipGeneratorBlock(); virtual bool plat_skipGeneratorBlock();
// Implemented by MT or ST // Implemented by MT or ST
virtual bool processWait(bool block) = 0; virtual bool processWait(bool block) = 0;
virtual bool plat_continue(ArchEvent* /*evt*/) { return true; } virtual bool plat_continue(ArchEvent* /*evt*/) { return true; }
virtual void wake(Dyninst::PID/* proc */, long long /* sequence */) {} virtual void wake(Dyninst::PID/* proc */, long long /* sequence */) {}
// Optional interface for systems that want to return multiple events // Optional interface for systems that want to return multiple events
virtual bool getMultiEvent(bool block, std::vector<ArchEvent *> &events) ; virtual bool getMultiEvent(bool block, std::vector<ArchEvent *> &events) ;
private:
bool eventBlock_;
}; };
class PC_EXPORT GeneratorMT : public Generator class PC_EXPORT GeneratorMT : public Generator
{ {
private: private:
GeneratorMTInternals *sync; GeneratorMTInternals *sync;
void main(); void main();
protected: protected:
void lock(); void lock();
void unlock(); void unlock();
 End of changes. 3 change blocks. 
0 lines changed or deleted 6 lines changed or added


 InstructionCategories.h   InstructionCategories.h 
skipping to change at line 48 skipping to change at line 48
{ {
namespace InstructionAPI namespace InstructionAPI
{ {
enum InsnCategory enum InsnCategory
{ {
c_CallInsn, c_CallInsn,
c_ReturnInsn, c_ReturnInsn,
c_BranchInsn, c_BranchInsn,
c_CompareInsn, c_CompareInsn,
c_PrefetchInsn, c_PrefetchInsn,
c_SysEnterInsn,
c_NoCategory c_NoCategory
}; };
INSTRUCTION_EXPORT InsnCategory entryToCategory(entryID e); INSTRUCTION_EXPORT InsnCategory entryToCategory(entryID e);
} }
} }
#endif //!defined(INSTRUCTION_CATEGORIES_H) #endif //!defined(INSTRUCTION_CATEGORIES_H)
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 Location.h   Location.h 
skipping to change at line 156 skipping to change at line 156
if (!func->contains(block)) return false; if (!func->contains(block)) return false;
getInsnInstances(block, insns); getInsnInstances(block, insns);
for (InsnVec::iterator iter = insns.begin(); iter != insns.end(); ++iter) for (InsnVec::iterator iter = insns.begin(); iter != insns.end(); ++iter)
if (iter->second == offset) return t rue; if (iter->second == offset) return t rue;
return false; return false;
case edge_:{ case edge_:{
Function::blocklist &blk = func->blocks(); Function::blocklist &blk = func->blocks();
for (Function::blocklist::iterator blockIter = blk.begin(); blockIter != blk.end(); ++blockIter){ for (Function::blocklist::iterator blockIter = blk.begin(); blockIter != blk.end(); ++blockIter){
Intraproc epred; Intraproc epred;
const Block::edgelist& target_edges = (*blockIter) -> targets(); const Block::edgelist& target_edges = (*blockIter) -> targets();
Block::edgelist::iterator eit = targ if(std::find(boost::make_filter_iter
et_edges.begin(&epred); ator(epred, target_edges.begin(), target_edges.end()),
for( ; eit != target_edges.end(); ++ boost::make_filter_iter
eit) { ator(epred, target_edges.end(), target_edges.end()),
if ((*eit) == edge) return t edge)
rue; != boost::make_filter_iterator(ep
red, target_edges.end(), target_edges.end()))
{
return true;
} }
} }
return false; return false;
} }
case instruction_: case instruction_:
getInsnInstances(block, insns); getInsnInstances(block, insns);
for (InsnVec::iterator iter = insns.begin(); iter != insns.end(); ++iter) for (InsnVec::iterator iter = insns.begin(); iter != insns.end(); ++iter)
if (iter->second == offset) return t rue; if (iter->second == offset) return t rue;
return false; return false;
case function_: case function_:
 End of changes. 1 change blocks. 
6 lines changed or deleted 9 lines changed or added


 Module.h   Module.h 
skipping to change at line 135 skipping to change at line 135
SYMTAB_EXPORT supportedLanguages language() const; SYMTAB_EXPORT supportedLanguages language() const;
SYMTAB_EXPORT void setLanguage(supportedLanguages lang); SYMTAB_EXPORT void setLanguage(supportedLanguages lang);
SYMTAB_EXPORT Offset addr() const; SYMTAB_EXPORT Offset addr() const;
SYMTAB_EXPORT Symtab *exec() const; SYMTAB_EXPORT Symtab *exec() const;
SYMTAB_EXPORT bool isShared() const; SYMTAB_EXPORT bool isShared() const;
SYMTAB_EXPORT ~Module(); SYMTAB_EXPORT ~Module();
// Symbol output methods // Symbol output methods
SYMTAB_EXPORT virtual bool findSymbolByType(std::vector<Symbol *> &r SYMTAB_EXPORT virtual bool findSymbol(std::vector<Symbol *> &ret,
et, const std::string& name,
const std::string& name, Symbol::SymbolType sType = Sy
Symbol::SymbolType sType, mbol::ST_UNKNOWN,
NameType nameType = anyName, NameType nameType = anyName,
bool isRegex = false, bool isRegex = false,
bool checkCase = false); bool checkCase = false,
bool includeUndefined = false
);
SYMTAB_EXPORT virtual bool getAllSymbolsByType(std::vector<Symbol *> &ret, SYMTAB_EXPORT virtual bool getAllSymbolsByType(std::vector<Symbol *> &ret,
Symbol::SymbolType sType); Symbol::SymbolType sType);
SYMTAB_EXPORT virtual bool getAllSymbols(std::vector<Symbol *> &ret) ; SYMTAB_EXPORT virtual bool getAllSymbols(std::vector<Symbol *> &ret) ;
// Function based methods // Function based methods
SYMTAB_EXPORT bool getAllFunctions(std::vector<Function *>&ret); SYMTAB_EXPORT bool getAllFunctions(std::vector<Function *>&ret);
SYMTAB_EXPORT bool findFunctionByEntryOffset(Function *&ret, const O ffset offset); SYMTAB_EXPORT bool findFunctionByEntryOffset(Function *&ret, const O ffset offset);
SYMTAB_EXPORT bool findFunctionsByName(std::vector<Function *> &ret, const std::string& name, SYMTAB_EXPORT bool findFunctionsByName(std::vector<Function *> &ret, const std::string& name,
NameType nameType = anyName, NameType nameType = anyName,
bool isRegex = false, bool isRegex = false,
skipping to change at line 186 skipping to change at line 187
SYMTAB_EXPORT bool getSourceLines(std::vector<Statement *> &lines, SYMTAB_EXPORT bool getSourceLines(std::vector<Statement *> &lines,
Offset addressInRange); Offset addressInRange);
SYMTAB_EXPORT bool getSourceLines(std::vector<LineNoTuple> &lines, SYMTAB_EXPORT bool getSourceLines(std::vector<LineNoTuple> &lines,
Offset addressInRange); Offset addressInRange);
SYMTAB_EXPORT bool getStatements(std::vector<Statement *> &statements); SYMTAB_EXPORT bool getStatements(std::vector<Statement *> &statements);
SYMTAB_EXPORT LineInformation *getLineInformation(); SYMTAB_EXPORT LineInformation *getLineInformation();
SYMTAB_EXPORT bool hasLineInformation(); SYMTAB_EXPORT bool hasLineInformation();
SYMTAB_EXPORT bool setDefaultNamespacePrefix(std::string str); SYMTAB_EXPORT bool setDefaultNamespacePrefix(std::string str);
// Deprecated methods
SYMTAB_EXPORT virtual bool findSymbolByType(std::vector<Symbol *> &ret,
const std::string& name,
Symbol::SymbolType sType,
bool isMangled = false,
bool isRegex = false,
bool checkCase = false);
// Super secret private methods that aren't really private // Super secret private methods that aren't really private
SYMTAB_EXPORT typeCollection *getModuleTypesPrivate(); SYMTAB_EXPORT typeCollection *getModuleTypesPrivate();
private: private:
bool setLineInfo(Dyninst::SymtabAPI::LineInformation *lineInfo); bool setLineInfo(Dyninst::SymtabAPI::LineInformation *lineInfo);
std::string fileName_; // short file std::string fileName_; // short file
std::string fullName_; // full path to file std::string fullName_; // full path to file
supportedLanguages language_; supportedLanguages language_;
Offset addr_; // starting address of module Offset addr_; // starting address of module
 End of changes. 2 change blocks. 
15 lines changed or deleted 9 lines changed or added


 PCProcess.h   PCProcess.h 
skipping to change at line 63 skipping to change at line 63
class int_library; class int_library;
class int_thread; class int_thread;
class int_threadPool; class int_threadPool;
class int_registerPool; class int_registerPool;
class rpc_wrapper; class rpc_wrapper;
class int_iRPC; class int_iRPC;
class int_notify; class int_notify;
class HandlerPool; class HandlerPool;
class MTLock; class MTLock;
#define PC_VERSION_8_0_0
#define pc_const_cast boost::const_pointer_cast #define pc_const_cast boost::const_pointer_cast
namespace Dyninst { namespace Dyninst {
class SymbolReaderFactory; class SymbolReaderFactory;
namespace ProcControlAPI { namespace ProcControlAPI {
class Process; class Process;
class ThreadPool; class ThreadPool;
skipping to change at line 140 skipping to change at line 142
~Library(); ~Library();
public: public:
typedef boost::shared_ptr<Library> ptr; typedef boost::shared_ptr<Library> ptr;
typedef boost::shared_ptr<const Library> const_ptr; typedef boost::shared_ptr<const Library> const_ptr;
std::string getName() const; std::string getName() const;
Dyninst::Address getLoadAddress() const; Dyninst::Address getLoadAddress() const;
Dyninst::Address getDataLoadAddress() const; Dyninst::Address getDataLoadAddress() const;
Dyninst::Address getDynamicAddress() const; Dyninst::Address getDynamicAddress() const;
int_library *debug() const { return lib; } int_library *debug() const { return lib; }
bool isSharedLib() const;
void *getData() const; void *getData() const;
void setData(void *p) const; void setData(void *p) const;
}; };
class PC_EXPORT LibraryPool class PC_EXPORT LibraryPool
{ {
friend class ::int_process; friend class ::int_process;
friend class Dyninst::ProcControlAPI::Process; friend class Dyninst::ProcControlAPI::Process;
private: private:
skipping to change at line 425 skipping to change at line 428
bool runIRPCSync(IRPC::ptr irpc); bool runIRPCSync(IRPC::ptr irpc);
/** /**
* Post, run, and wait for an IRPC to complete * Post, run, and wait for an IRPC to complete
**/ **/
bool runIRPCAsync(IRPC::ptr irpc); bool runIRPCAsync(IRPC::ptr irpc);
/** /**
* Symbol access * Symbol access
**/ **/
SymbolReaderFactory *getDefaultSymbolReader(); void setSymbolReader(SymbolReaderFactory *reader) const;
SymbolReaderFactory *getSymbolReader() const;
static SymbolReaderFactory *getDefaultSymbolReader();
static void setDefaultSymbolReader(SymbolReaderFactory *reader);
/** /**
* Perform specific operations. Interface objects will only be returned * Perform specific operations. Interface objects will only be returned
* on appropriately supported platforms, others will return NULL. * on appropriately supported platforms, others will return NULL.
**/ **/
LibraryTracking *getLibraryTracking(); LibraryTracking *getLibraryTracking();
ThreadTracking *getThreadTracking(); ThreadTracking *getThreadTracking();
FollowFork *getFollowFork(); FollowFork *getFollowFork();
const LibraryTracking *getLibraryTracking() const; const LibraryTracking *getLibraryTracking() const;
const ThreadTracking *getThreadTracking() const; const ThreadTracking *getThreadTracking() const;
 End of changes. 3 change blocks. 
1 lines changed or deleted 7 lines changed or added


 ParseContainers.h   ParseContainers.h 
skipping to change at line 33 skipping to change at line 33
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef _ITERATORS_H_ #ifndef _ITERATORS_H_
#define _ITERATORS_H_ #define _ITERATORS_H_
#include <boost/iterator/filter_iterator.hpp>
#include <boost/type_traits.hpp>
#include <boost/function.hpp>
/* /*
* An iterator and a predicate interface, and a * An iterator and a predicate interface, and a
* ContainerWrapper that can provide a forward * ContainerWrapper that can provide a forward
* predicate iterator for any container that exports * predicate iterator for any container that exports
* a begin() and end() * a begin() and end()
*/ */
namespace Dyninst { namespace Dyninst {
namespace ParseAPI { namespace ParseAPI {
/*** a simple forward iterator ***/
template <
typename DERIVED,
typename VALUE,
typename REFERENCE = VALUE &
>
class iterator_base {
public:
DERIVED& operator++();
DERIVED operator++(int);
bool operator==(const DERIVED &) const;
bool operator!=(const DERIVED &) const;
REFERENCE operator*() const;
};
/*** A predicate interface ***/ /*** A predicate interface ***/
template < template <
typename DERIVED,
typename VALUE, typename VALUE,
typename REFERENCE = VALUE & typename REFERENCE = VALUE &
> >
class iterator_predicate { class iterator_predicate {
public: public:
bool operator()(REFERENCE) const; inline bool operator()(const REFERENCE o) const
};
// A default predicate type
template<typename V, typename R = V&>
class default_predicate
: public iterator_predicate<
default_predicate<V,R>,
V,
R
>
{ {
private: return pred_impl(o);
bool pred_impl(R) const { return true; } }
friend class iterator_predicate<default_predicate<V,R>,V,R>; virtual bool pred_impl(const REFERENCE) const
{
return true;
}
virtual ~iterator_predicate()
{
}
}; };
/*** Container wrapper and iterators for predicate containers ***/ /*** Container wrapper and iterators for predicate containers ***/
template <
typename CONTAINER,
typename VALUE,
typename REFERENCE,
typename PREDICATE
>
class ContainerWrapper;
template < template<typename ARG>
typename CONTAINER, struct true_predicate : iterator_predicate<ARG>
typename VALUE,
typename REFERENCE = VALUE &,
typename PREDICATE = class default_predicate<VALUE,REFERENCE>
>
class PredicateIterator
: public iterator_base<
PredicateIterator<CONTAINER,VALUE,REFERENCE,PREDICATE>,
VALUE,
REFERENCE
>
{ {
public: bool operator()(ARG)
typedef ContainerWrapper<CONTAINER,VALUE,REFERENCE,PREDICATE> wrapper_t {
; return true;
}
PredicateIterator() :
_m_cont(NULL),
_m_pred(NULL),
_m_init(false)
{ }
PredicateIterator(const wrapper_t * cw) :
_m_cont(cw),
_m_pred(NULL),
_m_cur(cw->_m_container.begin()),
_m_init(true)
{ }
PredicateIterator(const wrapper_t * cw, PREDICATE * p) :
_m_cont(cw),
_m_pred(p),
_m_cur(cw->_m_container.begin()),
_m_init(true)
{ }
private:
void increment();
REFERENCE dereference() const;
bool equal(PredicateIterator const& o) const;
bool uninit() const { return !_m_init; }
const wrapper_t * _m_cont;
PREDICATE * _m_pred;
typename CONTAINER::const_iterator _m_cur;
bool _m_init;
friend class iterator_base<PredicateIterator,VALUE,REFERENCE>;
}; };
#if 0
template < template <
typename CONTAINER, typename C,
typename VALUE, typename VALUE,
typename REFERENCE = VALUE &, typename REFERENCE = VALUE &,
typename PREDICATE = default_predicate<VALUE,REFERENCE> class PREDICATE = iterator_predicate<VALUE, REFERENCE>
> >
class ContainerWrapper class ContainerWrapper
{ {
private:
public: public:
typedef PredicateIterator<CONTAINER,VALUE,REFERENCE,PREDICATE> iterator ;
PARSER_EXPORT ContainerWrapper(CONTAINER & cont) : _m_container(cont) { typedef boost::filter_iterator<PREDICATE, typename boost::remove_const<C>:
} :type::iterator> iterator;
PARSER_EXPORT ~ContainerWrapper() { } typedef boost::filter_iterator<PREDICATE, typename boost::remove_const<C>:
:type::const_iterator> const_iterator;
iterator begin() const; PARSER_EXPORT ContainerWrapper(C & cont) : _m_container(cont) { }
iterator begin(PREDICATE * p) const; PARSER_EXPORT ~ContainerWrapper() { }
iterator const& end() const;
size_t size() const;
bool empty() const;
private:
CONTAINER const& _m_container;
iterator _m_end;
friend class PredicateIterator<CONTAINER,VALUE,REFERENCE,PREDICATE>; iterator begin()
}; {
return boost::make_filter_iterator<PREDICATE>(_m_container.begin(), _m_c
ontainer.end());
}
template <typename P>
boost::filter_iterator<P, typename boost::remove_const<C>::type::iterator>
begin(P * p)
{
return boost::make_filter_iterator(*p, _m_container.begin(), _m_containe
r.end());
}
iterator end()
{
return boost::make_filter_iterator<PREDICATE>(_m_container.end(), _m_con
tainer.end());
}
template <typename P>
boost::filter_iterator<P, typename boost::remove_const<C>::type::iterator>
end(P * p)
{
return boost::make_filter_iterator<>(*p, _m_container.end(), _m_containe
r.end());
}
const_iterator begin() const
{
return boost::make_filter_iterator<PREDICATE>(_m_container.begin(), _m_c
ontainer.end());
}
template <typename P>
boost::filter_iterator<P, typename boost::remove_const<C>::type::const_ite
rator>
begin(P * p) const
{
return boost::make_filter_iterator(*p, _m_container.begin(), _m_containe
r.end());
}
const_iterator end() const
{
return boost::make_filter_iterator<PREDICATE>(_m_container.end(), _m_con
tainer.end());
}
template <typename P>
boost::filter_iterator<P, typename boost::remove_const<C>::type::const_ite
rator>
end(P * p) const
{
return boost::make_filter_iterator(*p, _m_container.end(), _m_container.
end());
}
/*** implementation details ***/ size_t size() const;
bool empty() const;
private:
C & _m_container;
};
template<typename C,typename V,typename R,typename P> /*** implementation details ***/
inline PredicateIterator<C,V,R,P>
ContainerWrapper<C,V,R,P>::begin() const
{
return iterator(this);
}
template<typename C,typename V,typename R,typename P> template<typename C,typename V,typename R,typename P>
inline PredicateIterator<C,V,R,P>
ContainerWrapper<C,V,R,P>::begin(P * p) const
{
iterator ret(this,p);
if(ret != _m_end && !(*p)(*ret))
++ret;
return ret;
}
template<typename C,typename V,typename R,typename P>
inline PredicateIterator<C,V,R,P> const&
ContainerWrapper<C,V,R,P>::end() const
{
return _m_end;
}
template<typename C,typename V,typename R,typename P>
inline size_t inline size_t
ContainerWrapper<C,V,R,P>::size() const ContainerWrapper<C,V,R,P>::size() const
{ {
return _m_container.size(); return _m_container.size();
} }
template<typename C,typename V,typename R,typename P> template<typename C,typename V,typename R,typename P>
inline bool inline bool
ContainerWrapper<C,V,R,P>::empty() const ContainerWrapper<C,V,R,P>::empty() const
{ {
return _m_container.empty(); return _m_container.empty();
} }
#endif
template<typename C,typename V,typename R, typename P>
inline void PredicateIterator<C,V,R,P>::increment()
{
if(*this == _m_cont->end())
return;
do {
(void)++_m_cur;
} while(*this != _m_cont->end() && (_m_pred && !(*_m_pred)(*(*this))) )
;
}
template<typename C,typename V,typename R, typename P>
inline R PredicateIterator<C,V,R,P>::dereference() const
{
return *_m_cur;
}
template<typename C,typename V,typename R, typename P>
inline bool PredicateIterator<C,V,R,P>::equal(PredicateIterator const& o) c
onst
{
if(o.uninit() && uninit())
return true;
return (o.uninit() && _m_cur == _m_cont->_m_container.end()) ||
(uninit() && o._m_cur == o._m_cont->_m_container.end()) ||
(_m_cont == o._m_cont && _m_cur == o._m_cur);
}
/*** static binding implementation ***/ /*** static binding implementation ***/
template<typename DERIVED,typename VALUE,typename REFERENCE>
inline DERIVED& iterator_base<DERIVED,VALUE,REFERENCE>::operator++()
{
static_cast<DERIVED*>(this)->increment();
return *static_cast<DERIVED*>(this);
}
template<typename DERIVED,typename VALUE,typename REFERENCE>
inline DERIVED iterator_base<DERIVED,VALUE,REFERENCE>::operator++(int)
{
DERIVED copy(*static_cast<DERIVED*>(this));
static_cast<DERIVED*>(this)->increment();
return copy;
}
template<typename DERIVED,typename VALUE,typename REFERENCE>
inline bool iterator_base<DERIVED,VALUE,REFERENCE>::operator==(const DERIVE
D & o) const
{
return static_cast<const DERIVED*>(this)->equal(o);
}
template<typename DERIVED,typename VALUE,typename REFERENCE>
inline bool iterator_base<DERIVED,VALUE,REFERENCE>::operator!=(const DERIVE
D & o) const
{
return !static_cast<const DERIVED*>(this)->equal(o);
}
template<typename DERIVED,typename VALUE,typename REFERENCE>
inline REFERENCE iterator_base<DERIVED,VALUE,REFERENCE>::operator*() const
{
return static_cast<const DERIVED*>(this)->dereference();
}
template<typename DERIVED,typename VALUE,typename REFERENCE>
inline bool iterator_predicate<DERIVED,VALUE,REFERENCE>::operator()(REFEREN
CE o) const
{
return static_cast<const DERIVED*>(this)->pred_impl(o);
}
} }
} }
#endif #endif
 End of changes. 22 change blocks. 
195 lines changed or deleted 95 lines changed or added


 PatchCommon.h   PatchCommon.h 
skipping to change at line 103 skipping to change at line 103
typedef std::map<PatchBlock*, std::map<PatchFunction*, PatchFunction*> > Ca llModMap; typedef std::map<PatchBlock*, std::map<PatchFunction*, PatchFunction*> > Ca llModMap;
typedef std::set<ParseAPI::CodeObject*> CodeObjectSet; typedef std::set<ParseAPI::CodeObject*> CodeObjectSet;
typedef std::set<ParseAPI::CodeSource*> CodeSourceSet; typedef std::set<ParseAPI::CodeSource*> CodeSourceSet;
} }
} }
#if defined(_MSC_VER) #if defined(_MSC_VER)
#define patchapi_debug(...) #define patchapi_debug(...)
#else #else
// Get basename
#include <libgen.h>
#define patchapi_debug(...) do { \ #define patchapi_debug(...) do { \
if (getenv("DYNINST_DEBUG_PATCHAPI")) { \ if (getenv("DYNINST_DEBUG_PATCHAPI")) { \
const char* nodir = basename(__FILE__); \ const char* nodir = basename(__FILE__); \
fprintf(stderr, "%s [%d]: ", nodir, __LINE__); \ fprintf(stderr, "%s [%d]: ", nodir, __LINE__); \
fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \ fprintf(stderr, "\n"); \
fflush(stderr); \ fflush(stderr); \
} \ } \
else {}; \ else {}; \
} while(0) } while(0)
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 PatchObject.h   PatchObject.h 
skipping to change at line 70 skipping to change at line 70
PATCHAPI_EXPORT virtual ~PatchObject(); PATCHAPI_EXPORT virtual ~PatchObject();
typedef std::vector<PatchFunction *> funclist; typedef std::vector<PatchFunction *> funclist;
typedef std::map<const ParseAPI::Function*, PatchFunction*> FuncMap; typedef std::map<const ParseAPI::Function*, PatchFunction*> FuncMap;
typedef std::map<const ParseAPI::Block*, PatchBlock*> BlockMap; typedef std::map<const ParseAPI::Block*, PatchBlock*> BlockMap;
typedef std::map<const ParseAPI::Edge*, PatchEdge*> EdgeMap; typedef std::map<const ParseAPI::Edge*, PatchEdge*> EdgeMap;
std::string format() const; std::string format() const;
// Getters and setter // Getters and setter
Address codeBase() { return codeBase_; } Address codeBase() const { return codeBase_; }
Address codeOffsetToAddr(Address offset) const;
Address addrMask() const;
ParseAPI::CodeObject* co() const { return co_; } ParseAPI::CodeObject* co() const { return co_; }
//ParseAPI::CodeSource* cs() const { return cs_; } //ParseAPI::CodeSource* cs() const { return cs_; }
AddrSpace* addrSpace() const { return addr_space_; } AddrSpace* addrSpace() const { return addr_space_; }
void setAddrSpace(AddrSpace* as); void setAddrSpace(AddrSpace* as);
PatchMgrPtr mgr() const; PatchMgrPtr mgr() const;
// Function // Function
PATCHAPI_EXPORT PatchFunction *getFunc(ParseAPI::Function *, bool creat e = true); PATCHAPI_EXPORT PatchFunction *getFunc(ParseAPI::Function *, bool creat e = true);
PATCHAPI_EXPORT void addFunc(PatchFunction*); PATCHAPI_EXPORT void addFunc(PatchFunction*);
PATCHAPI_EXPORT void removeFunc(PatchFunction*); PATCHAPI_EXPORT void removeFunc(PatchFunction*);
 End of changes. 1 change blocks. 
1 lines changed or deleted 3 lines changed or added


 PlatFeatures.h   PlatFeatures.h 
skipping to change at line 45 skipping to change at line 45
#include <vector> #include <vector>
#include <string> #include <string>
#if !defined(PROCESSPLAT_H_) #if !defined(PROCESSPLAT_H_)
#define PROCESSPLAT_H_ #define PROCESSPLAT_H_
class int_process; class int_process;
class sysv_process; class sysv_process;
class thread_db_process; class thread_db_process;
class linux_process; class linux_process;
namespace bgq {
class bgq_process;
};
namespace Dyninst { namespace Dyninst {
namespace ProcControlAPI { namespace ProcControlAPI {
class PC_EXPORT LibraryTracking class PC_EXPORT LibraryTracking
{ {
friend class ::sysv_process; friend class ::sysv_process;
protected: protected:
LibraryTracking(Process::ptr proc_); LibraryTracking(Process::ptr proc_);
~LibraryTracking(); ~LibraryTracking();
Process::weak_ptr proc; Process::weak_ptr proc;
skipping to change at line 179 skipping to change at line 181
class PC_EXPORT CallStackUnwindingSet class PC_EXPORT CallStackUnwindingSet
{ {
private: private:
ThreadSet::weak_ptr wts; ThreadSet::weak_ptr wts;
public: public:
CallStackUnwindingSet(ThreadSet::ptr ts); CallStackUnwindingSet(ThreadSet::ptr ts);
~CallStackUnwindingSet(); ~CallStackUnwindingSet();
bool walkStack(CallStackCallback *stk_cb); bool walkStack(CallStackCallback *stk_cb);
}; };
class PC_EXPORT MultiToolControl
{
friend class bgq::bgq_process;
public:
typedef unsigned int priority_t;
private:
Process::weak_ptr proc;
protected:
MultiToolControl(Process::ptr p);
~MultiToolControl();
static std::string default_tool_name;
static priority_t default_tool_priority;
public:
static void setDefaultToolName(std::string name);
static void setDefaultToolPriority(priority_t p);
static std::string getDefaultToolName();
static priority_t getDefaultToolPriority();
//Tool name and priority cannot be changed after process creation.
//To set these values, use the static methods to set the default,
// values, then trigger your attach/create operation.
std::string getToolName() const;
priority_t getToolPriority() const;
};
#if 0 #if 0
//TO BE IMPLEMENTED //TO BE IMPLEMENTED
#if defined(_MSC_VER) #if defined(_MSC_VER)
typedef void* stat_ret_t; typedef void* stat_ret_t;
#else #else
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
typedef struct stat stat_ret_t; typedef struct stat stat_ret_t;
 End of changes. 2 change blocks. 
1 lines changed or deleted 28 lines changed or added


 ProcReader.h   ProcReader.h 
skipping to change at line 35 skipping to change at line 35
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#if !defined(PROCREADER_H_) #if !defined(PROCREADER_H_)
#define PROCREADER_H_ #define PROCREADER_H_
#include "dyntypes.h" #include "dyntypes.h"
#include "dyn_regs.h"
namespace Dyninst { namespace Dyninst {
class ProcessReader { class ProcessReader {
public: public:
virtual bool start() = 0; virtual bool start() = 0;
virtual bool isAsync() { return false; } virtual bool isAsync() { return false; }
virtual bool ReadMem(Dyninst::Address addr, void *buffer, unsigned size) virtual bool ReadMem(Address addr, void *buffer, unsigned size) = 0;
= 0; virtual bool GetReg(MachRegister reg, MachRegisterVal &val) = 0;
virtual bool GetReg(Dyninst::MachRegister reg, Dyninst::MachRegisterVal
&val) = 0;
virtual bool done() = 0; virtual bool done() = 0;
virtual ~ProcessReader() {} virtual ~ProcessReader() {}
}; };
} }
#endif #endif
 End of changes. 2 change blocks. 
4 lines changed or deleted 3 lines changed or added


 Region.h   Region.h 
skipping to change at line 42 skipping to change at line 42
#define __REGION__H__ #define __REGION__H__
#include "Serialization.h" #include "Serialization.h"
#include "symutil.h" #include "symutil.h"
#include "Annotatable.h" #include "Annotatable.h"
namespace Dyninst{ namespace Dyninst{
namespace SymtabAPI{ namespace SymtabAPI{
class Symbol; class Symbol;
class relocationEntry; class relocationEntry;
class Symtab;
class Region : public AnnotatableSparse { class Region : public AnnotatableSparse {
friend class Object; friend class Object;
friend class Symtab; friend class Symtab;
friend class SymtabTranslatorBase; friend class SymtabTranslatorBase;
friend class SymtabTranslatorBin; friend class SymtabTranslatorBin;
public: public:
enum perm_t enum perm_t
skipping to change at line 101 skipping to change at line 102
SYMTAB_EXPORT Region& operator=(const Region &reg); SYMTAB_EXPORT Region& operator=(const Region &reg);
SYMTAB_EXPORT std::ostream& operator<< (std::ostream &os); SYMTAB_EXPORT std::ostream& operator<< (std::ostream &os);
SYMTAB_EXPORT bool operator== (const Region &reg); SYMTAB_EXPORT bool operator== (const Region &reg);
SYMTAB_EXPORT ~Region(); SYMTAB_EXPORT ~Region();
SYMTAB_EXPORT unsigned getRegionNumber() const; SYMTAB_EXPORT unsigned getRegionNumber() const;
SYMTAB_EXPORT bool setRegionNumber(unsigned regnumber); SYMTAB_EXPORT bool setRegionNumber(unsigned regnumber);
SYMTAB_EXPORT std::string getRegionName() const; SYMTAB_EXPORT std::string getRegionName() const;
// getRegionAddr returns diskOffset on unixes, memory offset on windows
SYMTAB_EXPORT Offset getRegionAddr() const;
SYMTAB_EXPORT Offset getDiskOffset() const; SYMTAB_EXPORT Offset getDiskOffset() const;
SYMTAB_EXPORT unsigned long getDiskSize() const; SYMTAB_EXPORT unsigned long getDiskSize() const;
SYMTAB_EXPORT unsigned long getFileOffset(); SYMTAB_EXPORT unsigned long getFileOffset();
SYMTAB_EXPORT Offset getMemOffset() const; SYMTAB_EXPORT Offset getMemOffset() const;
SYMTAB_EXPORT unsigned long getMemSize() const; SYMTAB_EXPORT unsigned long getMemSize() const;
SYMTAB_EXPORT unsigned long getMemAlignment() const; SYMTAB_EXPORT unsigned long getMemAlignment() const;
SYMTAB_EXPORT void setMemOffset(Offset); SYMTAB_EXPORT void setMemOffset(Offset);
SYMTAB_EXPORT void setMemSize(unsigned long); SYMTAB_EXPORT void setMemSize(unsigned long);
SYMTAB_EXPORT void setDiskSize(unsigned long); SYMTAB_EXPORT void setDiskSize(unsigned long);
skipping to change at line 143 skipping to change at line 141
SYMTAB_EXPORT RegionType getRegionType() const; SYMTAB_EXPORT RegionType getRegionType() const;
SYMTAB_EXPORT bool addRelocationEntry(Offset relocationAddr, Symbol *dyn ref, unsigned long relType, Region::RegionType rtype = Region::RT_REL); SYMTAB_EXPORT bool addRelocationEntry(Offset relocationAddr, Symbol *dyn ref, unsigned long relType, Region::RegionType rtype = Region::RT_REL);
SYMTAB_EXPORT bool addRelocationEntry(const relocationEntry& rel); SYMTAB_EXPORT bool addRelocationEntry(const relocationEntry& rel);
SYMTAB_EXPORT bool updateRelocations(Address start, Address end, Symbol *oldsym, Symbol *newsym); SYMTAB_EXPORT bool updateRelocations(Address start, Address end, Symbol *oldsym, Symbol *newsym);
SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *sb, SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *sb,
const char *tag = "Region") THROW_SPEC (SerializerError); const char *tag = "Region") THROW_SPEC (SerializerError);
SYMTAB_EXPORT Symtab *symtab() const { return symtab_; }
protected: protected:
SYMTAB_EXPORT Region(unsigned regnum, std::string name, Offset diskOff, SYMTAB_EXPORT Region(unsigned regnum, std::string name, Offset diskOff,
unsigned long diskSize, Offset memOff, unsigned long memSize, unsigned long diskSize, Offset memOff, unsigned long
char *rawDataPtr, perm_t perms, RegionType regType, bool isLoadabl memSize,
e = false, char *rawDataPtr, perm_t perms, RegionType regType,
bool isTLS = false, unsigned long memAlign = sizeof(unsigned)); bool isLoadable = false,
bool isTLS = false, unsigned long memAlign = sizeof(
unsigned));
void setSymtab(Symtab *sym) { symtab_ = sym; }
private: private:
unsigned regNum_; unsigned regNum_;
std::string name_; std::string name_;
Offset diskOff_; Offset diskOff_;
unsigned long diskSize_; unsigned long diskSize_;
Offset memOff_; Offset memOff_;
unsigned long memSize_; unsigned long memSize_;
Offset fileOff_; Offset fileOff_;
void *rawDataPtr_; void *rawDataPtr_;
perm_t permissions_; perm_t permissions_;
RegionType rType_; RegionType rType_;
bool isDirty_; bool isDirty_;
std::vector<relocationEntry> rels_; std::vector<relocationEntry> rels_;
char *buffer_; //To hold dirty data char *buffer_; //To hold dirty data
bool isLoadable_; bool isLoadable_;
bool isTLS_; bool isTLS_;
unsigned long memAlign_; unsigned long memAlign_;
Symtab *symtab_;
}; };
}//namespace SymtabAPI }//namespace SymtabAPI
}//namespace Dyninst }//namespace Dyninst
#endif #endif
 End of changes. 5 change blocks. 
7 lines changed or deleted 10 lines changed or added


 SymReader.h   SymReader.h 
skipping to change at line 107 skipping to change at line 107
virtual Section_t getSectionByName(std::string name) = 0; virtual Section_t getSectionByName(std::string name) = 0;
virtual Section_t getSectionByAddress(Dyninst::Address addr) = 0; virtual Section_t getSectionByAddress(Dyninst::Address addr) = 0;
virtual Dyninst::Address getSectionAddress(Section_t sec) = 0; virtual Dyninst::Address getSectionAddress(Section_t sec) = 0;
virtual std::string getSectionName(Section_t sec) = 0; virtual std::string getSectionName(Section_t sec) = 0;
virtual bool isValidSection(Section_t sec) = 0; virtual bool isValidSection(Section_t sec) = 0;
virtual Dyninst::Offset imageOffset() = 0; virtual Dyninst::Offset imageOffset() = 0;
virtual Dyninst::Offset dataOffset() = 0; virtual Dyninst::Offset dataOffset() = 0;
virtual void *getElfHandle() { return NULL; } virtual void *getElfHandle() { return NULL; }
virtual int getFD()
{
return 0;
}
}; };
class COMMON_EXPORT SymbolReaderFactory class COMMON_EXPORT SymbolReaderFactory
{ {
public: public:
SymbolReaderFactory() {} SymbolReaderFactory() {}
virtual ~SymbolReaderFactory() {} virtual ~SymbolReaderFactory() {}
virtual SymReader *openSymbolReader(std::string pathname) = 0; virtual SymReader *openSymbolReader(std::string pathname) = 0;
virtual SymReader *openSymbolReader(const char *buffer, unsigned long si ze) = 0; virtual SymReader *openSymbolReader(const char *buffer, unsigned long si ze) = 0;
virtual bool closeSymbolReader(SymReader *sr) = 0; virtual bool closeSymbolReader(SymReader *sr) = 0;
 End of changes. 1 change blocks. 
0 lines changed or deleted 5 lines changed or added


 Symbol.h   Symbol.h 
skipping to change at line 214 skipping to change at line 214
SYMTAB_EXPORT void setVersionHidden() { versionHidden_ = true; } SYMTAB_EXPORT void setVersionHidden() { versionHidden_ = true; }
SYMTAB_EXPORT bool getVersionFileName(std::string &fileName); SYMTAB_EXPORT bool getVersionFileName(std::string &fileName);
SYMTAB_EXPORT bool getVersions(std::vector<std::string> *&vers); SYMTAB_EXPORT bool getVersions(std::vector<std::string> *&vers);
SYMTAB_EXPORT bool getVersionNum(unsigned &verNum); SYMTAB_EXPORT bool getVersionNum(unsigned &verNum);
SYMTAB_EXPORT bool getVersionHidden() { return versionHidden_; } SYMTAB_EXPORT bool getVersionHidden() { return versionHidden_; }
friend friend
std::ostream& operator<< (std::ostream &os, const Symbol &s); std::ostream& operator<< (std::ostream &os, const Symbol &s);
//////////// DEPRECATED
SYMTAB_EXPORT Region *getSec () const { r
eturn getRegion(); }
SYMTAB_EXPORT Offset getAddr () const { return g
etOffset(); }
SYMTAB_EXPORT const std::string&getModuleName () const;
SYMTAB_EXPORT const std::string &getName() const { return getMangledName
(); }
SYMTAB_EXPORT bool setAddr (Offset newAddr) { return setOffset(newAddr);
}
SYMTAB_EXPORT bool setModuleName(std::string) { return false; }
public: public:
static std::string emptyString; static std::string emptyString;
int getInternalType() { return internal_type_; } int getInternalType() { return internal_type_; }
void setInternalType(int i) { internal_type_ = i; } void setInternalType(int i) { internal_type_ = i; }
private: private:
Module* module_; Module* module_;
SymbolType type_; SymbolType type_;
int internal_type_; int internal_type_;
skipping to change at line 275 skipping to change at line 267
SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *, SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *,
const char *tag = "Symbol") THROW_SPEC (SerializerError); const char *tag = "Symbol") THROW_SPEC (SerializerError);
}; };
class LookupInterface class LookupInterface
{ {
public: public:
SYMTAB_EXPORT LookupInterface(); SYMTAB_EXPORT LookupInterface();
SYMTAB_EXPORT virtual bool getAllSymbolsByType(std::vector<Symbol *> &ret, SYMTAB_EXPORT virtual bool getAllSymbolsByType(std::vector<Symbol *> &ret,
Symbol::SymbolType sType) = 0; Symbol::SymbolType sType) = 0;
SYMTAB_EXPORT virtual bool findSymbolByType(std::vector<Symbol *> &re SYMTAB_EXPORT virtual bool findSymbol(std::vector<Symbol *> &ret,
t, const std::string& name,
const std::string& name, Symbol::SymbolType sType = Symb
Symbol::SymbolType sType, ol::ST_UNKNOWN,
bool isMangled = false, NameType nameType = anyName,
bool isRegex = false, bool isRegex = false,
bool checkCase = false) = 0; bool checkCase = false,
bool includeUndefined = false)
= 0;
SYMTAB_EXPORT virtual bool findType(Type *&type, std::string name) = 0; SYMTAB_EXPORT virtual bool findType(Type *&type, std::string name) = 0;
SYMTAB_EXPORT virtual bool findVariableType(Type *&type, std::string name)= 0; SYMTAB_EXPORT virtual bool findVariableType(Type *&type, std::string name)= 0;
SYMTAB_EXPORT virtual ~LookupInterface(); SYMTAB_EXPORT virtual ~LookupInterface();
}; };
std::ostream& operator<< (std::ostream &os, const Symbol &s); std::ostream& operator<< (std::ostream &os, const Symbol &s);
}//namespace SymtabAPI }//namespace SymtabAPI
}//namespace Dyninst }//namespace Dyninst
 End of changes. 2 change blocks. 
19 lines changed or deleted 9 lines changed or added


 Symtab.h   Symtab.h 
skipping to change at line 54 skipping to change at line 54
#include "boost/shared_ptr.hpp" #include "boost/shared_ptr.hpp"
class MappedFile; class MappedFile;
#define SYM_MAJOR 6 #define SYM_MAJOR 6
#define SYM_MINOR 2 #define SYM_MINOR 2
#define SYM_BETA 1 #define SYM_BETA 1
namespace Dyninst { namespace Dyninst {
namespace Dwarf {
class DwarfFrameParser;
typedef boost::shared_ptr<DwarfFrameParser> DwarfFrameParserPtr;
}
namespace SymtabAPI { namespace SymtabAPI {
class Archive; class Archive;
class builtInTypeCollection; class builtInTypeCollection;
class ExceptionBlock; class ExceptionBlock;
class Object; class Object;
class localVar; class localVar;
class relocationEntry; class relocationEntry;
class Type; class Type;
skipping to change at line 87 skipping to change at line 93
friend class Region; friend class Region;
friend class emitElf; friend class emitElf;
friend class emitElf64; friend class emitElf64;
friend class emitElfStatic; friend class emitElfStatic;
friend class emitWin; friend class emitWin;
friend class Aggregate; friend class Aggregate;
friend class relocationEntry; friend class relocationEntry;
public: public:
/**** DEBUG *****/
Dwarf::DwarfFrameParserPtr debugDwarf();
/***** Public Member Functions *****/ /***** Public Member Functions *****/
public: public:
SYMTAB_EXPORT static void version(int& major, int& minor, int& maintenan ce); SYMTAB_EXPORT static void version(int& major, int& minor, int& maintenan ce);
SYMTAB_EXPORT Symtab(MappedFile *); SYMTAB_EXPORT Symtab(MappedFile *);
SYMTAB_EXPORT Symtab(); SYMTAB_EXPORT Symtab();
SYMTAB_EXPORT Symtab(const Symtab& obj); SYMTAB_EXPORT Symtab(const Symtab& obj);
SYMTAB_EXPORT Symtab(unsigned char *mem_image, size_t image_size, SYMTAB_EXPORT Symtab(unsigned char *mem_image, size_t image_size,
const std::string &name, bool defensive_binary, boo l &err); const std::string &name, bool defensive_binary, boo l &err);
skipping to change at line 325 skipping to change at line 334
// SYMTAB_EXPORT char* data_ptr () const; // SYMTAB_EXPORT char* data_ptr () const;
SYMTAB_EXPORT Offset getInitOffset(); SYMTAB_EXPORT Offset getInitOffset();
SYMTAB_EXPORT Offset getFiniOffset(); SYMTAB_EXPORT Offset getFiniOffset();
SYMTAB_EXPORT const char* getInterpreterName() const; SYMTAB_EXPORT const char* getInterpreterName() const;
SYMTAB_EXPORT unsigned getAddressWidth() const; SYMTAB_EXPORT unsigned getAddressWidth() const;
SYMTAB_EXPORT Offset getLoadOffset() const; SYMTAB_EXPORT Offset getLoadOffset() const;
SYMTAB_EXPORT Offset getEntryOffset() const; SYMTAB_EXPORT Offset getEntryOffset() const;
SYMTAB_EXPORT Offset getBaseOffset() const; SYMTAB_EXPORT Offset getBaseOffset() const;
SYMTAB_EXPORT Offset getTOCoffset() const; SYMTAB_EXPORT Offset getTOCoffset(Function *func = NULL) const;
SYMTAB_EXPORT Offset getTOCoffset(Offset off) const;
SYMTAB_EXPORT Address getLoadAddress(); SYMTAB_EXPORT Address getLoadAddress();
SYMTAB_EXPORT bool isDefensiveBinary() const; SYMTAB_EXPORT bool isDefensiveBinary() const;
SYMTAB_EXPORT Offset fileToDiskOffset(Dyninst::Offset) const; SYMTAB_EXPORT Offset fileToDiskOffset(Dyninst::Offset) const;
SYMTAB_EXPORT Offset fileToMemOffset(Dyninst::Offset) const; SYMTAB_EXPORT Offset fileToMemOffset(Dyninst::Offset) const;
SYMTAB_EXPORT std::string getDefaultNamespacePrefix() const; SYMTAB_EXPORT std::string getDefaultNamespacePrefix() const;
SYMTAB_EXPORT unsigned getNumberofRegions() const; SYMTAB_EXPORT unsigned getNumberofRegions() const;
SYMTAB_EXPORT unsigned getNumberofSymbols() const; SYMTAB_EXPORT unsigned getNumberofSymbols() const;
skipping to change at line 365 skipping to change at line 375
/***** Private Member Functions *****/ /***** Private Member Functions *****/
private: private:
SYMTAB_EXPORT Symtab(std::string filename, bool defensive_bin, bool &err ); SYMTAB_EXPORT Symtab(std::string filename, bool defensive_bin, bool &err );
SYMTAB_EXPORT bool extractInfo(Object *linkedFile); SYMTAB_EXPORT bool extractInfo(Object *linkedFile);
// Parsing code // Parsing code
bool extractSymbolsFromFile(Object *linkedFile, std::vector<Symbol *> &r aw_syms); bool extractSymbolsFromFile(Object *linkedFile, std::vector<Symbol *> &r aw_syms);
bool fixSymRegion(Symbol *sym);
bool fixSymModules(std::vector<Symbol *> &raw_syms); bool fixSymModules(std::vector<Symbol *> &raw_syms);
bool demangleSymbols(std::vector<Symbol *> &rawsyms); bool demangleSymbols(std::vector<Symbol *> &rawsyms);
bool createIndices(std::vector<Symbol *> &raw_syms, bool undefined); bool createIndices(std::vector<Symbol *> &raw_syms, bool undefined);
bool createAggregates(); bool createAggregates();
bool fixSymModule(Symbol *&sym); bool fixSymModule(Symbol *&sym);
bool demangleSymbol(Symbol *&sym); bool demangleSymbol(Symbol *&sym);
bool addSymbolToIndices(Symbol *&sym, bool undefined); bool addSymbolToIndices(Symbol *&sym, bool undefined);
bool addSymbolToAggregates(Symbol *&sym); bool addSymbolToAggregates(Symbol *&sym);
bool doNotAggregate(Symbol *&sym); bool doNotAggregate(Symbol *&sym);
skipping to change at line 423 skipping to change at line 436
void checkPPC64DescriptorSymbols(Object *linkedFile); void checkPPC64DescriptorSymbols(Object *linkedFile);
void parseLineInformation(); void parseLineInformation();
void parseTypes(); void parseTypes();
bool setDefaultNamespacePrefix(std::string &str); bool setDefaultNamespacePrefix(std::string &str);
bool addUserRegion(Region *newreg); bool addUserRegion(Region *newreg);
bool addUserType(Type *newtypeg); bool addUserType(Type *newtypeg);
void setTOCOffset(Offset offset);
/***** Private Data Members *****/ /***** Private Data Members *****/
private: private:
static boost::shared_ptr<typeCollection> setupStdTypes(); static boost::shared_ptr<typeCollection> setupStdTypes();
static boost::shared_ptr<builtInTypeCollection> setupBuiltinTypes(); static boost::shared_ptr<builtInTypeCollection> setupBuiltinTypes();
std::string member_name_; std::string member_name_;
Offset member_offset_; Offset member_offset_;
Archive * parentArchive_; Archive * parentArchive_;
MappedFile *mf; MappedFile *mf;
skipping to change at line 452 skipping to change at line 467
bool nativeCompiler; bool nativeCompiler;
unsigned address_width_; unsigned address_width_;
char *code_ptr_; char *code_ptr_;
char *data_ptr_; char *data_ptr_;
std::string interpreter_name_; std::string interpreter_name_;
Offset entry_address_; Offset entry_address_;
Offset base_address_; Offset base_address_;
Offset load_address_; Offset load_address_;
Offset toc_offset_;
ObjectType object_type_; ObjectType object_type_;
bool is_eel_; bool is_eel_;
std::vector<Segment> segments_; std::vector<Segment> segments_;
// make sure is_a_out is set before calling symbolsToFunctions // make sure is_a_out is set before calling symbolsToFunctions
// A std::vector of all Symtabs. Used to avoid duplicating // A std::vector of all Symtabs. Used to avoid duplicating
// a Symtab that already exists. // a Symtab that already exists.
static std::vector<Symtab *> allSymtabs; static std::vector<Symtab *> allSymtabs;
std::string defaultNamespacePrefix; std::string defaultNamespacePrefix;
skipping to change at line 598 skipping to change at line 612
// dynamic library name substitutions // dynamic library name substitutions
std::map <std::string, std::string> dynLibSubs; std::map <std::string, std::string> dynLibSubs;
public: public:
static boost::shared_ptr<Type> type_Error(); static boost::shared_ptr<Type> type_Error();
static boost::shared_ptr<Type> type_Untyped(); static boost::shared_ptr<Type> type_Untyped();
private: private:
unsigned _ref_cnt; unsigned _ref_cnt;
public:
/********************************************************************/
/**** DEPRECATED ****************************************************/
/********************************************************************/
dyn_hash_map <std::string, Module *> &getModsByFileName()
{
return modsByFileName;
}
dyn_hash_map <std::string, Module *> &getModsByFullName()
{
return modsByFullName;
}
SYMTAB_EXPORT bool findFuncByEntryOffset(std::vector<Symbol *>&ret, cons
t Offset offset);
SYMTAB_EXPORT virtual bool findSymbolByType(std::vector<Symbol *> &ret,
const std::string& name,
Symbol::SymbolType sType,
bool isMangled = false,
bool isRegex = false,
bool checkCase = false);
}; };
/** /**
* Used to represent something like a C++ try/catch block. * Used to represent something like a C++ try/catch block.
* Currently only used on Linux/x86 * Currently only used on Linux/x86
**/ **/
SYMTAB_EXPORT std::ostream &operator<<(std::ostream &os, const ExceptionBl ock &q); SYMTAB_EXPORT std::ostream &operator<<(std::ostream &os, const ExceptionBl ock &q);
class ExceptionBlock : public Serializable, public AnnotatableSparse { class ExceptionBlock : public Serializable, public AnnotatableSparse {
skipping to change at line 673 skipping to change at line 666
SYMTAB_EXPORT relocationEntry(Offset ta, Offset ra, Offset add, SYMTAB_EXPORT relocationEntry(Offset ta, Offset ra, Offset add,
std::string n, Symbol *dynref = NULL, unsigned lon g relType = 0); std::string n, Symbol *dynref = NULL, unsigned lon g relType = 0);
SYMTAB_EXPORT relocationEntry(Offset ta, Offset ra, std::string n, SYMTAB_EXPORT relocationEntry(Offset ta, Offset ra, std::string n,
Symbol *dynref = NULL, unsigned long relType = 0); Symbol *dynref = NULL, unsigned long relType = 0);
SYMTAB_EXPORT relocationEntry(Offset ra, std::string n, Symbol *dynre f = NULL, SYMTAB_EXPORT relocationEntry(Offset ra, std::string n, Symbol *dynre f = NULL,
unsigned long relType = 0, Region::RegionType rtyp e = Region::RT_REL); unsigned long relType = 0, Region::RegionType rtyp e = Region::RT_REL);
SYMTAB_EXPORT relocationEntry(Offset ta, Offset ra, Offset add, SYMTAB_EXPORT relocationEntry(Offset ta, Offset ra, Offset add,
std::string n, Symbol *dynref = NULL, unsigned lo ng relType = 0, std::string n, Symbol *dynref = NULL, unsigned lo ng relType = 0,
Region::RegionType rtype = Region::RT_REL); Region::RegionType rtype = Region::RT_REL);
SYMTAB_EXPORT const relocationEntry& operator= (const relocationEntry
&ra);
SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *sb, SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *sb,
const char *tag = "relocationEntry") THROW_SPEC (S erializerError); const char *tag = "relocationEntry") THROW_SPEC (S erializerError);
SYMTAB_EXPORT Offset target_addr() const; SYMTAB_EXPORT Offset target_addr() const;
SYMTAB_EXPORT Offset rel_addr() const; SYMTAB_EXPORT Offset rel_addr() const;
SYMTAB_EXPORT Offset addend() const; SYMTAB_EXPORT Offset addend() const;
SYMTAB_EXPORT Region::RegionType regionType() const; SYMTAB_EXPORT Region::RegionType regionType() const;
SYMTAB_EXPORT const std::string &name() const; SYMTAB_EXPORT const std::string &name() const;
SYMTAB_EXPORT Symbol *getDynSym() const; SYMTAB_EXPORT Symbol *getDynSym() const;
SYMTAB_EXPORT bool addDynSym(Symbol *dynref); SYMTAB_EXPORT bool addDynSym(Symbol *dynref);
SYMTAB_EXPORT unsigned long getRelType() const; SYMTAB_EXPORT unsigned long getRelType() const;
SYMTAB_EXPORT void setTargetAddr(const Offset); SYMTAB_EXPORT void setTargetAddr(const Offset);
SYMTAB_EXPORT void setRelAddr(const Offset); SYMTAB_EXPORT void setRelAddr(const Offset);
SYMTAB_EXPORT void setAddend(const Offset); SYMTAB_EXPORT void setAddend(const Offset);
SYMTAB_EXPORT void setRegionType(const Region::RegionType); SYMTAB_EXPORT void setRegionType(const Region::RegionType);
SYMTAB_EXPORT void setName(const std::string &newName); SYMTAB_EXPORT void setName(const std::string &newName);
SYMTAB_EXPORT void setRelType(unsigned long relType) { relType_ = rel Type; }
// dump output. Currently setup as a debugging aid, not really // dump output. Currently setup as a debugging aid, not really
// for object persistance.... // for object persistance....
//SYMTAB_EXPORT std::ostream & operator<<(std::ostream &s) const; //SYMTAB_EXPORT std::ostream & operator<<(std::ostream &s) const;
friend SYMTAB_EXPORT std::ostream &operator<<(std::ostream &os, const relocationEntry &q); friend SYMTAB_EXPORT std::ostream &operator<<(std::ostream &os, const relocationEntry &q);
enum {pltrel = 1, dynrel = 2} relocationType; enum {pltrel = 1, dynrel = 2} relocationType;
SYMTAB_EXPORT bool operator==(const relocationEntry &) const; SYMTAB_EXPORT bool operator==(const relocationEntry &) const;
// Architecture-specific functions // Architecture-specific functions
SYMTAB_EXPORT static unsigned long getGlobalRelType(unsigned addressW idth); SYMTAB_EXPORT static unsigned long getGlobalRelType(unsigned addressW idth, Symbol *sym = NULL);
static const char *relType2Str(unsigned long r, unsigned addressWidth = sizeof(Address)); static const char *relType2Str(unsigned long r, unsigned addressWidth = sizeof(Address));
private: private:
Offset target_addr_; // target address of call instruction Offset target_addr_; // target address of call instruction
Offset rel_addr_; // address of corresponding relocati on entry Offset rel_addr_; // address of corresponding relocati on entry
Offset addend_; // addend (from RELA entries) Offset addend_; // addend (from RELA entries)
Region::RegionType rtype_; // RT_REL vs. RT_RELA Region::RegionType rtype_; // RT_REL vs. RT_RELA
std::string name_; std::string name_;
Symbol *dynref_; Symbol *dynref_;
unsigned long relType_; unsigned long relType_;
Offset rel_struct_addr_;
}; };
#if 1 #if 1
#if 1 #if 1
SYMTAB_EXPORT SerializerBase *nonpublic_make_bin_symtab_serializer(Symtab * t, std::string file); SYMTAB_EXPORT SerializerBase *nonpublic_make_bin_symtab_serializer(Symtab * t, std::string file);
SYMTAB_EXPORT SerializerBase *nonpublic_make_bin_symtab_deserializer(Symtab *t, std::string file); SYMTAB_EXPORT SerializerBase *nonpublic_make_bin_symtab_deserializer(Symtab *t, std::string file);
SYMTAB_EXPORT void nonpublic_free_bin_symtab_serializer(SerializerBase *sb) ; SYMTAB_EXPORT void nonpublic_free_bin_symtab_serializer(SerializerBase *sb) ;
#else #else
template <class T> template <class T>
 End of changes. 11 change blocks. 
28 lines changed or deleted 19 lines changed or added


 Variable.h   Variable.h 
skipping to change at line 86 skipping to change at line 86
class localVar : public Serializable, public AnnotatableSparse class localVar : public Serializable, public AnnotatableSparse
{ {
friend class typeCommon; friend class typeCommon;
friend class localVarCollection; friend class localVarCollection;
std::string name_; std::string name_;
Type *type_; Type *type_;
std::string fileName_; std::string fileName_;
int lineNum_; int lineNum_;
Function *func_; Function *func_;
std::vector<VariableLocation> locs_; std::vector<VariableLocation> locs_;
// We start with an abstract location that may include "the frame
// pointer" as a register. Once a user requests the location list
// we concretize it and set this flag.
bool locsExpanded_;
// scope_t scope; // scope_t scope;
void expandLocation(const VariableLocation &var,
std::vector<VariableLocation> &ret);
public: public:
SYMTAB_EXPORT localVar() {} SYMTAB_EXPORT localVar() :
type_(NULL), lineNum_(-1), func_(NULL), locsExpanded_(false) {}
// Internal use only // Internal use only
localVar(std::string name, Type *typ, std::string fileName, localVar(std::string name, Type *typ, std::string fileName,
int lineNum, Function *f, int lineNum, Function *f,
std::vector<VariableLocation> *locs = NULL); std::vector<VariableLocation> *locs = NULL);
// Copy constructor // Copy constructor
localVar(localVar &lvar); localVar(localVar &lvar);
bool addLocation(VariableLocation &location); bool addLocation(VariableLocation &location);
SYMTAB_EXPORT ~localVar(); SYMTAB_EXPORT ~localVar();
SYMTAB_EXPORT void fixupUnknown(Module *); SYMTAB_EXPORT void fixupUnknown(Module *);
 End of changes. 4 change blocks. 
2 lines changed or deleted 10 lines changed or added


 VariableLocation.h   VariableLocation.h 
skipping to change at line 49 skipping to change at line 49
/* /*
* storageClass: Encodes how a variable is stored. * storageClass: Encodes how a variable is stored.
* *
* storageAddr - Absolute address of variable. * storageAddr - Absolute address of variable.
* storageReg - Register which holds variable value. * storageReg - Register which holds variable value.
* storageRegOffset - Address of variable = $reg + address. * storageRegOffset - Address of variable = $reg + address.
*/ */
typedef enum { typedef enum {
storageAddr, storageUnset,
storageReg, storageAddr,
storageRegOffset storageReg,
storageRegOffset
} storageClass; } storageClass;
COMMON_EXPORT const char *storageClass2Str(storageClass sc); COMMON_EXPORT const char *storageClass2Str(storageClass sc);
/* /*
* storageRefClass: Encodes if a variable can be accessed through a registe r/address. * storageRefClass: Encodes if a variable can be accessed through a registe r/address.
* *
* storageRef - There is a pointer to variable. * storageRef - There is a pointer to variable.
* storageNoRef - No reference. Value can be obtained using storageCla ss. * storageNoRef - No reference. Value can be obtained using storageCla ss.
*/ */
typedef enum { typedef enum {
storageRef, storageRefUnset,
storageNoRef storageRef,
storageNoRef
} storageRefClass; } storageRefClass;
COMMON_EXPORT const char *storageRefClass2Str(storageRefClass sc); COMMON_EXPORT const char *storageRefClass2Str(storageRefClass sc);
//location for a variable //location for a variable
//Use mr_reg instead of reg for new code. reg left in for backwards //Use mr_reg instead of reg for new code. reg left in for backwards
// compatibility. // compatibility.
struct VariableLocation { struct VariableLocation {
storageClass stClass; storageClass stClass;
storageRefClass refClass; storageRefClass refClass;
int reg;
MachRegister mr_reg; MachRegister mr_reg;
long frameOffset; long frameOffset;
Address lowPC; Address lowPC;
Address hiPC; Address hiPC;
COMMON_EXPORT bool operator==(const VariableLocation &);
VariableLocation() :
stClass(storageUnset),
refClass(storageRefUnset),
frameOffset(0),
lowPC(0),
hiPC(0) {}
bool operator==(const VariableLocation &rhs) const {
return ((stClass == rhs.stClass) &&
(refClass == rhs.refClass) &&
(mr_reg == rhs.mr_reg) &&
(frameOffset == rhs.frameOffset) &&
(lowPC == rhs.lowPC) &&
(hiPC == rhs.hiPC));
}
}; };
} }
#endif #endif
 End of changes. 5 change blocks. 
7 lines changed or deleted 25 lines changed or added


 dyn_regs.h   dyn_regs.h 
skipping to change at line 142 skipping to change at line 142
* *
* These values/layout are not guaranteed to remain the same as part of the * These values/layout are not guaranteed to remain the same as part of the
* public interface, and may change. * public interface, and may change.
**/ **/
//Abstract registers used for stackwalking //Abstract registers used for stackwalking
DEF_REGISTER(InvalidReg, 0 | Arch_none, "abstract"); DEF_REGISTER(InvalidReg, 0 | Arch_none, "abstract");
DEF_REGISTER(FrameBase, 1 | Arch_none, "abstract"); DEF_REGISTER(FrameBase, 1 | Arch_none, "abstract");
DEF_REGISTER(ReturnAddr, 2 | Arch_none, "abstract"); DEF_REGISTER(ReturnAddr, 2 | Arch_none, "abstract");
DEF_REGISTER(StackTop, 3 | Arch_none, "abstract"); DEF_REGISTER(StackTop, 3 | Arch_none, "abstract");
// DWARF-ism; the CFA is the value of the stack pointer in the previous
frame
DEF_REGISTER(CFA, 4 | Arch_none, "abstract");
namespace x86 namespace x86
{ {
const signed int L_REG = 0x00000100; //8-bit, first byte const signed int L_REG = 0x00000100; //8-bit, first byte
const signed int H_REG = 0x00000200; //8-bit, second byte const signed int H_REG = 0x00000200; //8-bit, second byte
const signed int W_REG = 0x00000300; //16-bit, first word const signed int W_REG = 0x00000300; //16-bit, first word
const signed int FULL = 0x00000000; //32 bits const signed int FULL = 0x00000000; //32 bits
const signed int QUAD = 0x00004000; //64 bits const signed int QUAD = 0x00004000; //64 bits
const signed int OCT = 0x00002000; //128 bits const signed int OCT = 0x00002000; //128 bits
const signed int FPDBL = 0x00001000; // 80 bits const signed int FPDBL = 0x00001000; // 80 bits
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 entryIDs.h   entryIDs.h 
skipping to change at line 796 skipping to change at line 796
power_op_lfpsux, power_op_lfpsux,
power_op_lfpsx, power_op_lfpsx,
power_op_lfxdux, power_op_lfxdux,
power_op_lfxdx, power_op_lfxdx,
power_op_lfxsux, power_op_lfxsux,
power_op_lfxsx, power_op_lfxsx,
power_op_lfsdux, power_op_lfsdux,
power_op_lfsdx, power_op_lfsdx,
power_op_lfssux, power_op_lfssux,
power_op_lfssx, power_op_lfssx,
power_op_qvfcfids,
power_op_qvlfsx,
power_op_qvlfsux,
power_op_qvlfcsx,
power_op_qvlfcsux,
power_op_qvlfdx,
power_op_qvlfdux,
power_op_qvlfcdx,
power_op_qvlfcdux,
power_op_qvlfiwax,
power_op_qvlfiwzx,
power_op_qvlpcldx,
power_op_qvlpclsx,
power_op_qvlpcrdx,
power_op_qvlpcrsx,
power_op_qvstfsx,
power_op_qvstfsux,
power_op_qvstfsxi,
power_op_qvstfsuxi,
power_op_qvstfdx,
power_op_qvstfdux,
power_op_qvstfdxi,
power_op_qvstfduxi,
power_op_qvstfcsx,
power_op_qvstfcsux,
power_op_qvstfcsxi,
power_op_qvstfcsuxi,
power_op_qvstfcdx,
power_op_qvstfcdux,
power_op_qvstfcdxi,
power_op_qvstfcduxi,
power_op_qvstfiwx,
power_op_qvfmr,
power_op_qvfcpsgn,
power_op_qvfneg,
power_op_qvfabs,
power_op_qvfnabs,
power_op_qvfadd,
power_op_qvfadds,
power_op_qvfsub,
power_op_qvfsubs,
power_op_qvfmul,
power_op_qvfmuls,
power_op_qvfre,
power_op_qvfres,
power_op_qvfrsqrte,
power_op_qvfrsqrtes,
power_op_qvfmadd,
power_op_qvfmadds,
power_op_qvfmsub,
power_op_qvfmsubs,
power_op_qvfnmadd,
power_op_qvfnmadds,
power_op_qvfnmsub,
power_op_qvfnmsubs,
power_op_qvfxmadd,
power_op_qvfxmadds,
power_op_qvfxxnpmadd,
power_op_qvfxxnpmadds,
power_op_qvfxxmadd,
power_op_qvfxxmadds,
power_op_qvfxxcpnmadd,
power_op_qvfxxcpnmadds,
power_op_qvfxmul,
power_op_qvfxmuls,
power_op_qvfrsp,
power_op_qvfctid,
power_op_qvfctidz,
power_op_qvfctidu,
power_op_qvfctiduz,
power_op_qvfctiw,
power_op_qvfctiwu,
power_op_qvfctiwz,
power_op_qvfctiwuz,
power_op_qvfcfid,
power_op_qvfcfidu,
power_op_qvfcfidus,
power_op_qvfrin,
power_op_qvfriz,
power_op_qvfrip,
power_op_qvfrim,
power_op_qvfcmpgt,
power_op_qvftstnan,
power_op_qvfcmplt,
power_op_qvfcmpeq,
power_op_qvfsel,
power_op_qvfaligni,
power_op_qvfperm,
power_op_qvesplati,
power_op_qvgpci,
power_op_qvflogical,
power_op_qvlstdux,
power_op_qvlstduxi,
power_op_fxcxnms, power_op_fxcxnms,
power_op_fxcxma, power_op_fxcxma,
power_op_fxcxnsma, power_op_fxcxnsma,
power_op_fxcxnpma, power_op_fxcxnpma,
power_op_fxcsnsma, power_op_fxcsnsma,
power_op_fxcpnsma, power_op_fxcpnsma,
power_op_fxcsnpma, power_op_fxcsnpma,
power_op_fxcpnpma, power_op_fxcpnpma,
power_op_fsmtp, power_op_fsmtp,
power_op_fsmfp, power_op_fsmfp,
 End of changes. 1 change blocks. 
0 lines changed or deleted 93 lines changed or added


 liveness.h   liveness.h 
skipping to change at line 63 skipping to change at line 63
}; };
class DATAFLOW_EXPORT LivenessAnalyzer{ class DATAFLOW_EXPORT LivenessAnalyzer{
map<ParseAPI::Block*, livenessData> blockLiveInfo; map<ParseAPI::Block*, livenessData> blockLiveInfo;
map<ParseAPI::Function*, bool> liveFuncCalculated; map<ParseAPI::Function*, bool> liveFuncCalculated;
map<ParseAPI::Function*, bitArray> funcRegsDefined; map<ParseAPI::Function*, bitArray> funcRegsDefined;
InstructionCache cachedLivenessInfo; InstructionCache cachedLivenessInfo;
const bitArray& getLivenessIn(ParseAPI::Block *block); const bitArray& getLivenessIn(ParseAPI::Block *block);
const bitArray& getLivenessOut(ParseAPI::Block *block, bitArray &all RegsDefined); const bitArray& getLivenessOut(ParseAPI::Block *block, bitArray &all RegsDefined);
void processEdgeLiveness(ParseAPI::Edge* e, livenessData& data, Pars
eAPI::Block* block, const bitArray& allRegsDefined);
void summarizeBlockLivenessInfo(ParseAPI::Function* func, ParseAPI:: Block *block, bitArray &allRegsDefined); void summarizeBlockLivenessInfo(ParseAPI::Function* func, ParseAPI:: Block *block, bitArray &allRegsDefined);
bool updateBlockLivenessInfo(ParseAPI::Block *block, bitArray &allRe gsDefined); bool updateBlockLivenessInfo(ParseAPI::Block *block, bitArray &allRe gsDefined);
ReadWriteInfo calcRWSets(Instruction::Ptr curInsn, ParseAPI::Block* blk, Address a); ReadWriteInfo calcRWSets(Instruction::Ptr curInsn, ParseAPI::Block* blk, Address a);
void* getPtrToInstruction(ParseAPI::Block *block, Address addr) cons t; void* getPtrToInstruction(ParseAPI::Block *block, Address addr) cons t;
bool isExitBlock(ParseAPI::Block *block); bool isExitBlock(ParseAPI::Block *block);
bool isMMX(MachRegister machReg); bool isMMX(MachRegister machReg);
MachRegister changeIfMMX(MachRegister machReg); MachRegister changeIfMMX(MachRegister machReg);
int width; int width;
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 slicing.h   slicing.h 
skipping to change at line 554 skipping to change at line 554
bool & err); bool & err);
bool handleReturnDetailsBackward( bool handleReturnDetailsBackward(
SliceFrame & cur, SliceFrame & cur,
ParseAPI::Block * caller_block); ParseAPI::Block * caller_block);
bool followReturn( bool followReturn(
Predicates & p, Predicates & p,
SliceFrame const& cand, SliceFrame const& cand,
ParseAPI::Block * source); ParseAPI::Block * source);
void handlePredecessorEdge(ParseAPI::Edge* e,
Predicates& p,
SliceFrame const& cand,
std::vector<SliceFrame> & newCands,
bool& err,
SliceFrame& nf);
/* general slicing support */ /* general slicing support */
void constructInitialFrame( void constructInitialFrame(
Direction dir, Direction dir,
SliceFrame & initFrame); SliceFrame & initFrame);
void widenAll(GraphPtr graph, Direction dir, SliceFrame const& frame); void widenAll(GraphPtr graph, Direction dir, SliceFrame const& frame);
bool kills(AbsRegion const& reg, Assignment::Ptr &assign); bool kills(AbsRegion const& reg, Assignment::Ptr &assign);
 End of changes. 1 change blocks. 
0 lines changed or deleted 6 lines changed or added


 stackanalysis.h   stackanalysis.h 
skipping to change at line 80 skipping to change at line 80
#define MAXLONG INT32_MAX #define MAXLONG INT32_MAX
#endif #endif
#endif #endif
// These are _NOT_ in the Dyninst namespace... // These are _NOT_ in the Dyninst namespace...
namespace Dyninst { namespace Dyninst {
namespace ParseAPI { namespace ParseAPI {
class Function; class Function;
class Block; class Block;
class Edge;
}; };
namespace InstructionAPI { namespace InstructionAPI {
class Instruction; class Instruction;
class Expression; class Expression;
}; };
class StackAnalysis { class StackAnalysis {
typedef boost::shared_ptr<InstructionAPI::Instruction> InstructionPtr; typedef boost::shared_ptr<InstructionAPI::Instruction> InstructionPtr;
typedef boost::shared_ptr<InstructionAPI::Expression> ExpressionPtr; typedef boost::shared_ptr<InstructionAPI::Expression> ExpressionPtr;
skipping to change at line 354 skipping to change at line 355
void summarizeBlocks(); void summarizeBlocks();
void summarize(); void summarize();
void fixpoint(); void fixpoint();
void createIntervals(); void createIntervals();
void createEntryInput(RegisterState &input); void createEntryInput(RegisterState &input);
void meetInputs(ParseAPI::Block *b, RegisterState &input); void meetInputs(ParseAPI::Block *b, RegisterState &input);
void meet(const RegisterState &source, RegisterState &accum); void meet(const RegisterState &source, RegisterState &accum);
RegisterState getSrcOutputRegs(ParseAPI::Edge* e);
void computeInsnEffects(ParseAPI::Block *block, void computeInsnEffects(ParseAPI::Block *block,
const InstructionPtr &insn, const InstructionPtr &insn,
const Offset off, const Offset off,
TransferFuncs &xferFunc); TransferFuncs &xferFunc);
bool isCall(InstructionPtr insn); bool isCall(InstructionPtr insn);
bool handleNormalCall(InstructionPtr insn, ParseAPI::Block *block, Offs et off, TransferFuncs &xferFuncs); bool handleNormalCall(InstructionPtr insn, ParseAPI::Block *block, Offs et off, TransferFuncs &xferFuncs);
bool handleThunkCall(InstructionPtr insn, TransferFuncs &xferFuncs); bool handleThunkCall(InstructionPtr insn, TransferFuncs &xferFuncs);
void handlePushPop(InstructionPtr insn, int sign, TransferFuncs &xferFu ncs); void handlePushPop(InstructionPtr insn, int sign, TransferFuncs &xferFu ncs);
void handleReturn(InstructionPtr insn, TransferFuncs &xferFuncs); void handleReturn(InstructionPtr insn, TransferFuncs &xferFuncs);
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 symutil.h   symutil.h 
skipping to change at line 95 skipping to change at line 95
Not_A_File, Not_A_File,
Not_An_Archive, Not_An_Archive,
Duplicate_Symbol, Duplicate_Symbol,
Export_Error, Export_Error,
Emit_Error, Emit_Error,
Invalid_Flags, Invalid_Flags,
Bad_Frame_Data, /* 15 */ Bad_Frame_Data, /* 15 */
No_Frame_Entry, No_Frame_Entry,
Frame_Read_Error, Frame_Read_Error,
Multiple_Region_Matches, Multiple_Region_Matches,
No_Error No_Error
} SymtabError; } SymtabError;
typedef struct{ typedef struct{
void *data; void *data;
Offset loadaddr; Offset loadaddr;
unsigned long size; unsigned long size;
std::string name; std::string name;
unsigned segFlags; unsigned segFlags;
}Segment; }Segment;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/