AddrLookup.h | AddrLookup.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
End of changes. 2 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
Aggregate.h | Aggregate.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
End of changes. 2 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
Annotatable.h | Annotatable.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 47 | skipping to change at line 46 | |||
#endif | #endif | |||
#include "dyntypes.h" | #include "dyntypes.h" | |||
#include <vector> | #include <vector> | |||
#include <map> | #include <map> | |||
#include <typeinfo> | #include <typeinfo> | |||
#include <string> | #include <string> | |||
#include <string.h> // for strrchr() | #include <string.h> // for strrchr() | |||
#include <assert.h> | #include <assert.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include "Serialization.h" | ||||
#include "util.h" | #include "util.h" | |||
#include "dyn_detail/boost/type_traits/is_base_of.hpp" | ||||
#include "dyn_detail/boost/type_traits/is_pointer.hpp" | ||||
#include "dyn_detail/boost/type_traits/remove_pointer.hpp" | ||||
#define serialize_printf serializer_printf | ||||
namespace Dyninst | namespace Dyninst | |||
{ | { | |||
class SerializerBase; | ||||
class Serializable; | ||||
typedef Serializable * (*ser_func_t) (void *, SerializerBase *, const char | ||||
*); | ||||
#if !defined(SERIALIZATION_DISABLED) | ||||
#define serialize_printf serializer_printf | ||||
COMMON_EXPORT int serializer_printf(const char *format, ...); | COMMON_EXPORT int serializer_printf(const char *format, ...); | |||
COMMON_EXPORT int annotatable_printf(const char *format, ...); | COMMON_EXPORT Serializable * ser_func_wrapper(void *it, SerializerBase *sb, | |||
const char *tag); | ||||
#endif | ||||
COMMON_EXPORT bool annotation_debug_flag(); | COMMON_EXPORT bool annotation_debug_flag(); | |||
COMMON_EXPORT int annotatable_printf(const char *format, ...); | ||||
typedef unsigned short AnnotationClassID; | typedef unsigned short AnnotationClassID; | |||
typedef bool (*anno_cmp_func_t)(void *, void*); | typedef bool (*anno_cmp_func_t)(void *, void*); | |||
extern int newAnnotationClass(); | extern int newAnnotationClass(); | |||
extern bool void_ptr_cmp_func(void *, void *); | extern bool void_ptr_cmp_func(void *, void *); | |||
class SerializerBase; | ||||
class Serializable; | ||||
typedef Serializable * (*ser_func_t) (void *, SerializerBase *, const char | ||||
*); | ||||
COMMON_EXPORT Serializable * ser_func_wrapper(void *it, SerializerBase *sb, | ||||
const char *tag); | ||||
class AnnotationClassBase | class AnnotationClassBase | |||
{ | { | |||
friend class Serializable; | friend class Serializable; | |||
private: | private: | |||
static std::vector<AnnotationClassBase *> *annotation_types; | static std::vector<AnnotationClassBase *> *annotation_types; | |||
static dyn_hash_map<std::string, AnnotationClassID> *annotation_ids_b y_name; | static dyn_hash_map<std::string, AnnotationClassID> *annotation_ids_b y_name; | |||
#if 0 | #if 0 | |||
COMMON_EXPORT static void clearAnnotationIDMap(); | COMMON_EXPORT static void clearAnnotationIDMap(); | |||
#endif | #endif | |||
anno_cmp_func_t cmp_func; | anno_cmp_func_t cmp_func; | |||
skipping to change at line 116 | skipping to change at line 115 | |||
template <class T> | template <class T> | |||
class AnnotationClass : public AnnotationClassBase { | class AnnotationClass : public AnnotationClassBase { | |||
public: | public: | |||
AnnotationClass(std::string n, | AnnotationClass(std::string n, | |||
anno_cmp_func_t cmp_func_ = NULL, | anno_cmp_func_t cmp_func_ = NULL, | |||
ser_func_t s = NULL) : | ser_func_t s = NULL) : | |||
AnnotationClassBase(n, cmp_func_, s) | AnnotationClassBase(n, cmp_func_, s) | |||
{ | { | |||
#if !defined(SERIALIZATION_DISABLED) | ||||
if (NULL == s) | if (NULL == s) | |||
{ | { | |||
// if the type is Serializable, use its serializati on function | // if the type is Serializable, use its serializati on function | |||
// otherwise, leave it NULL so we don't accidentall y dereference | // otherwise, leave it NULL so we don't accidentall y dereference | |||
// a random pointer as if it were automatcally desc ended from | // a random pointer as if it were automatcally desc ended from | |||
// Serializable | // Serializable | |||
if (boost::is_base_of<Serializable, T>::value) | ||||
if (dyn_detail::boost::is_base_of<Serializable, T>:: | ||||
value) | ||||
{ | { | |||
serialize_func = ser_func_wrapper; | serialize_func = ser_func_wrapper; | |||
} | } else | |||
else if (dyn_detail::boost::is_pointer<T>::value) | if (boost::is_pointer<T>::value) | |||
{ | { | |||
if (dyn_detail::boost::is_base_of<Serializab | if (boost::is_base_of<Serializable, | |||
le, | typename boost::remove_point | |||
typename dyn_detail::boost:: | er<T>::type>::value) | |||
remove_pointer<T>::type>::value) | ||||
{ | { | |||
serialize_func = ser_func_wrapper; | serialize_func = ser_func_wrapper; | |||
} | } | |||
} | } | |||
} | } | |||
#endif | ||||
} | } | |||
const char *getTypeName() { return typeid(T).name();} | const char *getTypeName() { return typeid(T).name();} | |||
void *allocate() | void *allocate() | |||
{ | { | |||
// If T is (Serializable *) need to allocate a new object | ||||
, not a new pointer | ||||
// | ||||
if (dyn_detail::boost::is_pointer<T>::value) | ||||
{ | ||||
if (dyn_detail::boost::is_base_of<Serializab | ||||
le, | ||||
typename dyn_detail::boost:: | ||||
remove_pointer<T>::type>::value) | ||||
{ | ||||
return (void *) new (typename dyn_de | ||||
tail::boost::remove_pointer<T>::type)(); | ||||
} | ||||
} | ||||
return (void *) new T(); | return (void *) new T(); | |||
} | } | |||
size_t size() {return sizeof(T);} | size_t size() {return sizeof(T);} | |||
#if 0 | #if 0 | |||
bool isSparselyAnnotatable(); | bool isSparselyAnnotatable(); | |||
bool isDenselyAnnotatable(); | bool isDenselyAnnotatable(); | |||
#endif | #endif | |||
}; | }; | |||
skipping to change at line 192 | skipping to change at line 180 | |||
COMMON_EXPORT const char *serPostOp2Str(ser_post_op_t); | COMMON_EXPORT const char *serPostOp2Str(ser_post_op_t); | |||
class AnnotatableDense; | class AnnotatableDense; | |||
class AnnotatableSparse; | class AnnotatableSparse; | |||
COMMON_EXPORT bool is_input(SerializerBase *sb); | COMMON_EXPORT bool is_input(SerializerBase *sb); | |||
COMMON_EXPORT bool is_output(SerializerBase *sb); | COMMON_EXPORT bool is_output(SerializerBase *sb); | |||
COMMON_EXPORT unsigned short get_serializer_index(SerializerBase *sb); | COMMON_EXPORT unsigned short get_serializer_index(SerializerBase *sb); | |||
COMMON_EXPORT bool ser_operation(SerializerBase *, ser_post_op_t &, const c har *); | COMMON_EXPORT bool ser_operation(SerializerBase *, ser_post_op_t &, const c har *); | |||
COMMON_EXPORT bool add_annotations(SerializerBase *, AnnotatableDense *, st d::vector<ser_rec_t> &); | COMMON_EXPORT bool add_annotations(SerializerBase *, AnnotatableDense *, st d::vector<ser_rec_t> &); | |||
COMMON_EXPORT bool add_annotations(SerializerBase *, AnnotatableSparse *, s td::vector<ser_rec_t> &); | COMMON_EXPORT bool add_annotations(SerializerBase *, AnnotatableSparse *, s td::vector<ser_rec_t> &); | |||
#if !defined(SERIALIZATION_DISABLED) | ||||
COMMON_EXPORT bool serialize_annotation_list(void *, std::vector<ser_rec_t> &, SerializerBase *sb, const char *); | COMMON_EXPORT bool serialize_annotation_list(void *, std::vector<ser_rec_t> &, SerializerBase *sb, const char *); | |||
COMMON_EXPORT SerializerBase *getExistingOutputSB(unsigned short); | COMMON_EXPORT SerializerBase *getExistingOutputSB(unsigned short); | |||
COMMON_EXPORT bool serialize_post_annotation(void *, void *, SerializerBase *, AnnotationClassBase *acb, sparse_or_dense_anno_t, const char *); | COMMON_EXPORT bool serialize_post_annotation(void *, void *, SerializerBase *, AnnotationClassBase *acb, sparse_or_dense_anno_t, const char *); | |||
#endif | ||||
class AnnotatableDense | class COMMON_EXPORT AnnotatableDense | |||
{ | { | |||
friend COMMON_EXPORT bool add_annotations(SerializerBase *, Annotata bleDense *, std::vector<ser_rec_t> &); | friend COMMON_EXPORT bool add_annotations(SerializerBase *, Annotata bleDense *, std::vector<ser_rec_t> &); | |||
friend class SerializerBase; | friend class SerializerBase; | |||
friend class Serializable; | friend class Serializable; | |||
typedef void *anno_list_t; | typedef void *anno_list_t; | |||
/** | /** | |||
* Inheriting from this class adds a pointer to each object. Multiple | * Inheriting from this class adds a pointer to each object. Multiple | |||
* types of annotations are stored under this pointer in a | * types of annotations are stored under this pointer in a | |||
* annotation_type -> anno_list_t map. | * annotation_type -> anno_list_t map. | |||
skipping to change at line 225 | skipping to change at line 215 | |||
AnnotationClassID max; | AnnotationClassID max; | |||
unsigned short serializer_index; | unsigned short serializer_index; | |||
}; | }; | |||
aInfo *annotations; | aInfo *annotations; | |||
// private version of addAnnotation exists for deserialize functi ons | // private version of addAnnotation exists for deserialize functi ons | |||
// to reconstruct annotations without explicit type info -- don't use in | // to reconstruct annotations without explicit type info -- don't use in | |||
// other contexts | // other contexts | |||
COMMON_EXPORT bool addAnnotation(const void *a, AnnotationClassID id) | bool addAnnotation(const void *a, AnnotationClassID id) | |||
{ | { | |||
if (annotation_debug_flag()) | if (annotation_debug_flag()) | |||
{ | { | |||
fprintf(stderr, "%s[%d]: Dense(%p) add %s-%d\n", FILE__, __LINE__, this, | fprintf(stderr, "%s[%d]: Dense(%p) add %s-%d\n", FILE__, __LINE__, this, | |||
AnnotationClassBase::findAnnotatio nClass(id) | AnnotationClassBase::findAnnotatio nClass(id) | |||
? AnnotationClassBase::findAnnotat ionClass(id)->getName().c_str() | ? AnnotationClassBase::findAnnotat ionClass(id)->getName().c_str() | |||
: "bad_anno_id", id); | : "bad_anno_id", id); | |||
} | } | |||
unsigned size = id + 1; | unsigned size = id + 1; | |||
skipping to change at line 268 | skipping to change at line 258 | |||
annotations->data = (anno_list_t *) realloc(annotat ions->data, sizeof(anno_list_t *) * size); | annotations->data = (anno_list_t *) realloc(annotat ions->data, sizeof(anno_list_t *) * size); | |||
for (unsigned i=old_max; i<size; i++) | for (unsigned i=old_max; i<size; i++) | |||
annotations->data[i] = NULL; | annotations->data[i] = NULL; | |||
} | } | |||
annotations->data[id] = const_cast<void *>(a); | annotations->data[id] = const_cast<void *>(a); | |||
return true; | return true; | |||
} | } | |||
public: | public: | |||
COMMON_EXPORT AnnotatableDense() : annotations(NULL) | AnnotatableDense() : annotations(NULL) | |||
{ | { | |||
} | } | |||
COMMON_EXPORT ~AnnotatableDense() | ~AnnotatableDense() | |||
{ | { | |||
if (annotations) | if (annotations) | |||
{ | { | |||
if (annotations->data) | if (annotations->data) | |||
free(annotations->data); | free(annotations->data); | |||
free(annotations); | free(annotations); | |||
} | } | |||
} | } | |||
template<class T> | template<class T> | |||
skipping to change at line 300 | skipping to change at line 290 | |||
int id = a_id.getID(); | int id = a_id.getID(); | |||
T *a_noconst = const_cast<T *>(a); | T *a_noconst = const_cast<T *>(a); | |||
bool ret = addAnnotation((void *)a_noconst, id); | bool ret = addAnnotation((void *)a_noconst, id); | |||
if (!ret) | if (!ret) | |||
{ | { | |||
fprintf(stderr, "%s[%d]: failed to add annotation\ n", FILE__, __LINE__); | fprintf(stderr, "%s[%d]: failed to add annotation\ n", FILE__, __LINE__); | |||
return ret; | return ret; | |||
} | } | |||
#if !defined(SERIALIZATION_DISABLED) | ||||
// If serialization is not enabled, there will be no seria lizer specified, | // If serialization is not enabled, there will be no seria lizer specified, | |||
// so none of the below code will be executed. | // so none of the below code will be executed. | |||
serialize_printf("%s[%d]: %p addAnnotation: serializer_in dex = %d\n", | serialize_printf("%s[%d]: %p addAnnotation: serializer_in dex = %d\n", | |||
FILE__, __LINE__, this, annotations->serial izer_index); | FILE__, __LINE__, this, annotations->serial izer_index); | |||
if (annotations && ( (unsigned short) -1 != annotations->se rializer_index)) | if (annotations && ( (unsigned short) -1 != annotations->se rializer_index)) | |||
{ | { | |||
SerializerBase *sb = getExistingOutputSB(annotation s->serializer_index); | SerializerBase *sb = getExistingOutputSB(annotation s->serializer_index); | |||
if (!sb) | if (!sb) | |||
skipping to change at line 326 | skipping to change at line 317 | |||
if (sf) | if (sf) | |||
{ | { | |||
// FIXME: for xml support, ser_operation should have a corresponding | // FIXME: for xml support, ser_operation should have a corresponding | |||
// "ser_operation_end()" routine to close out the xml field. | // "ser_operation_end()" routine to close out the xml field. | |||
ser_post_op_t op = sp_add_anno; | ser_post_op_t op = sp_add_anno; | |||
ser_operation(sb, op, "AnnotationAdd"); | ser_operation(sb, op, "AnnotationAdd"); | |||
void * aa = (void *) const_cast<T *>(a); | void * aa = (void *) const_cast<T *>(a); | |||
serialize_post_annotation(this, aa, sb, &a_ id, dense, "PostAnnotation"); | serialize_post_annotation(this, aa, sb, &a_ id, dense, "PostAnnotation"); | |||
} | } | |||
} | } | |||
#endif | ||||
return true; | return true; | |||
} | } | |||
template<class T> | template<class T> | |||
inline bool getAnnotation(T *&a, AnnotationClass<T> &a_id) const | inline bool getAnnotation(T *&a, AnnotationClass<T> &a_id) const | |||
{ | { | |||
if (!annotations) | if (!annotations) | |||
return false; | return false; | |||
skipping to change at line 374 | skipping to change at line 366 | |||
} | } | |||
if (!annotations->data[id]) | if (!annotations->data[id]) | |||
return false; | return false; | |||
annotations->data[id] = NULL; | annotations->data[id] = NULL; | |||
return true; | return true; | |||
} | } | |||
COMMON_EXPORT void serializeAnnotations(SerializerBase *sb, const | #if !defined(SERIALIZATION_DISABLED) | |||
char *tag) | void serializeAnnotations(SerializerBase *sb, const char *tag) | |||
{ | { | |||
serialize_printf("%s[%d]: welcome to serializeAnotations: \n", FILE__, __LINE__); | serialize_printf("%s[%d]: welcome to serializeAnotations: \n", FILE__, __LINE__); | |||
// iterator over possible annotation types | // iterator over possible annotation types | |||
// if we have any, lookup the serialization function and call it | // if we have any, lookup the serialization function and call it | |||
std::vector<ser_rec_t> my_sers; | std::vector<ser_rec_t> my_sers; | |||
if (is_output(sb)) | if (is_output(sb)) | |||
{ | { | |||
// need to figure out how many annotations will b e serialized apriori | // need to figure out how many annotations will b e serialized apriori | |||
// so we can output the size of the list as a hea der. | // so we can output the size of the list as a hea der. | |||
skipping to change at line 446 | skipping to change at line 439 | |||
{ | { | |||
fprintf(stderr, "%s[%d]: FIXME: failed to serial ize annotation list\n", | fprintf(stderr, "%s[%d]: FIXME: failed to serial ize annotation list\n", | |||
FILE__, __LINE__); | FILE__, __LINE__); | |||
} | } | |||
if (!add_annotations(sb, this, my_sers)) | if (!add_annotations(sb, this, my_sers)) | |||
{ | { | |||
fprintf(stderr, "%s[%d]: failed to update annotat ion list after deserialize\n", | fprintf(stderr, "%s[%d]: failed to update annotat ion list after deserialize\n", | |||
FILE__, __LINE__); | FILE__, __LINE__); | |||
} | } | |||
} | } | |||
#else | ||||
COMMON_EXPORT void annotationsReport() | void serializeAnnotations(SerializerBase *, const char *) { | |||
} | ||||
#endif | ||||
void annotationsReport() | ||||
{ | { | |||
std::vector<AnnotationClassBase *> atypes; | std::vector<AnnotationClassBase *> atypes; | |||
if (annotations && annotations->data) | if (annotations && annotations->data) | |||
{ | { | |||
for (unsigned int i = 0; i < annotations->max; ++i ) | for (unsigned int i = 0; i < annotations->max; ++i ) | |||
{ | { | |||
if (NULL != annotations->data[i]) | if (NULL != annotations->data[i]) | |||
{ | { | |||
AnnotationClassBase *acb = Annotat ionClassBase::findAnnotationClass(i); | AnnotationClassBase *acb = Annotat ionClassBase::findAnnotationClass(i); | |||
if (!acb) | if (!acb) | |||
skipping to change at line 483 | skipping to change at line 479 | |||
fprintf(stderr, "\t%s-%d, %s\n", atypes[i] ->getName().c_str(), | fprintf(stderr, "\t%s-%d, %s\n", atypes[i] ->getName().c_str(), | |||
atypes[i]->getID(), atypes [i]->getTypeName()); | atypes[i]->getID(), atypes [i]->getTypeName()); | |||
} | } | |||
} | } | |||
} | } | |||
}; | }; | |||
#define NON_STATIC_SPARSE_MAP 1 | #define NON_STATIC_SPARSE_MAP 1 | |||
#define AN_INLINE inline | #define AN_INLINE inline | |||
class AnnotatableSparse | class COMMON_EXPORT AnnotatableSparse | |||
{ | { | |||
friend class SerializerBase; | friend class SerializerBase; | |||
friend class Serializable; | friend class Serializable; | |||
friend COMMON_EXPORT bool add_annotations(SerializerBase *, | friend COMMON_EXPORT bool add_annotations(SerializerBase *, | |||
AnnotatableSparse *, std::vector<ser_rec_t> &); | AnnotatableSparse *, std::vector<ser_rec_t> &); | |||
public: | public: | |||
struct void_ptr_hasher | struct void_ptr_hasher | |||
{ | { | |||
size_t operator()(const void* a) const | size_t operator()(const void* a) const | |||
{ | { | |||
return (size_t) a; | return (size_t) a; | |||
} | } | |||
}; | }; | |||
#if defined (_MSC_VER) | #if defined (_MSC_VER) | |||
typedef dyn_hash_map<void *, void *> annos_by_type_t; | typedef dyn_hash_map<void *, void *> annos_by_type_t; | |||
#pragma warning (push) | ||||
#pragma warning (disable:4251) | ||||
#else | #else | |||
typedef dyn_hash_map<void *, void *, void_ptr_hasher> annos_by_type_t ; | typedef dyn_hash_map<void *, void *, void_ptr_hasher> annos_by_type_t ; | |||
#endif | #endif | |||
typedef std::vector<annos_by_type_t *> annos_t; | typedef std::vector<annos_by_type_t *> annos_t; | |||
COMMON_EXPORT ~AnnotatableSparse() | ~AnnotatableSparse() | |||
{ | { | |||
// We need to remove annotations from the static map when objects | // We need to remove annotations from the static map when objects | |||
// are destroyed: (1) memory may be reclaimed and reuse d at the same | // are destroyed: (1) memory may be reclaimed and reuse d at the same | |||
// place, and (2) regardless of 1, the map can possibly e xplode to | // place, and (2) regardless of 1, the map can possibly e xplode to | |||
// unmanageable sizes, with a lot of unused junk in it if a lot of i | // unmanageable sizes, with a lot of unused junk in it if a lot of i | |||
// annotatable objects are created and destroyed. | // annotatable objects are created and destroyed. | |||
// Alas this is kinda expensive right now, but the data s tructure is | // Alas this is kinda expensive right now, but the data s tructure is | |||
// set up to minimize search time, not deletion time. It could | // set up to minimize search time, not deletion time. It could | |||
// be changed if this becomes a significant time drain. | // be changed if this becomes a significant time drain. | |||
skipping to change at line 553 | skipping to change at line 551 | |||
fprintf(stderr, "%s[%d]: FIXME: REMOVE FAILED\n", FILE__, __LINE__); | fprintf(stderr, "%s[%d]: FIXME: REMOVE FAILED\n", FILE__, __LINE__); | |||
} | } | |||
} | } | |||
} | } | |||
private: | private: | |||
#if defined (NON_STATIC_SPARSE_MAP) | #if defined (NON_STATIC_SPARSE_MAP) | |||
//COMMON_EXPORT static annos_t *annos; | //COMMON_EXPORT static annos_t *annos; | |||
#else | #else | |||
COMMON_EXPORT static annos_t annos; | static annos_t annos; | |||
#endif | #endif | |||
COMMON_EXPORT annos_t *getAnnos() const; | annos_t *getAnnos() const; | |||
COMMON_EXPORT static dyn_hash_map<void *, unsigned short> ser_ndx_ | static dyn_hash_map<void *, unsigned short> ser_ndx_map; | |||
map; | ||||
COMMON_EXPORT annos_by_type_t *getAnnosOfType(AnnotationClassID aid, bool do_create =false) const | annos_by_type_t *getAnnosOfType(AnnotationClassID aid, bool do_create =false) const | |||
{ | { | |||
annos_t &l_annos = *getAnnos(); | annos_t &l_annos = *getAnnos(); | |||
long nelems_to_create = aid - l_annos.size() + 1; | long nelems_to_create = aid - l_annos.size() + 1; | |||
if (nelems_to_create > 0) | if (nelems_to_create > 0) | |||
{ | { | |||
if (!do_create) | if (!do_create) | |||
{ | { | |||
return NULL; | return NULL; | |||
} | } | |||
skipping to change at line 591 | skipping to change at line 589 | |||
} | } | |||
template <class T> | template <class T> | |||
AN_INLINE annos_by_type_t *getAnnosOfType(AnnotationClass<T> &a_id, b ool do_create =false) const | AN_INLINE annos_by_type_t *getAnnosOfType(AnnotationClass<T> &a_id, b ool do_create =false) const | |||
{ | { | |||
AnnotationClassID aid = a_id.getID(); | AnnotationClassID aid = a_id.getID(); | |||
return getAnnosOfType(aid, do_create); | return getAnnosOfType(aid, do_create); | |||
} | } | |||
COMMON_EXPORT void *getAnnosForObject(annos_by_type_t *abt, | void *getAnnosForObject(annos_by_type_t *abt, | |||
void *obj, bool do_create = false) const | void *obj, bool do_create = false) const | |||
{ | { | |||
assert(abt); | assert(abt); | |||
assert(obj); | assert(obj); | |||
void *target = NULL; | void *target = NULL; | |||
annos_by_type_t::iterator iter = abt->find(obj); | annos_by_type_t::iterator iter = abt->find(obj); | |||
if (iter == abt->end()) | if (iter == abt->end()) | |||
skipping to change at line 620 | skipping to change at line 618 | |||
else | else | |||
{ | { | |||
target = iter->second; | target = iter->second; | |||
} | } | |||
return target; | return target; | |||
} | } | |||
// private version of addAnnotation used by deserialize function to restore | // private version of addAnnotation used by deserialize function to restore | |||
// annotation set without explicitly specifying types | // annotation set without explicitly specifying types | |||
COMMON_EXPORT AN_INLINE bool addAnnotation(const void *a, Annotati onClassID aid) | AN_INLINE bool addAnnotation(const void *a, AnnotationClassID aid) | |||
{ | { | |||
if (annotation_debug_flag()) | if (annotation_debug_flag()) | |||
{ | { | |||
fprintf(stderr, "%s[%d]: Sparse(%p) add %s-%d voi d\n", FILE__, __LINE__, this, | fprintf(stderr, "%s[%d]: Sparse(%p) add %s-%d voi d\n", FILE__, __LINE__, this, | |||
AnnotationClassBase::findAnnotatio nClass(aid) | AnnotationClassBase::findAnnotatio nClass(aid) | |||
? AnnotationClassBase::findAnnotat ionClass(aid)->getName().c_str() | ? AnnotationClassBase::findAnnotat ionClass(aid)->getName().c_str() | |||
: "bad_anno_id", aid); | : "bad_anno_id", aid); | |||
} | } | |||
void *obj = this; | void *obj = this; | |||
skipping to change at line 664 | skipping to change at line 662 | |||
} | } | |||
return true; | return true; | |||
} | } | |||
return true; | return true; | |||
} | } | |||
public: | public: | |||
COMMON_EXPORT bool operator==(AnnotatableSparse &cmp) | bool operator==(AnnotatableSparse &cmp) | |||
{ | { | |||
annos_t &l_annos = *getAnnos(); | annos_t &l_annos = *getAnnos(); | |||
unsigned this_ntypes = l_annos.size(); | unsigned this_ntypes = l_annos.size(); | |||
unsigned cmp_ntypes = cmp.getAnnos()->size(); | unsigned cmp_ntypes = cmp.getAnnos()->size(); | |||
unsigned ntypes = (cmp_ntypes > this_ntypes) ? cmp_ntypes : this_n types; | unsigned ntypes = (cmp_ntypes > this_ntypes) ? cmp_ntypes : this_n types; | |||
for (unsigned int i = 0; i < ntypes; ++i) | for (unsigned int i = 0; i < ntypes; ++i) | |||
{ | { | |||
if ((i >= cmp_ntypes) || (i >= this_ntypes)) | if ((i >= cmp_ntypes) || (i >= this_ntypes)) | |||
{ | { | |||
skipping to change at line 722 | skipping to change at line 720 | |||
if ( (cmp_abt_iter == cmp_abt->end()) | if ( (cmp_abt_iter == cmp_abt->end()) | |||
&& (this_abt_iter != this_abt->end())) | && (this_abt_iter != this_abt->end())) | |||
{ | { | |||
return false; | return false; | |||
} | } | |||
AnnotationClassBase *acb = AnnotationClassBase::findAnnotationC lass(i); | AnnotationClassBase *acb = AnnotationClassBase::findAnnotationC lass(i); | |||
if (!acb) | if (!acb) | |||
{ | { | |||
serialize_printf("%s[%d]: cannot find annotation class for | ||||
id %d\n", | ||||
FILE__, __LINE__, i); | ||||
return false; | return false; | |||
} | } | |||
// both have annotation -- do the compare | // both have annotation -- do the compare | |||
anno_cmp_func_t cmpfunc = acb->getCmpFunc(); | anno_cmp_func_t cmpfunc = acb->getCmpFunc(); | |||
if (!cmpfunc) | if (!cmpfunc) | |||
{ | { | |||
// even if not explicitly specified, a default pointer-comp are | // even if not explicitly specified, a default pointer-comp are | |||
// function should be returned here. | // function should be returned here. | |||
skipping to change at line 785 | skipping to change at line 781 | |||
if (iter->second != a) | if (iter->second != a) | |||
{ | { | |||
//fprintf(stderr, "%s[%d]: WEIRD: already have annotation of type %s: %p, replacing with %p\n", FILE__, __LIN E__, a_id.getName().c_str(), iter->second, a); | //fprintf(stderr, "%s[%d]: WEIRD: already have annotation of type %s: %p, replacing with %p\n", FILE__, __LIN E__, a_id.getName().c_str(), iter->second, a); | |||
iter->second = (void *)const_cast<T *>(a); | iter->second = (void *)const_cast<T *>(a); | |||
} | } | |||
return true; | return true; | |||
} | } | |||
#if !defined(SERIALIZATION_DISABLED) | ||||
dyn_hash_map<void *, unsigned short>::iterator serit er; | dyn_hash_map<void *, unsigned short>::iterator serit er; | |||
seriter = ser_ndx_map.find(this); | seriter = ser_ndx_map.find(this); | |||
if (seriter != ser_ndx_map.end()) | if (seriter != ser_ndx_map.end()) | |||
{ | { | |||
if (seriter->second != (unsigned short) -1) | if (seriter->second != (unsigned short) -1) | |||
{ | { | |||
SerializerBase *sb = getExistingOutp utSB(seriter->second); | SerializerBase *sb = getExistingOutp utSB(seriter->second); | |||
if (!sb) | if (!sb) | |||
{ | { | |||
fprintf(stderr, "%s[%d]: FI XME: no existing output SB\n", | fprintf(stderr, "%s[%d]: FI XME: no existing output SB\n", | |||
skipping to change at line 809 | skipping to change at line 806 | |||
ser_func_t sf = a_id.getSerializeFun c(); | ser_func_t sf = a_id.getSerializeFun c(); | |||
if (sf) | if (sf) | |||
{ | { | |||
ser_post_op_t op = sp_add_an no; | ser_post_op_t op = sp_add_an no; | |||
ser_operation(sb, op, "Annot ationAdd"); | ser_operation(sb, op, "Annot ationAdd"); | |||
void *aa = (void *) const_ca st<T *>(a); | void *aa = (void *) const_ca st<T *>(a); | |||
serialize_post_annotation(th is, aa, sb, &a_id, sparse, "PostAnnotation"); | serialize_post_annotation(th is, aa, sb, &a_id, sparse, "PostAnnotation"); | |||
} | } | |||
} | } | |||
} | } | |||
#endif | ||||
return true; | return true; | |||
} | } | |||
template<class T> | template<class T> | |||
AN_INLINE bool getAnnotation(T *&a, AnnotationClass<T> &a_id) const | AN_INLINE bool getAnnotation(T *&a, AnnotationClass<T> &a_id) const | |||
{ | { | |||
a = NULL; | a = NULL; | |||
annos_by_type_t *abt = getAnnosOfType(a_id, false /*don't create i f none*/); | annos_by_type_t *abt = getAnnosOfType(a_id, false /*don't create i f none*/); | |||
skipping to change at line 865 | skipping to change at line 863 | |||
return false; | return false; | |||
} | } | |||
else | else | |||
{ | { | |||
abt->erase(iter); | abt->erase(iter); | |||
return true; | return true; | |||
} | } | |||
return false; | return false; | |||
} | } | |||
COMMON_EXPORT void serializeAnnotations(SerializerBase *sb, const char *tag) | void serializeAnnotations(SerializerBase *sb, const char *) | |||
{ | { | |||
annos_t &l_annos = *getAnnos(); | annos_t &l_annos = *getAnnos(); | |||
std::vector<ser_rec_t> my_sers; | std::vector<ser_rec_t> my_sers; | |||
void *obj = this; | void *obj = this; | |||
if (is_output(sb)) | if (is_output(sb)) | |||
{ | { | |||
for (AnnotationClassID id = 0; id < l_annos. size(); ++id) | for (AnnotationClassID id = 0; id < l_annos. size(); ++id) | |||
{ | { | |||
annos_by_type_t *abt = getAnnosOfTyp e(id, false /*don't do create */); | annos_by_type_t *abt = getAnnosOfTyp e(id, false /*don't do create */); | |||
if (NULL == abt) continue; | if (NULL == abt) continue; | |||
skipping to change at line 899 | skipping to change at line 897 | |||
if (!acb) | if (!acb) | |||
{ | { | |||
fprintf(stderr, "%s[%d]: FI XME, cannot find annotation class base for id %d, mode = %s\n", FILE__, __L INE__, id, is_input(sb) ? "deserialize" : "serialize"); | fprintf(stderr, "%s[%d]: FI XME, cannot find annotation class base for id %d, mode = %s\n", FILE__, __L INE__, id, is_input(sb) ? "deserialize" : "serialize"); | |||
continue; | continue; | |||
} | } | |||
ser_func_t sf = acb->getSerializeFun c(); | ser_func_t sf = acb->getSerializeFun c(); | |||
if (NULL == sf) | if (NULL == sf) | |||
{ | { | |||
serialize_printf("%s[%d]: n o serialization function for this anno: type: %s, name: %s\n", FILE__, __LI NE__, acb->getTypeName(), acb->getName().c_str()); | ||||
continue; | continue; | |||
} | } | |||
ser_rec_t sr; | ser_rec_t sr; | |||
sr.acb = acb; | sr.acb = acb; | |||
sr.data = iter->second; | sr.data = iter->second; | |||
sr.parent_id = (void *) this; | sr.parent_id = (void *) this; | |||
sr.sod = sparse; | sr.sod = sparse; | |||
my_sers.push_back(sr); | my_sers.push_back(sr); | |||
} | } | |||
if (my_sers.size()) | ser_ndx_map[this] = get_serializer_i | |||
serialize_printf("%s[%d]: found %lu | ndex(sb); | |||
req'd serializations for obj %p\n", | ||||
FILE__, __LINE__, my | ||||
_sers.size(), this); | ||||
ser_ndx_map[this] = get_serializer_index(sb) | ||||
; | ||||
} | } | |||
#if !defined(SERIALIZATION_DISABLED) | ||||
if (!serialize_annotation_list(this, my_sers, sb, ta g)) | if (!serialize_annotation_list(this, my_sers, sb, ta g)) | |||
{ | { | |||
fprintf(stderr, "%s[%d]: FIXME: failed to serialize annotation list\n", | fprintf(stderr, "%s[%d]: FIXME: failed to serialize annotation list\n", | |||
FILE__, __LINE__); | FILE__, __LINE__); | |||
} | } | |||
#endif | ||||
if (!add_annotations(sb, this, my_sers)) | if (!add_annotations(sb, this, my_sers)) | |||
{ | { | |||
fprintf(stderr, "%s[%d]: failed to update a nnotation list after deserialize\n", | fprintf(stderr, "%s[%d]: failed to update a nnotation list after deserialize\n", | |||
FILE__, __LINE__); | FILE__, __LINE__); | |||
} | } | |||
} | } | |||
COMMON_EXPORT void annotationsReport() | void annotationsReport() | |||
{ | { | |||
std::vector<AnnotationClassBase *> atypes; | std::vector<AnnotationClassBase *> atypes; | |||
annos_t &l_annos = *getAnnos(); | annos_t &l_annos = *getAnnos(); | |||
for (AnnotationClassID id = 0; id < l_annos.size(); ++id) | for (AnnotationClassID id = 0; id < l_annos.size(); ++id) | |||
{ | { | |||
annos_by_type_t *abt = getAnnosOfType(id, false /* don't do create */); | annos_by_type_t *abt = getAnnosOfType(id, false /* don't do create */); | |||
if (NULL == abt) continue; | if (NULL == abt) continue; | |||
annos_by_type_t::iterator iter = abt->find(this); | annos_by_type_t::iterator iter = abt->find(this); | |||
skipping to change at line 972 | skipping to change at line 967 | |||
{ | { | |||
fprintf(stderr, "\t%s-%d, %s\n", atypes[i]->getNam e().c_str(), | fprintf(stderr, "\t%s-%d, %s\n", atypes[i]->getNam e().c_str(), | |||
atypes[i]->getID(), atypes[i]->get TypeName()); | atypes[i]->getID(), atypes[i]->get TypeName()); | |||
} | } | |||
} | } | |||
}; | }; | |||
} // namespace | } // namespace | |||
#ifdef _MSC_VER | ||||
#pragma warning(pop) | ||||
#endif | ||||
#endif | #endif | |||
End of changes. 43 change blocks. | ||||
76 lines changed or deleted | 64 lines changed or added | |||
Archive.h | Archive.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
End of changes. 2 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
Collections.h | Collections.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 46 | 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 78 | 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; | |||
SYMTAB_EXPORT ~typeCollection(); | ||||
// 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; | |||
static bool doDeferredLookups(typeCollection *); | static bool doDeferredLookups(typeCollection *); | |||
// DWARF... | // DWARF... | |||
bool dwarfParsed_; | bool dwarfParsed_; | |||
SYMTAB_EXPORT Serializable *serialize_impl(SerializerBase *, const c har * = "typeCollection") THROW_SPEC (SerializerError); | SYMTAB_EXPORT Serializable *serialize_impl(SerializerBase *, const c har * = "typeCollection") THROW_SPEC (SerializerError); | |||
public: | public: | |||
SYMTAB_EXPORT typeCollection(); | SYMTAB_EXPORT typeCollection(); | |||
SYMTAB_EXPORT ~typeCollection(); | ||||
public: | public: | |||
static void addDeferredLookup(int, dataClass, Type **); | static void addDeferredLookup(int, dataClass, Type **); | |||
SYMTAB_EXPORT static typeCollection *getModTypeCollection(Module *mod); | SYMTAB_EXPORT static typeCollection *getModTypeCollection(Module *mod); | |||
#if 0 | #if 0 | |||
SYMTAB_EXPORT static typeCollection *getGlobalTypeCollection(); | SYMTAB_EXPORT static typeCollection *getGlobalTypeCollection(); | |||
SYMTAB_EXPORT static void freeTypeCollection(typeCollection *tc); | SYMTAB_EXPORT static void freeTypeCollection(typeCollection *tc); | |||
#endif | #endif | |||
// DWARF... | // DWARF... | |||
End of changes. 6 change blocks. | ||||
10 lines changed or deleted | 10 lines changed or added | |||
Edge.h | Edge.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 35 | skipping to change at line 34 | |||
* 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 | |||
*/ | */ | |||
#if !defined(EDGE_H) | #if !defined(EDGE_H) | |||
#define EDGE_H | #define EDGE_H | |||
#include "dyn_detail/boost/shared_ptr.hpp" | #include "boost/shared_ptr.hpp" | |||
#include "dyn_detail/boost/weak_ptr.hpp" | #include "boost/weak_ptr.hpp" | |||
#include <set> | #include <set> | |||
#include "Annotatable.h" | #include "Annotatable.h" | |||
namespace Dyninst { | namespace Dyninst { | |||
class Graph; | class Graph; | |||
class Node; | class Node; | |||
class COMMON_EXPORT Edge : public AnnotatableSparse { | class COMMON_EXPORT Edge : public AnnotatableSparse { | |||
friend class Node; | friend class Node; | |||
friend class Graph; | friend class Graph; | |||
friend class Creator; | friend class Creator; | |||
public: | public: | |||
typedef dyn_detail::boost::shared_ptr<Edge> Ptr; | typedef boost::shared_ptr<Edge> Ptr; | |||
private: | private: | |||
typedef dyn_detail::boost::shared_ptr<Node> NodeSharedPtr; | typedef boost::shared_ptr<Node> NodeSharedPtr; | |||
typedef dyn_detail::boost::weak_ptr<Node> NodePtr; | typedef boost::weak_ptr<Node> NodePtr; | |||
public: | public: | |||
static Ptr createEdge(const NodeSharedPtr source, const NodeSharedPtr t arget); | static Ptr createEdge(const NodeSharedPtr source, const NodeSharedPtr t arget); | |||
NodeSharedPtr source() const { return source_.lock(); } | NodeSharedPtr source() const { return source_.lock(); } | |||
NodeSharedPtr target() const { return target_.lock(); } | NodeSharedPtr target() const { return target_.lock(); } | |||
void setSource(NodeSharedPtr source) { source_ = NodePtr(source); } | void setSource(NodeSharedPtr source) { source_ = NodePtr(source); } | |||
void setTarget(NodeSharedPtr target) { target_ = NodePtr(target); } | void setTarget(NodeSharedPtr target) { target_ = NodePtr(target); } | |||
End of changes. 5 change blocks. | ||||
12 lines changed or deleted | 11 lines changed or added | |||
Function.h | Function.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 82 | 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 *>¶ms); | SYMTAB_EXPORT bool getParams(std::vector<localVar *>¶ms); | |||
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. 5 change blocks. | ||||
9 lines changed or deleted | 12 lines changed or added | |||
Graph.h | Graph.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 38 | 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 | |||
*/ | */ | |||
// Graph class | // Graph class | |||
#if !defined(GRAPH_H) | #if !defined(GRAPH_H) | |||
#define GRAPH_H | #define GRAPH_H | |||
#include "dyntypes.h" | #include "dyntypes.h" | |||
#include "dyn_detail/boost/shared_ptr.hpp" | #include "boost/shared_ptr.hpp" | |||
#include <set> | #include <set> | |||
#include <list> | #include <list> | |||
#include <queue> | #include <queue> | |||
#include <map> | #include <map> | |||
#include "Annotatable.h" | #include "Annotatable.h" | |||
#include "Node.h" | #include "Node.h" | |||
#if defined(_MSC_VER) | ||||
#pragma warning(disable:4251) | ||||
#endif | ||||
namespace Dyninst { | namespace Dyninst { | |||
class Edge; | class Edge; | |||
class Graph; | class Graph; | |||
class Node; | class Node; | |||
class NodeIterator; | class NodeIterator; | |||
class EdgeIterator; | class EdgeIterator; | |||
class COMMON_EXPORT Graph : public AnnotatableSparse { | class COMMON_EXPORT Graph : public AnnotatableSparse { | |||
friend class Edge; | friend class Edge; | |||
friend class Node; | friend class Node; | |||
friend class Creator; | friend class Creator; | |||
friend class Iterator; | friend class Iterator; | |||
protected: | protected: | |||
typedef dyn_detail::boost::shared_ptr<Node> NodePtr; | typedef boost::shared_ptr<Node> NodePtr; | |||
typedef dyn_detail::boost::shared_ptr<Edge> EdgePtr; | typedef boost::shared_ptr<Edge> EdgePtr; | |||
typedef std::set<NodePtr> NodeSet; | typedef std::set<NodePtr> NodeSet; | |||
typedef std::map<Address, NodeSet> NodeMap; | typedef std::map<Address, NodeSet> NodeMap; | |||
public: | public: | |||
typedef dyn_detail::boost::shared_ptr<Graph> Ptr; | typedef boost::shared_ptr<Graph> Ptr; | |||
// Interface class for predicate-based searches. Users | // Interface class for predicate-based searches. Users | |||
// can inherit this class to specify the functor to use | // can inherit this class to specify the functor to use | |||
// as a predicate... | // as a predicate... | |||
class NodePredicate { | class NodePredicate { | |||
public: | public: | |||
typedef dyn_detail::boost::shared_ptr<NodePredicate> Ptr; | typedef boost::shared_ptr<NodePredicate> Ptr; | |||
virtual ~NodePredicate() {}; | virtual ~NodePredicate() {}; | |||
virtual bool predicate(const NodePtr &node) = 0; | virtual bool predicate(const NodePtr &node) = 0; | |||
static Ptr getPtr(NodePredicate *p) { | static Ptr getPtr(NodePredicate *p) { | |||
return Ptr(p); | return Ptr(p); | |||
} | } | |||
}; | }; | |||
typedef bool (*NodePredicateFunc)(const NodePtr &node, void *user_arg); | typedef bool (*NodePredicateFunc)(const NodePtr &node, void *user_arg); | |||
// If you want to traverse the graph start here. | // If you want to traverse the graph start here. | |||
skipping to change at line 103 | skipping to change at line 106 | |||
// Get all nodes in the graph | // Get all nodes in the graph | |||
virtual void allNodes(NodeIterator &begin, NodeIterator &end); | virtual void allNodes(NodeIterator &begin, NodeIterator &end); | |||
// Get all nodes with a provided address | // Get all nodes with a provided address | |||
virtual bool find(Address addr, NodeIterator &begin, NodeIterator &end) ; | virtual bool find(Address addr, NodeIterator &begin, NodeIterator &end) ; | |||
// Get all nodes that satisfy the provided predicate | // Get all nodes that satisfy the provided predicate | |||
virtual bool find(NodePredicate::Ptr, NodeIterator &begin, NodeIterator &end); | virtual bool find(NodePredicate::Ptr, NodeIterator &begin, NodeIterator &end); | |||
virtual bool find(NodePredicateFunc, void *user_arg, NodeIterator &begi n, NodeIterator &end); | virtual bool find(NodePredicateFunc, void *user_arg, NodeIterator &begi n, NodeIterator &end); | |||
bool printDOT(const std::string fileName); | bool printDOT(const std::string& fileName); | |||
virtual ~Graph() {}; | virtual ~Graph() {}; | |||
// We create an empty graph and then add nodes and edges. | // We create an empty graph and then add nodes and edges. | |||
static Ptr createGraph(); | static Ptr createGraph(); | |||
void insertPair(NodePtr source, NodePtr target, EdgePtr edge = EdgePtr( )); | void insertPair(NodePtr source, NodePtr target, EdgePtr edge = EdgePtr( )); | |||
virtual void insertEntryNode(NodePtr entry); | virtual void insertEntryNode(NodePtr entry); | |||
virtual void insertExitNode(NodePtr exit); | virtual void insertExitNode(NodePtr exit); | |||
skipping to change at line 127 | skipping to change at line 130 | |||
void deleteNode(NodePtr node); | void deleteNode(NodePtr node); | |||
void addNode(NodePtr node); | void addNode(NodePtr node); | |||
virtual void removeAnnotation() {}; | virtual void removeAnnotation() {}; | |||
bool isEntryNode(NodePtr node); | bool isEntryNode(NodePtr node); | |||
bool isExitNode(NodePtr node); | bool isExitNode(NodePtr node); | |||
unsigned size() const; | ||||
protected: | protected: | |||
static const Address INITIAL_ADDR; | static const Address INITIAL_ADDR; | |||
// Create graph, add nodes. | // Create graph, add nodes. | |||
Graph(); | Graph(); | |||
// We also need to point to all Nodes to keep them alive; we can't | // We also need to point to all Nodes to keep them alive; we can't | |||
// pervasively use shared_ptr within the graph because we're likely | // pervasively use shared_ptr within the graph because we're likely | |||
// to have cycles. | // to have cycles. | |||
End of changes. 9 change blocks. | ||||
13 lines changed or deleted | 18 lines changed or added | |||
IBSTree.h | IBSTree.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 801 | skipping to change at line 800 | |||
IBSNode<ITYPE> *last = nil; | IBSNode<ITYPE> *last = nil; | |||
std::vector< IBSNode<ITYPE>* > stack; | std::vector< IBSNode<ITYPE>* > stack; | |||
/* last will hold the node immediately greater than X */ | /* last will hold the node immediately greater than X */ | |||
while(1) { | while(1) { | |||
if(n == nil) { | if(n == nil) { | |||
if(last != nil) { | if(last != nil) { | |||
typename set<ITYPE *>::iterator sit = last->equal.begin(); | typename set<ITYPE *>::iterator sit = last->equal.begin(); | |||
for( ; sit != last->equal.end(); ++sit) { | for( ; sit != last->equal.end(); ++sit) { | |||
if((*sit)->low() == last->value()) out.insert(*sit); | if((*sit)->low() == last->value()) out.insert(*sit); | |||
} | } | |||
if(!out.empty()) | if(!out.empty()) | |||
break; | break; | |||
else { | else { | |||
// have missed out. pop back up to the last node where | // have missed out. pop back up to the last node where | |||
// we went left and then advance down its right path | // we went left and then advance down its right path | |||
n = last->right; | n = last->right; | |||
if(!stack.empty()) { | if(!stack.empty()) { | |||
last = stack.back(); | last = stack.back(); | |||
stack.pop_back(); | stack.pop_back(); | |||
End of changes. 3 change blocks. | ||||
8 lines changed or deleted | 7 lines changed or added | |||
LineInformation.h | LineInformation.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
End of changes. 2 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
Module.h | Module.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 136 | 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, | |||
bool checkCase = true); | bool checkCase = true); | |||
// Variable based methods | // Variable based methods | |||
SYMTAB_EXPORT bool findVariableByOffset(Variable *&ret, const Offset offset); | SYMTAB_EXPORT bool findVariableByOffset(Variable *&ret, const Offset offset); | |||
SYMTAB_EXPORT bool findVariablesByName(std::vector<Variable *> &ret, const std::string name, | SYMTAB_EXPORT bool findVariablesByName(std::vector<Variable *> &ret, const std::string& name, | |||
NameType nameType = anyName, | NameType nameType = anyName, | |||
bool isRegex = false, | bool isRegex = false, | |||
bool checkCase = true); | bool checkCase = true); | |||
SYMTAB_EXPORT bool getAllVariables(std::vector<Variable *> &ret); | SYMTAB_EXPORT bool getAllVariables(std::vector<Variable *> &ret); | |||
// Type output methods | // Type output methods | |||
SYMTAB_EXPORT virtual bool findType(Type *&type, std::string name); | SYMTAB_EXPORT virtual bool findType(Type *&type, std::string name); | |||
SYMTAB_EXPORT virtual bool findVariableType(Type *&type, std::string nam e); | SYMTAB_EXPORT virtual bool findVariableType(Type *&type, std::string nam e); | |||
SYMTAB_EXPORT std::vector<Type *> *getAllTypes(); | SYMTAB_EXPORT std::vector<Type *> *getAllTypes(); | |||
skipping to change at line 187 | 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. 6 change blocks. | ||||
24 lines changed or deleted | 17 lines changed or added | |||
Node.h | Node.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 35 | skipping to change at line 34 | |||
* 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 | |||
*/ | */ | |||
#if !defined(NODE_H) | #if !defined(NODE_H) | |||
#define NODE_H | #define NODE_H | |||
#include "dyn_detail/boost/shared_ptr.hpp" | ||||
#include <set> | #include <set> | |||
#include <string> | #include <string> | |||
#include "Annotatable.h" | #include "Annotatable.h" | |||
#include "dyntypes.h" | #include "dyntypes.h" | |||
#include "boost/shared_ptr.hpp" | ||||
#if defined(_MSC_VER) | ||||
#pragma warning(disable:4251) | ||||
#endif | ||||
class BPatch_function; | class BPatch_function; | |||
class BPatch_basicBlock; | class BPatch_basicBlock; | |||
namespace Dyninst { | namespace Dyninst { | |||
class Edge; | class Edge; | |||
class Graph; | class Graph; | |||
class NodeIterator; | class NodeIterator; | |||
class EdgeIterator; | class EdgeIterator; | |||
class COMMON_EXPORT Node { | class COMMON_EXPORT Node { | |||
friend class Edge; | friend class Edge; | |||
friend class Graph; | friend class Graph; | |||
typedef dyn_detail::boost::shared_ptr<Edge> EdgePtr; | typedef boost::shared_ptr<Edge> EdgePtr; | |||
typedef dyn_detail::boost::shared_ptr<Graph> GraphPtr; | typedef boost::shared_ptr<Graph> GraphPtr; | |||
typedef std::set<EdgePtr> EdgeSet; | typedef std::set<EdgePtr> EdgeSet; | |||
public: | public: | |||
typedef dyn_detail::boost::shared_ptr<Node> Ptr; | typedef boost::shared_ptr<Node> Ptr; | |||
void ins(EdgeIterator &begin, EdgeIterator &end); | void ins(EdgeIterator &begin, EdgeIterator &end); | |||
void outs(EdgeIterator &begin, EdgeIterator &end); | void outs(EdgeIterator &begin, EdgeIterator &end); | |||
void ins(NodeIterator &begin, NodeIterator &end); | void ins(NodeIterator &begin, NodeIterator &end); | |||
void outs(NodeIterator &begin, NodeIterator &end); | void outs(NodeIterator &begin, NodeIterator &end); | |||
bool hasInEdges(); | bool hasInEdges(); | |||
bool hasOutEdges(); | bool hasOutEdges(); | |||
skipping to change at line 103 | skipping to change at line 106 | |||
virtual std::string DOTrank() const; | virtual std::string DOTrank() const; | |||
virtual std::string DOTname() const; | virtual std::string DOTname() const; | |||
virtual bool DOTinclude() const { return true; } | virtual bool DOTinclude() const { return true; } | |||
protected: | protected: | |||
Node() {}; | Node() {}; | |||
EdgeSet ins_; | EdgeSet ins_; | |||
EdgeSet outs_; | EdgeSet outs_; | |||
void addInEdge(const EdgePtr in) { ins_.insert(in); } | void addInEdge(const EdgePtr in); | |||
void addOutEdge(const EdgePtr out) { outs_.insert(out); } | void addOutEdge(const EdgePtr out); | |||
static const Address INVALID_ADDR; | static const Address INVALID_ADDR; | |||
}; | }; | |||
class COMMON_EXPORT PhysicalNode : public Node { | class COMMON_EXPORT PhysicalNode : public Node { | |||
public: | public: | |||
typedef dyn_detail::boost::shared_ptr<PhysicalNode> Ptr; | typedef boost::shared_ptr<PhysicalNode> Ptr; | |||
static Node::Ptr createNode(Address addr); | static Node::Ptr createNode(Address addr); | |||
virtual Address addr() const { return addr_; } | virtual Address addr() const { return addr_; } | |||
virtual std::string format() const; | virtual std::string format() const; | |||
virtual bool isVirtual() const { return false; } | virtual bool isVirtual() const { return false; } | |||
virtual ~PhysicalNode() {}; | virtual ~PhysicalNode() {}; | |||
skipping to change at line 136 | skipping to change at line 139 | |||
PhysicalNode(Address addr) : addr_(addr) {}; | PhysicalNode(Address addr) : addr_(addr) {}; | |||
Address addr_; | Address addr_; | |||
}; | }; | |||
class COMMON_EXPORT VirtualNode : public Node { | class COMMON_EXPORT VirtualNode : public Node { | |||
friend class Edge; | friend class Edge; | |||
friend class Graph; | friend class Graph; | |||
public: | public: | |||
typedef dyn_detail::boost::shared_ptr<VirtualNode> Ptr; | typedef boost::shared_ptr<VirtualNode> Ptr; | |||
static Node::Ptr createNode(); | static Node::Ptr createNode(); | |||
static Node::Ptr createNode(std::string name); | static Node::Ptr createNode(std::string name); | |||
virtual std::string format() const; | virtual std::string format() const; | |||
virtual Node::Ptr copy(); | virtual Node::Ptr copy(); | |||
virtual bool isVirtual() const { return true; } | virtual bool isVirtual() const { return true; } | |||
virtual ~VirtualNode() {}; | virtual ~VirtualNode() {}; | |||
End of changes. 9 change blocks. | ||||
15 lines changed or deleted | 18 lines changed or added | |||
ProcReader.h | ProcReader.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 36 | 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. 4 change blocks. | ||||
11 lines changed or deleted | 9 lines changed or added | |||
RangeLookup.h | RangeLookup.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
End of changes. 2 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
Region.h | Region.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 34 | 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 __REGION__H__ | #ifndef __REGION__H__ | |||
#define __REGION__H__ | #define __REGION__H__ | |||
#include "symutil.h" | ||||
#include "Serialization.h" | #include "Serialization.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 Serializable, 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 | |||
{ | { | |||
RP_R, | RP_R, | |||
skipping to change at line 102 | skipping to change at line 102 | |||
SYMTAB_EXPORT Region& operator=(const Region ®); | SYMTAB_EXPORT Region& operator=(const Region ®); | |||
SYMTAB_EXPORT std::ostream& operator<< (std::ostream &os); | SYMTAB_EXPORT std::ostream& operator<< (std::ostream &os); | |||
SYMTAB_EXPORT bool operator== (const Region ®); | SYMTAB_EXPORT bool operator== (const Region ®); | |||
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 unsigned long getRegionSize() 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 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(long); | SYMTAB_EXPORT void setMemSize(unsigned long); | |||
SYMTAB_EXPORT void setDiskSize(unsigned long); | ||||
SYMTAB_EXPORT void setFileOffset(Offset); | ||||
SYMTAB_EXPORT void *getPtrToRawData() const; | SYMTAB_EXPORT void *getPtrToRawData() const; | |||
SYMTAB_EXPORT bool setPtrToRawData(void *, unsigned long); | SYMTAB_EXPORT bool setPtrToRawData(void *, unsigned long);//also sets di skSize | |||
SYMTAB_EXPORT bool isBSS() const; | SYMTAB_EXPORT bool isBSS() const; | |||
SYMTAB_EXPORT bool isText() const; | SYMTAB_EXPORT bool isText() const; | |||
SYMTAB_EXPORT bool isData() const; | SYMTAB_EXPORT bool isData() const; | |||
SYMTAB_EXPORT bool isTLS() const; | SYMTAB_EXPORT bool isTLS() const; | |||
SYMTAB_EXPORT bool isOffsetInRegion(const Offset &offset) const; | SYMTAB_EXPORT bool isOffsetInRegion(const Offset &offset) const; | |||
SYMTAB_EXPORT bool isLoadable() const; | SYMTAB_EXPORT bool isLoadable() const; | |||
SYMTAB_EXPORT bool setLoadable(bool isLoadable); | SYMTAB_EXPORT bool setLoadable(bool isLoadable); | |||
SYMTAB_EXPORT bool isDirty() const; | SYMTAB_EXPORT bool isDirty() const; | |||
SYMTAB_EXPORT std::vector<relocationEntry> &getRelocations(); | SYMTAB_EXPORT std::vector<relocationEntry> &getRelocations(); | |||
SYMTAB_EXPORT bool patchData(Offset off, void *buf, unsigned size); | SYMTAB_EXPORT bool patchData(Offset off, void *buf, unsigned size); | |||
SYMTAB_EXPORT bool isStandardCode(); | SYMTAB_EXPORT bool isStandardCode(); | |||
SYMTAB_EXPORT perm_t getRegionPermissions() const; | SYMTAB_EXPORT perm_t getRegionPermissions() const; | |||
SYMTAB_EXPORT bool setRegionPermissions(perm_t newPerms); | SYMTAB_EXPORT bool setRegionPermissions(perm_t newPerms); | |||
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 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_; | ||||
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. 15 change blocks. | ||||
19 lines changed or deleted | 27 lines changed or added | |||
Serialization.h | Serialization.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 37 | skipping to change at line 36 | |||
* 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 (SERIALIZATION_PUBLIC_H) | #if !defined (SERIALIZATION_PUBLIC_H) | |||
#define SERIALIZATION_PUBLIC_H | #define SERIALIZATION_PUBLIC_H | |||
// Hopefully just a few definitions allowing for a public interface to | // Hopefully just a few definitions allowing for a public interface to | |||
// serializing user-providede annotations | // serializing user-providede annotations | |||
#define SERIALIZATION_DISABLED | ||||
#if defined(SERIALIZATION_DISABLED) | ||||
#if defined(THROW_SPEC) | ||||
#undef THROW_SPEC | ||||
#endif | ||||
#define THROW_SPEC(X) | ||||
#include <stdlib.h> | ||||
namespace Dyninst { | ||||
class Serializable { | ||||
public: | ||||
virtual ~Serializable() {} | ||||
}; | ||||
class SerializerBase { | ||||
public: | ||||
virtual ~SerializerBase() {} | ||||
}; | ||||
template <class T> | ||||
class AnnotationContainer | ||||
{ | ||||
virtual bool deserialize_item(SerializerBase *) { return true; } | ||||
public: | ||||
AnnotationContainer() { } | ||||
virtual ~AnnotationContainer() { } | ||||
virtual bool addItem_impl(T t) = 0; | ||||
bool addItem(T t) { return addItem_impl(t); } | ||||
virtual const char *getElementTypename() {return NULL;} | ||||
virtual Serializable *ac_serialize_impl(SerializerBase *, co | ||||
nst char *) THROW_SPEC(SerializerError) { return NULL; }; | ||||
}; | ||||
} | ||||
#else | ||||
#include <stdio.h> | #include <stdio.h> | |||
#include <assert.h> | #include <assert.h> | |||
#include <string.h> | #include <string.h> | |||
#include <stdexcept> | #include <stdexcept> | |||
#include <typeinfo> | #include <typeinfo> | |||
#include <vector> | #include <vector> | |||
#include <map> | #include <map> | |||
#include <assert.h> | #include <assert.h> | |||
#include "dyntypes.h" | #include "dyntypes.h" | |||
#include "util.h" | #include "util.h" | |||
#include "Annotatable.h" | #include "Annotatable.h" | |||
#include "dyn_detail/boost/type_traits/is_fundamental.hpp" | #include "boost/type_traits/is_fundamental.hpp" | |||
#include "dyn_detail/boost/type_traits/is_const.hpp" | #include "boost/type_traits/is_const.hpp" | |||
#include "dyn_detail/boost/type_traits/remove_cv.hpp" | #include "boost/type_traits/remove_cv.hpp" | |||
#include "dyn_detail/boost/type_traits/is_pointer.hpp" | #include "boost/type_traits/is_pointer.hpp" | |||
#include "dyn_detail/boost/type_traits/is_enum.hpp" | #include "boost/type_traits/is_enum.hpp" | |||
#include "dyn_detail/boost/type_traits/alignment_of.hpp" | #include "boost/type_traits/alignment_of.hpp" | |||
#include "dyn_detail/boost/type_traits/type_with_alignment.hpp" | #include "boost/type_traits/type_with_alignment.hpp" | |||
#include "dyn_detail/boost/type_traits/remove_pointer.hpp" | #include "boost/type_traits/remove_pointer.hpp" | |||
#define SERIALIZE_CONTROL_ENV_VAR "DYNINST_SERIALIZE_ENABLE" | #define SERIALIZE_CONTROL_ENV_VAR "DYNINST_SERIALIZE_ENABLE" | |||
#define SERIALIZE_DISABLE "disable" | #define SERIALIZE_DISABLE "disable" | |||
#define SERIALIZE_ONLY "serialize_but_dont_deserialize" | #define SERIALIZE_ONLY "serialize_but_dont_deserialize" | |||
#define SERIALIZE_DESERIALIZE "deserialize" | #define SERIALIZE_DESERIALIZE "deserialize" | |||
#define SERIALIZE_DESERIALIZE_OR_DIE "deser_or_die" | #define SERIALIZE_DESERIALIZE_OR_DIE "deser_or_die" | |||
#define DESERIALIZE_FORCE_ENV_VAR "DYNINST_DESERIALIZE_FORCE" | #define DESERIALIZE_FORCE_ENV_VAR "DYNINST_DESERIALIZE_FORCE" | |||
namespace Dyninst | namespace Dyninst | |||
{ | { | |||
skipping to change at line 1667 | skipping to change at line 1702 | |||
catch (const SerializerError &err_) | catch (const SerializerError &err_) | |||
{ | { | |||
fprintf(stderr, "%s[%d]: gtranslate failed\n", __FILE__, __LINE__); | fprintf(stderr, "%s[%d]: gtranslate failed\n", __FILE__, __LINE__); | |||
printSerErr(err_); | printSerErr(err_); | |||
return false; | return false; | |||
} | } | |||
return true; | return true; | |||
} | } | |||
} /* namespace Dyninst */ | } /* namespace Dyninst */ | |||
#endif | ||||
#endif | #endif | |||
End of changes. 5 change blocks. | ||||
15 lines changed or deleted | 54 lines changed or added | |||
SymReader.h | SymReader.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 50 | skipping to change at line 49 | |||
class SymbolReaderFactory; | class SymbolReaderFactory; | |||
/** | /** | |||
* Symbol_t is an anonymous struct that any SymReader can use for a symbol | * Symbol_t is an anonymous struct that any SymReader can use for a symbol | |||
* handle. Some symbol readers may not want to store the objects behind a | * handle. Some symbol readers may not want to store the objects behind a | |||
* 'void*' on the heap, so we're making Symbol_t big enough that it could | * 'void*' on the heap, so we're making Symbol_t big enough that it could | |||
* act as a full symbol handle. Or a SymReader could just choose fill in o ne | * act as a full symbol handle. Or a SymReader could just choose fill in o ne | |||
* of the void pointers as a handle to a heap object, if it's comfortable | * of the void pointers as a handle to a heap object, if it's comfortable | |||
* doing so. | * doing so. | |||
**/ | **/ | |||
typedef struct { | struct Symbol_t { | |||
void *v1; | void *v1; | |||
void *v2; | void *v2; | |||
int i1; | int i1; | |||
int i2; | int i2; | |||
} Symbol_t; | }; | |||
typedef struct { | struct Section_t { | |||
void *v1; | void *v1; | |||
void *v2; | void *v2; | |||
int i1; | int i1; | |||
int i2; | int i2; | |||
} Section_t; | }; | |||
typedef struct { | struct SymSegment { | |||
Dyninst::Offset file_offset; | Dyninst::Offset file_offset; | |||
Dyninst::Address mem_addr; | Dyninst::Address mem_addr; | |||
size_t file_size; | size_t file_size; | |||
size_t mem_size; | size_t mem_size; | |||
int type; | int type; | |||
int perms; | int perms; | |||
} SymRegion; | }; | |||
/** | /** | |||
* This may seem like a clunky interface in places, but it was designed suc h | * This may seem like a clunky interface in places, but it was designed suc h | |||
* that the underlying implementation could be made re-enterant safe (so it | * that the underlying implementation could be made re-enterant safe (so it | |||
* could be called from a signal handler). | * could be called from a signal handler). | |||
**/ | **/ | |||
class SymReader | class COMMON_EXPORT SymReader | |||
{ | { | |||
protected: | protected: | |||
SymReader() {}; | SymReader() {} | |||
virtual ~SymReader() {}; | virtual ~SymReader() {} | |||
public: | public: | |||
virtual Symbol_t getSymbolByName(std::string symname) = 0; | virtual Symbol_t getSymbolByName(std::string symname) = 0; | |||
virtual Symbol_t getContainingSymbol(Dyninst::Offset offset) = 0; | virtual Symbol_t getContainingSymbol(Dyninst::Offset offset) = 0; | |||
virtual std::string getInterpreterName() = 0; | virtual std::string getInterpreterName() = 0; | |||
virtual unsigned getAddressWidth() = 0; | virtual unsigned getAddressWidth() = 0; | |||
virtual unsigned numRegions() = 0; | virtual unsigned numSegments() = 0; | |||
virtual bool getRegion(unsigned num, SymRegion ®) = 0; | virtual bool getSegment(unsigned num, SymSegment ®) = 0; | |||
virtual Dyninst::Offset getSymbolOffset(const Symbol_t &sym) = 0; | virtual Dyninst::Offset getSymbolOffset(const Symbol_t &sym) = 0; | |||
virtual std::string getSymbolName(const Symbol_t &sym) = 0; | virtual std::string getSymbolName(const Symbol_t &sym) = 0; | |||
virtual std::string getDemangledName(const Symbol_t &sym) = 0; | virtual std::string getDemangledName(const Symbol_t &sym) = 0; | |||
virtual unsigned long getSymbolSize(const Symbol_t &sym) = 0; | virtual unsigned long getSymbolSize(const Symbol_t &sym) = 0; | |||
virtual bool isValidSymbol(const Symbol_t &sym) = 0; | virtual bool isValidSymbol(const Symbol_t &sym) = 0; | |||
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 int getFD() | ||||
{ | ||||
return 0; | ||||
} | ||||
}; | }; | |||
class 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; | |||
}; | }; | |||
} | } | |||
extern "C" { | extern "C" { | |||
Dyninst::SymbolReaderFactory *getSymReaderFactory(); | Dyninst::SymbolReaderFactory *getSymReaderFactory(); | |||
} | } | |||
End of changes. 14 change blocks. | ||||
21 lines changed or deleted | 27 lines changed or added | |||
Symbol.h | Symbol.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 129 | skipping to change at line 128 | |||
SV_INTERNAL, | SV_INTERNAL, | |||
SV_HIDDEN, | SV_HIDDEN, | |||
SV_PROTECTED | SV_PROTECTED | |||
}; | }; | |||
static const char *symbolVisibility2Str(SymbolVisibility t); | static const char *symbolVisibility2Str(SymbolVisibility t); | |||
SYMTAB_EXPORT Symbol(); | SYMTAB_EXPORT Symbol(); | |||
SYMTAB_EXPORT static Symbol *magicEmitElfSymbol(); | SYMTAB_EXPORT static Symbol *magicEmitElfSymbol(); | |||
SYMTAB_EXPORT Symbol (const std::string name, | SYMTAB_EXPORT Symbol (const std::string& name, | |||
SymbolType t, | SymbolType t, | |||
SymbolLinkage l, | SymbolLinkage l, | |||
SymbolVisibility v, | SymbolVisibility v, | |||
Offset o, | Offset o, | |||
Module *module = NULL, | Module *module = NULL, | |||
Region *r = NULL, | Region *r = NULL, | |||
unsigned s = 0, | unsigned s = 0, | |||
bool d = false, | bool d = false, | |||
bool a = false, | bool a = false, | |||
int index= -1, | int index= -1, | |||
skipping to change at line 193 | skipping to change at line 192 | |||
SYMTAB_EXPORT Symbol* getReferringSymbol (); | SYMTAB_EXPORT Symbol* getReferringSymbol (); | |||
//////////////// Modification | //////////////// Modification | |||
SYMTAB_EXPORT bool setOffset (Offset newOffset); | SYMTAB_EXPORT bool setOffset (Offset newOffset); | |||
SYMTAB_EXPORT bool setPtrOffset (Offset newOffset); | SYMTAB_EXPORT bool setPtrOffset (Offset newOffset); | |||
SYMTAB_EXPORT bool setLocalTOC (Offset localTOC); | SYMTAB_EXPORT bool setLocalTOC (Offset localTOC); | |||
SYMTAB_EXPORT bool setSize(unsigned ns); | SYMTAB_EXPORT bool setSize(unsigned ns); | |||
SYMTAB_EXPORT bool setRegion(Region *r); | SYMTAB_EXPORT bool setRegion(Region *r); | |||
SYMTAB_EXPORT bool setModule(Module *mod); | SYMTAB_EXPORT bool setModule(Module *mod); | |||
SYMTAB_EXPORT bool setMangledName(std::string &name); | SYMTAB_EXPORT bool setMangledName(std::string name); | |||
SYMTAB_EXPORT bool setPrettyName(std::string &name); | ||||
SYMTAB_EXPORT bool setTypedName(std::string &name); | ||||
SYMTAB_EXPORT bool setSymbolType(SymbolType sType); | SYMTAB_EXPORT bool setSymbolType(SymbolType sType); | |||
SYMTAB_EXPORT SymbolTag tag () const; | SYMTAB_EXPORT SymbolTag tag () const; | |||
SYMTAB_EXPORT bool setDynamic(bool d) { isDynamic_ = d; return true;} | SYMTAB_EXPORT bool setDynamic(bool d) { isDynamic_ = d; return true;} | |||
SYMTAB_EXPORT bool setAbsolute(bool a) { isAbsolute_ = a; return true; } | SYMTAB_EXPORT bool setAbsolute(bool a) { isAbsolute_ = a; return true; } | |||
SYMTAB_EXPORT bool setCommonStorage(bool cs) { isCommonStorage_ = cs; r eturn true; } | SYMTAB_EXPORT bool setCommonStorage(bool cs) { isCommonStorage_ = cs; r eturn true; } | |||
SYMTAB_EXPORT bool setVersionFileName(std::string &fileName); | SYMTAB_EXPORT bool setVersionFileName(std::string &fileName); | |||
SYMTAB_EXPORT bool setVersions(std::vector<std::string> &vers); | SYMTAB_EXPORT bool setVersions(std::vector<std::string> &vers); | |||
skipping to change at line 217 | 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 278 | 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. 6 change blocks. | ||||
30 lines changed or deleted | 17 lines changed or added | |||
Symtab.h | Symtab.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 46 | skipping to change at line 45 | |||
#include "Symbol.h" | #include "Symbol.h" | |||
#include "Module.h" | #include "Module.h" | |||
#include "Region.h" | #include "Region.h" | |||
#include "Annotatable.h" | #include "Annotatable.h" | |||
#include "Serialization.h" | #include "Serialization.h" | |||
#include "ProcReader.h" | #include "ProcReader.h" | |||
#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 { | |||
class SymSegment; | ||||
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 94 | skipping to change at line 98 | |||
public: | public: | |||
/***** 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(char *mem_image, size_t image_size, bool &err); | SYMTAB_EXPORT Symtab(unsigned char *mem_image, size_t image_size, | |||
const std::string &name, bool defensive_binary, boo | ||||
l &err); | ||||
SYMTAB_EXPORT static bool openFile(Symtab *&obj, std::string filename); | typedef enum { | |||
SYMTAB_EXPORT static bool openFile(Symtab *&obj,char *mem_image, size_t | NotDefensive, | |||
size); | Defensive} def_t; | |||
SYMTAB_EXPORT static bool openFile(Symtab *&obj, std::string filename, | ||||
def_t defensive_binary = NotDefensive | ||||
); | ||||
SYMTAB_EXPORT static bool openFile(Symtab *&obj, void *mem_image, size_t | ||||
size, | ||||
std::string name, def_t defensive_bin | ||||
ary = NotDefensive); | ||||
SYMTAB_EXPORT static Symtab *findOpenSymtab(std::string filename); | SYMTAB_EXPORT static Symtab *findOpenSymtab(std::string filename); | |||
SYMTAB_EXPORT static bool closeSymtab(Symtab *); | SYMTAB_EXPORT static bool closeSymtab(Symtab *); | |||
SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *sb, | SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *sb, | |||
const char *tag = "Symtab") THROW_SPEC (SerializerError); | const char *tag = "Symtab") THROW_SPEC (SerializerError); | |||
void rebuild_symbol_hashes(SerializerBase *); | void rebuild_symbol_hashes(SerializerBase *); | |||
void rebuild_funcvar_hashes(SerializerBase *); | void rebuild_funcvar_hashes(SerializerBase *); | |||
void rebuild_module_hashes(SerializerBase *); | void rebuild_module_hashes(SerializerBase *); | |||
void rebuild_region_indexes(SerializerBase *) THROW_SPEC(SerializerError ); | void rebuild_region_indexes(SerializerBase *) THROW_SPEC(SerializerError ); | |||
static bool setup_module_up_ptrs(SerializerBase *,Symtab *st); | static bool setup_module_up_ptrs(SerializerBase *,Symtab *st); | |||
skipping to change at line 126 | skipping to change at line 137 | |||
MemRegReader *reader); | MemRegReader *reader); | |||
SYMTAB_EXPORT bool hasStackwalkDebugInfo(); | SYMTAB_EXPORT bool hasStackwalkDebugInfo(); | |||
/************************************** | /************************************** | |||
*** LOOKUP FUNCTIONS ***************** | *** LOOKUP FUNCTIONS ***************** | |||
**************************************/ | **************************************/ | |||
// Symbol | // Symbol | |||
SYMTAB_EXPORT virtual bool findSymbol(std::vector<Symbol *> &ret, | SYMTAB_EXPORT virtual bool findSymbol(std::vector<Symbol *> &ret, | |||
const std::string name, | const std::string& name, | |||
Symbol::SymbolType sType = Symbol: :ST_UNKNOWN, | Symbol::SymbolType sType = Symbol: :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 getAllSymbols(std::vector<Symbol *> &ret); | SYMTAB_EXPORT virtual bool getAllSymbols(std::vector<Symbol *> &ret); | |||
SYMTAB_EXPORT virtual bool getAllSymbolsByType(std::vector<Symbol *> &re t, | SYMTAB_EXPORT virtual bool getAllSymbolsByType(std::vector<Symbol *> &re t, | |||
Symbol::SymbolType sType); | Symbol::SymbolType sType); | |||
std::vector<Symbol *> *findSymbolByOffset(Offset); | std::vector<Symbol *> *findSymbolByOffset(Offset); | |||
// Return all undefined symbols in the binary. Currently used for findin g | // Return all undefined symbols in the binary. Currently used for findin g | |||
// the .o's in a static archive that have definitions of these symbols | // the .o's in a static archive that have definitions of these symbols | |||
SYMTAB_EXPORT bool getAllUndefinedSymbols(std::vector<Symbol *> &ret); | SYMTAB_EXPORT bool getAllUndefinedSymbols(std::vector<Symbol *> &ret); | |||
skipping to change at line 237 | skipping to change at line 250 | |||
SYMTAB_EXPORT void setTruncateLinePaths(bool value); | SYMTAB_EXPORT void setTruncateLinePaths(bool value); | |||
SYMTAB_EXPORT bool getTruncateLinePaths(); | SYMTAB_EXPORT bool getTruncateLinePaths(); | |||
/***** Type Information *****/ | /***** Type Information *****/ | |||
SYMTAB_EXPORT virtual bool findType(Type *&type, std::string name); | SYMTAB_EXPORT virtual bool findType(Type *&type, std::string name); | |||
SYMTAB_EXPORT virtual Type *findType(unsigned type_id); | SYMTAB_EXPORT virtual Type *findType(unsigned type_id); | |||
SYMTAB_EXPORT virtual bool findVariableType(Type *&type, std::string nam e); | SYMTAB_EXPORT virtual bool findVariableType(Type *&type, std::string nam e); | |||
SYMTAB_EXPORT bool addType(Type *typ); | SYMTAB_EXPORT bool addType(Type *typ); | |||
static boost::shared_ptr<builtInTypeCollection> builtInTypes(); | ||||
static boost::shared_ptr<typeCollection> stdTypes(); | ||||
SYMTAB_EXPORT static std::vector<Type *> *getAllstdTypes(); | SYMTAB_EXPORT static std::vector<Type *> *getAllstdTypes(); | |||
SYMTAB_EXPORT static std::vector<Type *> *getAllbuiltInTypes(); | SYMTAB_EXPORT static std::vector<Type *> *getAllbuiltInTypes(); | |||
SYMTAB_EXPORT void parseTypesNow(); | SYMTAB_EXPORT void parseTypesNow(); | |||
/***** 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); | |||
/***** Relocation Sections *****/ | /***** Relocation Sections *****/ | |||
SYMTAB_EXPORT bool hasRel() const; | SYMTAB_EXPORT bool hasRel() const; | |||
skipping to change at line 286 | skipping to change at line 302 | |||
SYMTAB_EXPORT bool updateData(void *buffer, unsigned size); | SYMTAB_EXPORT bool updateData(void *buffer, unsigned size); | |||
SYMTAB_EXPORT Offset getFreeOffset(unsigned size); | SYMTAB_EXPORT Offset getFreeOffset(unsigned size); | |||
SYMTAB_EXPORT bool addLibraryPrereq(std::string libname); | SYMTAB_EXPORT bool addLibraryPrereq(std::string libname); | |||
SYMTAB_EXPORT bool addSysVDynamic(long name, long value); | SYMTAB_EXPORT bool addSysVDynamic(long name, long value); | |||
SYMTAB_EXPORT bool addLinkingResource(Archive *library); | SYMTAB_EXPORT bool addLinkingResource(Archive *library); | |||
SYMTAB_EXPORT bool getLinkingResources(std::vector<Archive *> &libs); | SYMTAB_EXPORT bool getLinkingResources(std::vector<Archive *> &libs); | |||
SYMTAB_EXPORT bool addExternalSymbolReference(Symbol *externalSym, Regio n *localRegion, relocationEntry localRel); | SYMTAB_EXPORT bool addExternalSymbolReference(Symbol *externalSym, Regio n *localRegion, relocationEntry localRel); | |||
SYMTAB_EXPORT bool addTrapHeader_win(Address ptr); | ||||
SYMTAB_EXPORT bool updateRelocations(Address start, Address end, Symbol | ||||
*oldsym, Symbol *newsym); | ||||
/***** Data Member Access *****/ | /***** Data Member Access *****/ | |||
SYMTAB_EXPORT std::string file() const; | SYMTAB_EXPORT std::string file() const; | |||
SYMTAB_EXPORT std::string name() const; | SYMTAB_EXPORT std::string name() const; | |||
SYMTAB_EXPORT std::string memberName() const; | SYMTAB_EXPORT std::string memberName() const; | |||
SYMTAB_EXPORT char *mem_image() const; | SYMTAB_EXPORT char *mem_image() const; | |||
SYMTAB_EXPORT Offset imageOffset() const; | SYMTAB_EXPORT Offset imageOffset() const; | |||
SYMTAB_EXPORT Offset dataOffset() const; | SYMTAB_EXPORT Offset dataOffset() const; | |||
skipping to change at line 309 | skipping to change at line 328 | |||
// 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 Offset fileToDiskOffset(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; | |||
SYMTAB_EXPORT std::vector<std::string> &getDependencies(); | SYMTAB_EXPORT std::vector<std::string> &getDependencies(); | |||
SYMTAB_EXPORT bool removeLibraryDependency(std::string lib); | ||||
SYMTAB_EXPORT Archive *getParentArchive() const; | SYMTAB_EXPORT Archive *getParentArchive() const; | |||
/***** Error Handling *****/ | /***** Error Handling *****/ | |||
SYMTAB_EXPORT static SymtabError getLastSymtabError(); | SYMTAB_EXPORT static SymtabError getLastSymtabError(); | |||
SYMTAB_EXPORT static std::string printError(SymtabError serr); | SYMTAB_EXPORT static std::string printError(SymtabError serr); | |||
SYMTAB_EXPORT ~Symtab(); | SYMTAB_EXPORT ~Symtab(); | |||
bool delSymbol(Symbol *sym) { return deleteSymbol(sym); } | bool delSymbol(Symbol *sym) { return deleteSymbol(sym); } | |||
bool deleteSymbol(Symbol *sym); | bool deleteSymbol(Symbol *sym); | |||
static builtInTypeCollection *builtInTypes; | ||||
static typeCollection *stdTypes; | ||||
Symbol *getSymbolByIndex(unsigned); | Symbol *getSymbolByIndex(unsigned); | |||
protected: | protected: | |||
Symtab(std::string filename, std::string member_name, Offset offset, boo l &err, void *base = NULL); | Symtab(std::string filename, std::string member_name, Offset offset, boo l &err, void *base = NULL); | |||
Symtab(char *img, size_t size, std::string member_name, Offset offset, b ool &err, void *base = NULL); | Symtab(char *img, size_t size, std::string member_name, Offset offset, b ool &err, void *base = NULL); | |||
/***** Private Member Functions *****/ | /***** Private Member Functions *****/ | |||
private: | private: | |||
SYMTAB_EXPORT Symtab(std::string filename, 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 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 addSymbolToIndices(Symbol *&sym, bool undefined); | |||
bool addSymbolToAggregates(Symbol *&sym); | bool addSymbolToAggregates(Symbol *&sym); | |||
bool doNotAggregate(Symbol *&sym); | bool doNotAggregate(Symbol *&sym); | |||
bool updateIndices(Symbol *sym, std::string newName, NameType nameType); | bool updateIndices(Symbol *sym, std::string newName, NameType nameType); | |||
void setModuleLanguages(dyn_hash_map<std::string, supportedLanguages> *m od_langs); | void setModuleLanguages(dyn_hash_map<std::string, supportedLanguages> *m od_langs); | |||
void setupTypes(); | ||||
static void setupStdTypes(); | ||||
bool buildDemangledName( const std::string &mangled, | bool buildDemangledName( const std::string &mangled, | |||
std::string &pretty, | std::string &pretty, | |||
std::string &typed, | std::string &typed, | |||
bool nativeCompiler, | bool nativeCompiler, | |||
supportedLanguages lang ); | supportedLanguages lang ); | |||
// Change the type of a symbol after the fact | // Change the type of a symbol after the fact | |||
bool changeType(Symbol *sym, Symbol::SymbolType oldType); | bool changeType(Symbol *sym, Symbol::SymbolType oldType); | |||
bool changeSymbolOffset(Symbol *sym, Offset newOffset); | bool changeSymbolOffset(Symbol *sym, Offset newOffset); | |||
skipping to change at line 388 | skipping to change at line 410 | |||
// Used by binaryEdit.C... | // Used by binaryEdit.C... | |||
public: | public: | |||
SYMTAB_EXPORT bool canBeShared(); | SYMTAB_EXPORT bool canBeShared(); | |||
SYMTAB_EXPORT Module *getOrCreateModule(const std::string &modName, | SYMTAB_EXPORT Module *getOrCreateModule(const std::string &modName, | |||
const Offset modAddr); | const Offset modAddr); | |||
public: | public: | |||
//Only valid on ELF formats | //Only valid on ELF formats | |||
SYMTAB_EXPORT Offset getElfDynamicOffset(); | SYMTAB_EXPORT Offset getElfDynamicOffset(); | |||
// SymReader interface | ||||
void getSegmentsSymReader(std::vector<SymSegment> &segs); | ||||
private: | private: | |||
void createDefaultModule(); | void createDefaultModule(); | |||
Module *newModule(const std::string &name, const Offset addr, supportedL anguages lang); | Module *newModule(const std::string &name, const Offset addr, supportedL anguages lang); | |||
//bool buildFunctionLists(std::vector <Symbol *> &raw_funcs); | //bool buildFunctionLists(std::vector <Symbol *> &raw_funcs); | |||
//void enterFunctionInTables(Symbol *func, bool wasSymtab); | //void enterFunctionInTables(Symbol *func, bool wasSymtab); | |||
bool addSymtabVariables(); | bool addSymtabVariables(); | |||
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<builtInTypeCollection> setupBuiltinTypes(); | ||||
std::string member_name_; | std::string member_name_; | |||
Offset member_offset_; | Offset member_offset_; | |||
Archive * parentArchive_; | Archive * parentArchive_; | |||
MappedFile *mf; | MappedFile *mf; | |||
MappedFile *mfForDebugInfo; | MappedFile *mfForDebugInfo; | |||
Offset imageOffset_; | Offset imageOffset_; | |||
unsigned imageLen_; | unsigned imageLen_; | |||
Offset dataOffset_; | Offset dataOffset_; | |||
unsigned dataLen_; | unsigned dataLen_; | |||
skipping to change at line 433 | skipping to change at line 463 | |||
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 460 | skipping to change at line 489 | |||
//Point where new loadable sections will be inserted | //Point where new loadable sections will be inserted | |||
unsigned newSectionInsertPoint; | unsigned newSectionInsertPoint; | |||
//symbols | //symbols | |||
unsigned no_of_symbols; | unsigned no_of_symbols; | |||
// Indices | // Indices | |||
std::vector<Symbol *> everyDefinedSymbol; | std::vector<Symbol *> everyDefinedSymbol; | |||
// Subset of the above | ||||
std::vector<Symbol *> userAddedSymbols; | ||||
// hashtable for looking up undefined symbols in the dynamic symbol | // hashtable for looking up undefined symbols in the dynamic symbol | |||
// tale. Entries are referred by the relocation table entries | // tale. Entries are referred by the relocation table entries | |||
// NOT a subset of everyDefinedSymbol | // NOT a subset of everyDefinedSymbol | |||
std::map <std::string, std::vector<Symbol *> > undefDynSyms; | std::vector<Symbol *> undefDynSyms; | |||
std::map <std::string, std::vector<Symbol *> > undefDynSymsByMangledName | ||||
; | ||||
std::map <std::string, std::vector<Symbol *> > undefDynSymsByPrettyName; | ||||
std::map <std::string, std::vector<Symbol *> > undefDynSymsByTypedName; | ||||
// Symbols by offsets in the symbol table | // Symbols by offsets in the symbol table | |||
dyn_hash_map <Offset, std::vector<Symbol *> > symsByOffset; | dyn_hash_map <Offset, std::vector<Symbol *> > symsByOffset; | |||
// The raw name from the symbol table | // The raw name from the symbol table | |||
dyn_hash_map <std::string, std::vector<Symbol *> > symsByMangledName; | dyn_hash_map <std::string, std::vector<Symbol *> > symsByMangledName; | |||
// The name after we've run it through the demangler | // The name after we've run it through the demangler | |||
dyn_hash_map <std::string, std::vector<Symbol *> > symsByPrettyName; | dyn_hash_map <std::string, std::vector<Symbol *> > symsByPrettyName; | |||
skipping to change at line 561 | skipping to change at line 591 | |||
//Relocation sections | //Relocation sections | |||
bool hasRel_; | bool hasRel_; | |||
bool hasRela_; | bool hasRela_; | |||
bool hasReldyn_; | bool hasReldyn_; | |||
bool hasReladyn_; | bool hasReladyn_; | |||
bool hasRelplt_; | bool hasRelplt_; | |||
bool hasRelaplt_; | bool hasRelaplt_; | |||
bool isStaticBinary_; | bool isStaticBinary_; | |||
bool isDefensiveBinary_; | ||||
//Don't use obj_private, use getObject() instead. | //Don't use obj_private, use getObject() instead. | |||
public: | public: | |||
Object *getObject(); | Object *getObject(); | |||
private: | private: | |||
Object *obj_private; | Object *obj_private; | |||
// 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 Type *type_Error; | static boost::shared_ptr<Type> type_Error(); | |||
static 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 652 | skipping to change at line 662 | |||
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. 32 change blocks. | ||||
55 lines changed or deleted | 69 lines changed or added | |||
SymtabReader.h | SymtabReader.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 50 | skipping to change at line 49 | |||
// either define its own SymReader (as ProcControlAPI does) or it can use S ymtabAPI as | // either define its own SymReader (as ProcControlAPI does) or it can use S ymtabAPI as | |||
// its symbol reader. These SymtabReader and SymtabReaderFactory implement the SymReader | // its symbol reader. These SymtabReader and SymtabReaderFactory implement the SymReader | |||
// interface with a SymtabAPI implementation. | // interface with a SymtabAPI implementation. | |||
namespace Dyninst { | namespace Dyninst { | |||
namespace SymtabAPI { | namespace SymtabAPI { | |||
class Symtab; | class Symtab; | |||
class Region; | class Region; | |||
class FastParser; | class FastParser; | |||
class DwarfHandle; | ||||
class SymtabReaderFactory : public SymbolReaderFactory | class SYMTAB_EXPORT SymtabReaderFactory : public SymbolReaderFactory | |||
{ | { | |||
private: | private: | |||
std::map<std::string, SymReader *> open_syms; | std::map<std::string, SymReader *> open_syms; | |||
public: | public: | |||
SymtabReaderFactory(); | SymtabReaderFactory(); | |||
virtual ~SymtabReaderFactory(); | virtual ~SymtabReaderFactory(); | |||
virtual SymReader *openSymbolReader(std::string pathname); | virtual SymReader *openSymbolReader(std::string pathname); | |||
virtual SymReader *openSymbolReader(const char *buffer, unsigned long si ze); | virtual SymReader *openSymbolReader(const char *buffer, unsigned long si ze); | |||
virtual bool closeSymbolReader(SymReader *sr); | virtual bool closeSymbolReader(SymReader *sr); | |||
}; | }; | |||
class SymtabReader : public SymReader { | class SYMTAB_EXPORT SymtabReader : public SymReader { | |||
friend class SymtabReaderFactory; | friend class SymtabReaderFactory; | |||
protected: | protected: | |||
Symtab *symtab; | Symtab *symtab; | |||
int ref_count; | int ref_count; | |||
std::vector<Region *> *mapped_regions; | std::vector<SymSegment> segments; | |||
DwarfHandle *dwarf_handle; | ||||
bool ownsSymtab; | ||||
public: | public: | |||
SymtabReader(std::string file_); | SymtabReader(std::string file_); | |||
SymtabReader(const char *buffer, unsigned long size); | SymtabReader(const char *buffer, unsigned long size); | |||
SymtabReader(Symtab *s); | ||||
virtual ~SymtabReader(); | virtual ~SymtabReader(); | |||
virtual Symbol_t getSymbolByName(std::string symname); | virtual Symbol_t getSymbolByName(std::string symname); | |||
virtual unsigned long getSymbolSize(const Symbol_t &sym); | virtual unsigned long getSymbolSize(const Symbol_t &sym); | |||
virtual Symbol_t getContainingSymbol(Dyninst::Offset offset); | virtual Symbol_t getContainingSymbol(Dyninst::Offset offset); | |||
virtual std::string getInterpreterName(); | virtual std::string getInterpreterName(); | |||
virtual unsigned getAddressWidth(); | virtual unsigned getAddressWidth(); | |||
virtual unsigned numRegions(); | virtual unsigned numSegments(); | |||
virtual bool getRegion(unsigned num, SymRegion ®); | virtual bool getSegment(unsigned num, SymSegment &seg); | |||
virtual Dyninst::Offset getSymbolOffset(const Symbol_t &sym); | virtual Dyninst::Offset getSymbolOffset(const Symbol_t &sym); | |||
virtual std::string getSymbolName(const Symbol_t &sym); | virtual std::string getSymbolName(const Symbol_t &sym); | |||
virtual std::string getDemangledName(const Symbol_t &sym); | virtual std::string getDemangledName(const Symbol_t &sym); | |||
virtual bool isValidSymbol(const Symbol_t &sym); | virtual bool isValidSymbol(const Symbol_t &sym); | |||
virtual Section_t getSectionByName(std::string name); | virtual Section_t getSectionByName(std::string name); | |||
virtual Section_t getSectionByAddress(Dyninst::Address addr); | virtual Section_t getSectionByAddress(Dyninst::Address addr); | |||
virtual Dyninst::Address getSectionAddress(Section_t sec); | virtual Dyninst::Address getSectionAddress(Section_t sec); | |||
virtual std::string getSectionName(Section_t sec); | virtual std::string getSectionName(Section_t sec); | |||
virtual bool isValidSection(Section_t sec); | virtual bool isValidSection(Section_t sec); | |||
virtual Dyninst::Offset imageOffset(); | virtual Dyninst::Offset imageOffset(); | |||
virtual Dyninst::Offset dataOffset(); | virtual Dyninst::Offset dataOffset(); | |||
virtual void *getElfHandle(); | ||||
void *getDebugInfo(); | ||||
private: | ||||
void buildSegments(); | ||||
}; | }; | |||
extern "C" { | extern "C" { | |||
SymbolReaderFactory *getSymtabReaderFactory(); | SYMTAB_EXPORT SymbolReaderFactory *getSymtabReaderFactory(); | |||
} | } | |||
} | } | |||
} | } | |||
#endif | #endif | |||
End of changes. 10 change blocks. | ||||
13 lines changed or deleted | 24 lines changed or added | |||
Type.h | Type.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
End of changes. 2 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
Variable.h | Variable.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 40 | skipping to change at line 39 | |||
*/ | */ | |||
#if !defined(_Variable_h_) | #if !defined(_Variable_h_) | |||
#define _Variable_h_ | #define _Variable_h_ | |||
#include "Annotatable.h" | #include "Annotatable.h" | |||
#include "Serialization.h" | #include "Serialization.h" | |||
#include "Symtab.h" | #include "Symtab.h" | |||
#include "Aggregate.h" | #include "Aggregate.h" | |||
#include "dyn_regs.h" | #include "dyn_regs.h" | |||
#include "VariableLocation.h" | ||||
//class Dyninst::SymtabAPI::Variable; | //class Dyninst::SymtabAPI::Variable; | |||
SYMTAB_EXPORT std::ostream &operator<<(std::ostream &os, const Dyninst::Sym tabAPI::Variable &); | SYMTAB_EXPORT std::ostream &operator<<(std::ostream &os, const Dyninst::Sym tabAPI::Variable &); | |||
namespace Dyninst { | namespace Dyninst { | |||
namespace SymtabAPI { | namespace SymtabAPI { | |||
/* | ||||
* storageClass: Encodes how a variable is stored. | ||||
* | ||||
* storageAddr - Absolute address of variable. | ||||
* storageReg - Register which holds variable value. | ||||
* storageRegOffset - Address of variable = $reg + address. | ||||
*/ | ||||
typedef enum { | ||||
storageAddr, | ||||
storageReg, | ||||
storageRegOffset | ||||
} storageClass; | ||||
const char *storageClass2Str(storageClass sc); | ||||
/* | ||||
* storageRefClass: Encodes if a variable can be accessed through a registe | ||||
r/address. | ||||
* | ||||
* storageRef - There is a pointer to variable. | ||||
* storageNoRef - No reference. Value can be obtained using storageCla | ||||
ss. | ||||
*/ | ||||
typedef enum { | ||||
storageRef, | ||||
storageNoRef | ||||
} storageRefClass; | ||||
const char *storageRefClass2Str(storageRefClass sc); | ||||
//location for a variable | ||||
//Use mr_reg instead of reg for new code. reg left in for backwards | ||||
// compatibility. | ||||
class VariableLocation : public Serializable { | ||||
public: | ||||
storageClass stClass; | ||||
storageRefClass refClass; | ||||
int reg; | ||||
MachRegister mr_reg; | ||||
long frameOffset; | ||||
Address lowPC; | ||||
Address hiPC; | ||||
SYMTAB_EXPORT bool operator==(const VariableLocation &); | ||||
SYMTAB_EXPORT Serializable * serialize_impl(SerializerBase *, | ||||
const char *tag = "VariableLocation") THROW_SPEC (Se | ||||
rializerError); | ||||
}; | ||||
class Symbol; | class Symbol; | |||
class Symtab; | class Symtab; | |||
class Aggregate; | class Aggregate; | |||
class Function; | class Function; | |||
class Variable : public Aggregate, public Serializable, public AnnotatableS parse { | class Variable : public Aggregate, public Serializable, public AnnotatableS parse { | |||
friend class Symtab; | friend class Symtab; | |||
friend std::ostream &::operator<<(std::ostream &os, const Dyninst::S ymtabAPI::Variable &); | friend std::ostream &::operator<<(std::ostream &os, const Dyninst::S ymtabAPI::Variable &); | |||
private: | private: | |||
skipping to change at line 132 | 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. 8 change blocks. | ||||
58 lines changed or deleted | 17 lines changed or added | |||
dyn_regs.h | dyn_regs.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 36 | 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(DYN_REGS_H_) | #if !defined(DYN_REGS_H_) | |||
#define DYN_REGS_H_ | #define DYN_REGS_H_ | |||
#include "util.h" | #include "util.h" | |||
#include "boost/shared_ptr.hpp" | ||||
#include <assert.h> | #include <assert.h> | |||
#include <map> | #include <map> | |||
#include <string> | ||||
namespace Dyninst | namespace Dyninst | |||
{ | { | |||
typedef unsigned long MachRegisterVal; | typedef unsigned long MachRegisterVal; | |||
typedef enum | typedef enum | |||
{ | { | |||
Arch_none = 0x00000000, | Arch_none = 0x00000000, | |||
Arch_x86 = 0x14000000, | Arch_x86 = 0x14000000, | |||
Arch_x86_64 = 0x18000000, | Arch_x86_64 = 0x18000000, | |||
Arch_ppc32 = 0x24000000, | Arch_ppc32 = 0x24000000, | |||
Arch_ppc64 = 0x28000000 | Arch_ppc64 = 0x28000000 | |||
} Architecture; | } Architecture; | |||
unsigned getArchAddressWidth(Dyninst::Architecture arch); | COMMON_EXPORT bool isSegmentRegister(int regClass); | |||
COMMON_EXPORT unsigned getArchAddressWidth(Dyninst::Architecture arch); | ||||
class COMMON_EXPORT MachRegister { | class COMMON_EXPORT MachRegister { | |||
private: | private: | |||
signed int reg; | signed int reg; | |||
static std::map<signed int, const char *> *names; | ||||
typedef std::map<signed int, std::string> NameMap; | ||||
static boost::shared_ptr<MachRegister::NameMap> names(); | ||||
void init_names(); | ||||
public: | public: | |||
MachRegister(); | MachRegister(); | |||
explicit MachRegister(signed int r); | explicit MachRegister(signed int r); | |||
explicit MachRegister(signed int r, const char *n); | explicit MachRegister(signed int r, const char *n); | |||
explicit MachRegister(signed int r, std::string n); | ||||
MachRegister getBaseRegister() const; | MachRegister getBaseRegister() const; | |||
Architecture getArchitecture() const; | Architecture getArchitecture() const; | |||
bool isValid() const; | bool isValid() const; | |||
MachRegisterVal getSubRegValue(const MachRegister subreg, MachRegiste rVal &orig) const; | MachRegisterVal getSubRegValue(const MachRegister& subreg, MachRegist erVal &orig) const; | |||
const char *name() const; | std::string name() const; | |||
unsigned int size() const; | unsigned int size() const; | |||
bool operator<(const MachRegister &a) const; | bool operator<(const MachRegister &a) const; | |||
bool operator==(const MachRegister &a) const; | bool operator==(const MachRegister &a) const; | |||
operator signed int() const; | operator signed int() const; | |||
signed int val() const; | signed int val() const; | |||
unsigned int regClass() const; | unsigned int regClass() const; | |||
static MachRegister getPC(Dyninst::Architecture arch); | static MachRegister getPC(Dyninst::Architecture arch); | |||
static MachRegister getFramePointer(Dyninst::Architecture arch); | static MachRegister getFramePointer(Dyninst::Architecture arch); | |||
static MachRegister getStackPointer(Dyninst::Architecture arch); | static MachRegister getStackPointer(Dyninst::Architecture arch); | |||
skipping to change at line 111 | skipping to change at line 117 | |||
//DYN_DEFINE_REGS Should only be defined in libcommon. | //DYN_DEFINE_REGS Should only be defined in libcommon. | |||
//We want one definition, which will be in libcommon, and declarations | //We want one definition, which will be in libcommon, and declarations | |||
//for everyone else. | //for everyone else. | |||
// | // | |||
//I wanted these to be const MachRegister objects, but that changes the | //I wanted these to be const MachRegister objects, but that changes the | |||
//linker scope. Instead they're non-const. Every accessor function is | //linker scope. Instead they're non-const. Every accessor function is | |||
//const anyways, so we'll just close our eyes and pretend they're declar ed | //const anyways, so we'll just close our eyes and pretend they're declar ed | |||
//const. | //const. | |||
#define DEF_REGISTER(name, value, Arch) \ | #define DEF_REGISTER(name, value, Arch) \ | |||
const signed int i##name = (value); \ | const signed int i##name = (value); \ | |||
COMMON_EXPORT MachRegister name(i##name, Arch "::" #name); | COMMON_EXPORT MachRegister name(i##name, Arch "::" #name) | |||
#else | #else | |||
#define DEF_REGISTER(name, value, Arch) \ | #define DEF_REGISTER(name, value, Arch) \ | |||
const signed int i##name = (value); \ | const signed int i##name = (value); \ | |||
COMMON_EXPORT extern MachRegister name; | COMMON_EXPORT extern MachRegister name | |||
#endif | #endif | |||
/** | /** | |||
* For interpreting constants: | * For interpreting constants: | |||
* Lowest 16 bits (0x000000ff) is base register ID | * Lowest 16 bits (0x000000ff) is base register ID | |||
* Next 16 bits (0x0000ff00) is the aliasing and subrange ID- | * Next 16 bits (0x0000ff00) is the aliasing and subrange ID- | |||
* used on x86/x86_64 to distinguish between things like EAX and AH | * used on x86/x86_64 to distinguish between things like EAX and AH | |||
* Next 16 bits (0x00ff0000) are the register category, GPR/FPR/MMX/... | * Next 16 bits (0x00ff0000) are the register category, GPR/FPR/MMX/... | |||
* Top 16 bits (0xff000000) are the architecture. | * Top 16 bits (0xff000000) are the architecture. | |||
* | * | |||
* 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 | |||
skipping to change at line 167 | skipping to change at line 175 | |||
const signed int BASEC = 0x1; | const signed int BASEC = 0x1; | |||
const signed int BASED = 0x2; | const signed int BASED = 0x2; | |||
const signed int BASEB = 0x3; | const signed int BASEB = 0x3; | |||
const signed int BASESP = 0x4; | const signed int BASESP = 0x4; | |||
const signed int BASEBP = 0x5; | const signed int BASEBP = 0x5; | |||
const signed int BASESI = 0x6; | const signed int BASESI = 0x6; | |||
const signed int BASEDI = 0x7; | const signed int BASEDI = 0x7; | |||
const signed int FLAGS = 0x0; | const signed int FLAGS = 0x0; | |||
const signed int CF = 0x0; | const signed int CF = 0x0; | |||
const signed int FLAG1 = 0x1; | ||||
const signed int PF = 0x2; | const signed int PF = 0x2; | |||
const signed int FLAG3 = 0x3; | ||||
const signed int AF = 0x4; | const signed int AF = 0x4; | |||
const signed int FLAG5 = 0x5; | ||||
const signed int ZF = 0x6; | const signed int ZF = 0x6; | |||
const signed int SF = 0x7; | const signed int SF = 0x7; | |||
const signed int TF = 0x8; | const signed int TF = 0x8; | |||
const signed int IF = 0x9; | const signed int IF = 0x9; | |||
const signed int DF = 0xa; | const signed int DF = 0xa; | |||
const signed int OF = 0xb; | const signed int OF = 0xb; | |||
const signed int FLAGC = 0xc; | ||||
const signed int FLAGD = 0xd; | ||||
const signed int NT = 0xe; | const signed int NT = 0xe; | |||
const signed int FLAGF = 0xf; | ||||
const signed int RF = 0x10; | const signed int RF = 0x10; | |||
DEF_REGISTER(eax, BASEA | FULL | GPR | Arch_x86, "x86"); | DEF_REGISTER(eax, BASEA | FULL | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(ecx, BASEC | FULL | GPR | Arch_x86, "x86"); | DEF_REGISTER(ecx, BASEC | FULL | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(edx, BASED | FULL | GPR | Arch_x86, "x86"); | DEF_REGISTER(edx, BASED | FULL | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(ebx, BASEB | FULL | GPR | Arch_x86, "x86"); | DEF_REGISTER(ebx, BASEB | FULL | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(esp, BASESP | FULL | GPR | Arch_x86, "x86"); | DEF_REGISTER(esp, BASESP | FULL | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(ebp, BASEBP | FULL | GPR | Arch_x86, "x86"); | DEF_REGISTER(ebp, BASEBP | FULL | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(esi, BASESI | FULL | GPR | Arch_x86, "x86"); | DEF_REGISTER(esi, BASESI | FULL | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(edi, BASEDI | FULL | GPR | Arch_x86, "x86"); | DEF_REGISTER(edi, BASEDI | FULL | GPR | Arch_x86, "x86"); | |||
skipping to change at line 205 | skipping to change at line 219 | |||
DEF_REGISTER(bh, BASEB | H_REG | GPR | Arch_x86, "x86"); | DEF_REGISTER(bh, BASEB | H_REG | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(bl, BASEB | L_REG | GPR | Arch_x86, "x86"); | DEF_REGISTER(bl, BASEB | L_REG | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(bx, BASEB | W_REG | GPR | Arch_x86, "x86"); | DEF_REGISTER(bx, BASEB | W_REG | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(sp, BASESP | W_REG | GPR | Arch_x86, "x86"); | DEF_REGISTER(sp, BASESP | W_REG | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(bp, BASEBP | W_REG | GPR | Arch_x86, "x86"); | DEF_REGISTER(bp, BASEBP | W_REG | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(si, BASESI | W_REG | GPR | Arch_x86, "x86"); | DEF_REGISTER(si, BASESI | W_REG | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(di, BASEDI | W_REG | GPR | Arch_x86, "x86"); | DEF_REGISTER(di, BASEDI | W_REG | GPR | Arch_x86, "x86"); | |||
DEF_REGISTER(eip, 0x10 | FULL | Arch_x86, "x86"); | DEF_REGISTER(eip, 0x10 | FULL | Arch_x86, "x86"); | |||
DEF_REGISTER(flags, FLAGS | FULL | FLAG | Arch_x86, "x86"); | DEF_REGISTER(flags, FLAGS | FULL | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(cf, CF | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(cf, CF | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(flag1, FLAG1 | BIT | FLAG | Arch_x86, "x86"); | ||||
DEF_REGISTER(pf, PF | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(pf, PF | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(flag3, FLAG3 | BIT | FLAG | Arch_x86, "x86"); | ||||
DEF_REGISTER(af, AF | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(af, AF | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(flag5, FLAG5 | BIT | FLAG | Arch_x86, "x86"); | ||||
DEF_REGISTER(zf, ZF | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(zf, ZF | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(sf, SF | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(sf, SF | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(tf, TF | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(tf, TF | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(if_, IF | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(if_, IF | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(df, DF | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(df, DF | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(of, OF | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(of, OF | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(flagc, FLAGC | BIT | FLAG | Arch_x86, "x86"); | ||||
DEF_REGISTER(flagd, FLAGD | BIT | FLAG | Arch_x86, "x86"); | ||||
DEF_REGISTER(nt_, NT | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(nt_, NT | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(flagf, FLAGF | BIT | FLAG | Arch_x86, "x86"); | ||||
DEF_REGISTER(rf, RF | BIT | FLAG | Arch_x86, "x86"); | DEF_REGISTER(rf, RF | BIT | FLAG | Arch_x86, "x86"); | |||
DEF_REGISTER(ds, 0x0 | FULL | SEG | Arch_x86, "x86"); | DEF_REGISTER(ds, 0x0 | W_REG | SEG | Arch_x86, "x86"); | |||
DEF_REGISTER(es, 0x1 | FULL | SEG | Arch_x86, "x86"); | DEF_REGISTER(es, 0x1 | W_REG | SEG | Arch_x86, "x86"); | |||
DEF_REGISTER(fs, 0x2 | FULL | SEG | Arch_x86, "x86"); | DEF_REGISTER(fs, 0x2 | W_REG | SEG | Arch_x86, "x86"); | |||
DEF_REGISTER(gs, 0x3 | FULL | SEG | Arch_x86, "x86"); | DEF_REGISTER(gs, 0x3 | W_REG | SEG | Arch_x86, "x86"); | |||
DEF_REGISTER(cs, 0x4 | FULL | SEG | Arch_x86, "x86"); | DEF_REGISTER(cs, 0x4 | W_REG | SEG | Arch_x86, "x86"); | |||
DEF_REGISTER(ss, 0x5 | FULL | SEG | Arch_x86, "x86"); | DEF_REGISTER(ss, 0x5 | W_REG | SEG | Arch_x86, "x86"); | |||
DEF_REGISTER(oeax, 0x0 | FULL | MISC | Arch_x86, "x86"); | DEF_REGISTER(oeax, 0x0 | FULL | MISC | Arch_x86, "x86"); | |||
DEF_REGISTER(fsbase, 0x1 | FULL | MISC | Arch_x86, "x86"); | DEF_REGISTER(fsbase, 0x1 | FULL | MISC | Arch_x86, "x86"); | |||
DEF_REGISTER(gsbase, 0x2 | FULL | MISC | Arch_x86, "x86"); | DEF_REGISTER(gsbase, 0x2 | FULL | MISC | Arch_x86, "x86"); | |||
DEF_REGISTER(xmm0, 0x0 | OCT | XMM | Arch_x86, "x86"); | DEF_REGISTER(xmm0, 0x0 | OCT | XMM | Arch_x86, "x86"); | |||
DEF_REGISTER(xmm1, 0x1 | OCT | XMM | Arch_x86, "x86"); | DEF_REGISTER(xmm1, 0x1 | OCT | XMM | Arch_x86, "x86"); | |||
DEF_REGISTER(xmm2, 0x2 | OCT | XMM | Arch_x86, "x86"); | DEF_REGISTER(xmm2, 0x2 | OCT | XMM | Arch_x86, "x86"); | |||
DEF_REGISTER(xmm3, 0x3 | OCT | XMM | Arch_x86, "x86"); | DEF_REGISTER(xmm3, 0x3 | OCT | XMM | Arch_x86, "x86"); | |||
DEF_REGISTER(xmm4, 0x4 | OCT | XMM | Arch_x86, "x86"); | DEF_REGISTER(xmm4, 0x4 | OCT | XMM | Arch_x86, "x86"); | |||
DEF_REGISTER(xmm5, 0x5 | OCT | XMM | Arch_x86, "x86"); | DEF_REGISTER(xmm5, 0x5 | OCT | XMM | Arch_x86, "x86"); | |||
DEF_REGISTER(xmm6, 0x6 | OCT | XMM | Arch_x86, "x86"); | DEF_REGISTER(xmm6, 0x6 | OCT | XMM | Arch_x86, "x86"); | |||
skipping to change at line 586 | skipping to change at line 606 | |||
DEF_REGISTER(dsisr, 18 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(dsisr, 18 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(dar, 19 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(dar, 19 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(dec, 22 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(dec, 22 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(sdr1, 25 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(sdr1, 25 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(srr0, 26 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(srr0, 26 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(srr1, 27 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(srr1, 27 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(sprg0, 272 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(sprg0, 272 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(sprg1, 273 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(sprg1, 273 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(sprg2, 274 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(sprg2, 274 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(sprg3, 275 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(sprg3, 275 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(sprg4, 276 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(sprg5, 277 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(sprg6, 278 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(sprg7, 279 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(sprg3_ro, 259 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(sprg4_ro, 260 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(sprg5_ro, 261 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(sprg6_ro, 262 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(sprg7_ro, 263 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(ear, 282 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(ear, 282 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(tbl, 284 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(tbl_wo, 284 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(tbu, 285 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(tbl_ro, 268 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(tbu_wo, 285 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(tbu_ro, 269 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(pvr, 287 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(pvr, 287 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(ibat0u, 528 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(ibat0u, 528 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(ibat0l, 529 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(ibat0l, 529 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(ibat1u, 530 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(ibat1u, 530 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(ibat1l, 531 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(ibat1l, 531 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(ibat2u, 532 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(ibat2u, 532 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(ibat2l, 533 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(ibat2l, 533 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(ibat3u, 534 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(ibat3u, 534 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(ibat3l, 535 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(ibat3l, 535 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(dbat0u, 536 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(dbat0u, 536 | SPR | Arch_ppc32, "ppc32"); | |||
skipping to change at line 636 | skipping to change at line 669 | |||
DEF_REGISTER(seg7, 620 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(seg7, 620 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(cr0, 621 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(cr0, 621 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(cr1, 622 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(cr1, 622 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(cr2, 623 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(cr2, 623 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(cr3, 624 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(cr3, 624 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(cr4, 625 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(cr4, 625 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(cr5, 626 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(cr5, 626 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(cr6, 627 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(cr6, 627 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(cr7, 628 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(cr7, 628 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(cr, 629 | SPR | Arch_ppc32, "ppc32"); | DEF_REGISTER(cr, 629 | SPR | Arch_ppc32, "ppc32"); | |||
DEF_REGISTER(or3, 630 | SPR | Arch_ppc32, "ppc32"); | ||||
DEF_REGISTER(trap, 631 | SPR | Arch_ppc32, "ppc32"); | ||||
} | } | |||
namespace ppc64 { | namespace ppc64 { | |||
const signed int GPR = 0x00010000; | const signed int GPR = 0x00010000; | |||
const signed int FPR = 0x00020000; | const signed int FPR = 0x00020000; | |||
const signed int FSR = 0x00040000; | const signed int FSR = 0x00040000; | |||
const signed int SPR = 0x00080000; | const signed int SPR = 0x00080000; | |||
DEF_REGISTER(r0, 0 | GPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(r0, 0 | GPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(r1, 1 | GPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(r1, 1 | GPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(r2, 2 | GPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(r2, 2 | GPR | Arch_ppc64, "ppc64"); | |||
skipping to change at line 753 | skipping to change at line 788 | |||
DEF_REGISTER(dsisr, 18 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(dsisr, 18 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(dar, 19 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(dar, 19 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(dec, 22 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(dec, 22 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(sdr1, 25 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(sdr1, 25 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(srr0, 26 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(srr0, 26 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(srr1, 27 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(srr1, 27 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(sprg0, 272 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(sprg0, 272 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(sprg1, 273 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(sprg1, 273 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(sprg2, 274 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(sprg2, 274 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(sprg3, 275 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(sprg3, 275 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(sprg4, 276 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(sprg5, 277 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(sprg6, 278 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(sprg7, 279 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(sprg3_ro, 259 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(sprg4_ro, 260 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(sprg5_ro, 261 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(sprg6_ro, 262 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(sprg7_ro, 263 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(ear, 282 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(ear, 282 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(tbl, 284 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(tbl_wo, 284 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(tbu, 285 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(tbl_ro, 268 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(tbu_wo, 285 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(tbu_ro, 269 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(pvr, 287 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(pvr, 287 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(ibat0u, 528 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(ibat0u, 528 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(ibat0l, 529 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(ibat0l, 529 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(ibat1u, 530 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(ibat1u, 530 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(ibat1l, 531 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(ibat1l, 531 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(ibat2u, 532 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(ibat2u, 532 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(ibat2l, 533 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(ibat2l, 533 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(ibat3u, 534 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(ibat3u, 534 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(ibat3l, 535 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(ibat3l, 535 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(dbat0u, 536 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(dbat0u, 536 | SPR | Arch_ppc64, "ppc64"); | |||
skipping to change at line 803 | skipping to change at line 850 | |||
DEF_REGISTER(seg7, 620 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(seg7, 620 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(cr0, 621 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(cr0, 621 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(cr1, 622 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(cr1, 622 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(cr2, 623 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(cr2, 623 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(cr3, 624 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(cr3, 624 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(cr4, 625 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(cr4, 625 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(cr5, 626 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(cr5, 626 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(cr6, 627 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(cr6, 627 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(cr7, 628 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(cr7, 628 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(cr, 629 | SPR | Arch_ppc64, "ppc64"); | DEF_REGISTER(cr, 629 | SPR | Arch_ppc64, "ppc64"); | |||
DEF_REGISTER(or3, 630 | SPR | Arch_ppc64, "ppc64"); | ||||
DEF_REGISTER(trap, 631 | SPR | Arch_ppc64, "ppc64"); | ||||
} | } | |||
} | } | |||
#endif | #endif | |||
End of changes. 29 change blocks. | ||||
25 lines changed or deleted | 75 lines changed or added | |||
dyntypes.h | dyntypes.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 38 | 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 | |||
*/ | */ | |||
#if !defined(DYNTYPES_H) | #if !defined(DYNTYPES_H) | |||
#define DYNTYPES_H | #define DYNTYPES_H | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
#define WIN32_LEAN_AND_MEAN | #define WIN32_LEAN_AND_MEAN | |||
#include <windows.h> | #include <windows.h> | |||
#include <winsock2.h> | ||||
#endif | #endif | |||
#ifndef FILE__ | #ifndef FILE__ | |||
#define FILE__ strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE __ | #define FILE__ strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE __ | |||
#endif | #endif | |||
#if defined(_POWER) && !defined(__GNUC__) | #if defined(_POWER) && !defined(__GNUC__) | |||
#define XLC | #define XLC | |||
#endif | #endif | |||
#if defined (_MSC_VER) | #if defined (_MSC_VER) | |||
//**************** Windows ******************** | //**************** Windows ******************** | |||
#include <hash_map> | #include <hash_map> | |||
#define dyn_hash_map stdext::hash_map | #define dyn_hash_map stdext::hash_map | |||
#define dyn_hash_set std::hash_set | ||||
#define DECLTHROW(x) | #define DECLTHROW(x) | |||
#elif defined(__GNUC__) | #elif defined(__GNUC__) | |||
#include <functional> | #include <functional> | |||
#define DECLTHROW(x) throw(x) | #define DECLTHROW(x) throw(x) | |||
//***************** GCC *********************** | //***************** GCC *********************** | |||
#if (__GNUC__ > 4) || \ | #if (__GNUC__ > 4) || \ | |||
(__GNUC__ == 4 && __GNUC_MINOR__ >= 3) | (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) | |||
//**************** GCC >= 4.3.0 *********** | //**************** GCC >= 4.3.0 *********** | |||
#include <tr1/unordered_set> | #include <tr1/unordered_set> | |||
#include <tr1/unordered_map> | #include <tr1/unordered_map> | |||
skipping to change at line 119 | skipping to change at line 120 | |||
namespace Dyninst | namespace Dyninst | |||
{ | { | |||
typedef unsigned long Address; | typedef unsigned long Address; | |||
typedef unsigned long Offset; | typedef unsigned long Offset; | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
typedef int PID; | typedef int PID; | |||
typedef HANDLE PROC_HANDLE; | typedef HANDLE PROC_HANDLE; | |||
typedef HANDLE LWP; | typedef HANDLE LWP; | |||
typedef HANDLE THR_ID; | typedef HANDLE THR_ID; | |||
typedef DWORD psaddr_t; // for breakpoints; match the debug struct | ||||
#define NULL_PID INVALID_HANDLE_VALUE | #define NULL_PID -1 | |||
#define NULL_LWP INVALID_HANDLE_VALUE | #define NULL_LWP INVALID_HANDLE_VALUE | |||
#define NULL_THR_ID INVALID_HANDLE_VALUE | #define NULL_THR_ID INVALID_HANDLE_VALUE | |||
#define DYNINST_SINGLETHREADED INVALID_HANDLE_VALUE | ||||
#else | #else | |||
typedef int PID; | typedef int PID; | |||
typedef int PROC_HANDLE; | typedef int PROC_HANDLE; | |||
typedef int LWP; | typedef int LWP; | |||
typedef int THR_ID; | typedef long THR_ID; | |||
#define NULL_PID -1 | #define NULL_PID -1 | |||
#define NULL_LWP -1 | #define NULL_LWP -1 | |||
#define NULL_THR_ID -1 | #define NULL_THR_ID -1 | |||
#ifndef INVALID_HANDLE_VALUE | #ifndef INVALID_HANDLE_VALUE | |||
#define INVALID_HANDLE_VALUE -1 | #define INVALID_HANDLE_VALUE -1 | |||
#endif | #endif | |||
#endif | #endif | |||
int ThrIDToTid(Dyninst::THR_ID id); | int ThrIDToTid(Dyninst::THR_ID id); | |||
} | } | |||
namespace Dyninst | ||||
{ | ||||
typedef enum { | ||||
OSNone, | ||||
Linux, | ||||
FreeBSD, | ||||
Windows, | ||||
VxWorks, | ||||
BlueGeneL, | ||||
BlueGeneP, | ||||
BlueGeneQ | ||||
} OSType; | ||||
} | ||||
#include "dyn_regs.h" | #include "dyn_regs.h" | |||
#endif | #endif | |||
End of changes. 9 change blocks. | ||||
10 lines changed or deleted | 26 lines changed or added | |||
entryIDs.h | entryIDs.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 314 | skipping to change at line 313 | |||
e_movnti, | e_movnti, | |||
e_movntpd, | e_movntpd, | |||
e_movntps, | e_movntps, | |||
e_movntq, | e_movntq, | |||
e_movntsd, | e_movntsd, | |||
e_movntss, | e_movntss, | |||
e_movq, | e_movq, | |||
e_movq2dq, | e_movq2dq, | |||
e_movsb, | e_movsb, | |||
e_movsd, | e_movsd, | |||
e_movsd_sse, | ||||
e_movshdup, | e_movshdup, | |||
e_movsldup, | e_movsldup, | |||
e_movss, | e_movss, | |||
e_movsw, | e_movsw, | |||
e_movsx, | e_movsx, | |||
e_movsxd, | e_movsxd, | |||
e_movupd, | e_movupd, | |||
e_movups, | e_movups, | |||
e_movzx, | e_movzx, | |||
e_mul, | e_mul, | |||
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, | |||
skipping to change at line 864 | skipping to change at line 957 | |||
#if defined(__GNUC__) | #if defined(__GNUC__) | |||
//***************** GCC *********************** | //***************** GCC *********************** | |||
#if !defined(cap_tr1) | #if !defined(cap_tr1) | |||
//**************** GCC < 4.3.0 ************ | //**************** GCC < 4.3.0 ************ | |||
namespace __gnu_cxx { | namespace __gnu_cxx { | |||
template<> struct hash<entryID> { | template<> struct hash<entryID> { | |||
hash<unsigned int> h; | hash<unsigned int> h; | |||
unsigned operator()(const entryID &e) const | unsigned operator()(const entryID &e) const | |||
{ | { | |||
return h(static_cast<unsigned int>(e)); | return h(static_cast<unsigned int>(e)); | |||
}; | }; | |||
}; | }; | |||
template<> struct hash<prefixEntryID> { | template<> struct hash<prefixEntryID> { | |||
hash<unsigned int> h; | hash<unsigned int> h; | |||
unsigned operator()(const prefixEntryID &e) const | unsigned operator()(const prefixEntryID &e) const | |||
{ | { | |||
return h(static_cast<unsigned int>(e)); | return h(static_cast<unsigned int>(e)); | |||
}; | }; | |||
}; | }; | |||
} | } | |||
#else | #else | |||
namespace std | namespace std | |||
{ | { | |||
namespace tr1 | namespace tr1 | |||
{ | { | |||
template <> | template <> | |||
struct hash<entryID> | struct hash<entryID> | |||
{ | { | |||
hash<size_t> h; | hash<size_t> h; | |||
size_t operator()(const entryID &eid) const | size_t operator()(const entryID &eid) const | |||
{ | { | |||
return h(static_cast<size_t>(eid)); | return h(static_cast<size_t>(eid)); | |||
} | } | |||
}; | }; | |||
template <> | template <> | |||
struct hash<prefixEntryID> | struct hash<prefixEntryID> | |||
{ | { | |||
hash<size_t> h; | hash<size_t> h; | |||
size_t operator()(const prefixEntryID &eid) const | size_t operator()(const prefixEntryID &eid) const | |||
{ | { | |||
return h(static_cast<size_t>(eid)); | return h(static_cast<size_t>(eid)); | |||
} | } | |||
}; | }; | |||
} | } | |||
} | } | |||
#endif | #endif | |||
End of changes. 8 change blocks. | ||||
14 lines changed or deleted | 107 lines changed or added | |||
stl_utils.h | stl_utils.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
End of changes. 2 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
symutil.h | symutil.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 77 | skipping to change at line 76 | |||
const char *supportedLanguages2Str(supportedLanguages s); | const char *supportedLanguages2Str(supportedLanguages s); | |||
typedef enum { | typedef enum { | |||
obj_Unknown, | obj_Unknown, | |||
obj_SharedLib, | obj_SharedLib, | |||
obj_Executable, | obj_Executable, | |||
obj_RelocatableFile | obj_RelocatableFile | |||
} ObjectType; | } ObjectType; | |||
typedef enum { | typedef enum { | |||
Obj_Parsing, | Obj_Parsing = 0, | |||
Syms_To_Functions, | Syms_To_Functions, | |||
Build_Function_Lists, | Build_Function_Lists, | |||
No_Such_Function, | No_Such_Function, | |||
No_Such_Variable, | No_Such_Variable, | |||
No_Such_Module, | No_Such_Module, | |||
No_Such_Region, | No_Such_Region, | |||
No_Such_Symbol, | No_Such_Symbol, | |||
No_Such_Member, | No_Such_Member, | |||
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, | Bad_Frame_Data, /* 15 */ | |||
No_Frame_Entry, | No_Frame_Entry, | |||
Frame_Read_Error, | Frame_Read_Error, | |||
No_Error | Multiple_Region_Matches, | |||
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. 4 change blocks. | ||||
24 lines changed or deleted | 24 lines changed or added | |||
util.h | util.h | |||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1996-2011 Barton P. Miller | * See the dyninst/COPYRIGHT file for copyright information. | |||
* | * | |||
* We provide the Paradyn Parallel Performance Tools (below | * We provide the Paradyn Tools (below described as "Paradyn") | |||
* described as "Paradyn") on an AS IS basis, and do not warrant its | * on an AS IS basis, and do not warrant its validity or performance. | |||
* validity or performance. We reserve the right to update, modify, | * We reserve the right to update, modify, or discontinue this | |||
* or discontinue this software at any time. We shall have no | * software at any time. We shall have no obligation to supply such | |||
* obligation to supply such updates or modifications or any other | * updates or modifications or any other form of support to you. | |||
* form of support to you. | ||||
* | * | |||
* By your use of Paradyn, you understand and agree that we (or any | * By your use of Paradyn, you understand and agree that we (or any | |||
* other person or entity with proprietary rights in Paradyn) are | * other person or entity with proprietary rights in Paradyn) are | |||
* under no obligation to provide either maintenance services, | * under no obligation to provide either maintenance services, | |||
* update services, notices of latent defects, or correction of | * update services, notices of latent defects, or correction of | |||
* defects for Paradyn. | * defects for Paradyn. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
skipping to change at line 93 | skipping to change at line 92 | |||
#if defined(PARSER_LIB) | #if defined(PARSER_LIB) | |||
#define PARSER_EXPORT __declspec(dllexport) | #define PARSER_EXPORT __declspec(dllexport) | |||
#else | #else | |||
#define PARSER_EXPORT __declspec(dllimport) | #define PARSER_EXPORT __declspec(dllimport) | |||
#endif | #endif | |||
#else | #else | |||
#define PARSER_EXPORT | #define PARSER_EXPORT | |||
#endif | #endif | |||
#endif | #endif | |||
#if !defined(PATCHAPI_EXPORT) | ||||
#if defined(_MSC_VER) | ||||
#if defined(PATCHAPI_LIB) | ||||
#define PATCHAPI_EXPORT __declspec(dllexport) | ||||
#else | ||||
#define PATCHAPI_EXPORT __declspec(dllimport) | ||||
#endif | ||||
#else | ||||
#define PATCHAPI_EXPORT | ||||
#endif | ||||
#endif | ||||
#if !defined(DATAFLOW_EXPORT) | #if !defined(DATAFLOW_EXPORT) | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
#if defined(DATAFLOW_LIB) | #if defined(DATAFLOW_LIB) | |||
#define DATAFLOW_EXPORT __declspec(dllexport) | #define DATAFLOW_EXPORT __declspec(dllexport) | |||
#else | #else | |||
#define DATAFLOW_EXPORT __declspec(dllimport) | #define DATAFLOW_EXPORT __declspec(dllimport) | |||
#endif | #endif | |||
#else | #else | |||
#define DATAFLOW_EXPORT | #define DATAFLOW_EXPORT | |||
#endif | #endif | |||
#endif | #endif | |||
#if !defined(PC_EXPORT) | ||||
#if defined(_MSC_VER) | ||||
#if defined(PROCCONTROL_EXPORTS) | ||||
#define PC_EXPORT __declspec(dllexport) | ||||
#else | ||||
#define PC_EXPORT __declspec(dllimport) | ||||
#endif | ||||
#else | ||||
#define PC_EXPORT | ||||
#endif | ||||
#endif | ||||
#if !defined(SW_EXPORT) | ||||
#if defined(_MSC_VER) | ||||
#if defined(STACKWALKER_EXPORTS) | ||||
#define SW_EXPORT __declspec(dllexport) | ||||
#else | ||||
#define SW_EXPORT __declspec(dllimport) | ||||
#endif | ||||
#else | ||||
#define SW_EXPORT | ||||
#endif | ||||
#endif | ||||
#if !defined(SYMEVAL_EXPORT) | ||||
#if defined(_MSC_VER) | ||||
#if defined(SYMEVAL_LIB) | ||||
#define SYMEVAL_EXPORT __declspec(dllexport) | ||||
#else | ||||
#define SYMEVAL_EXPORT __declspec(dllimport) | ||||
#endif | ||||
#else | ||||
#define SYMEVAL_EXPORT | ||||
#endif | ||||
#endif | ||||
#if !defined(THROW) && !defined(THROW_SPEC) | #if !defined(THROW) && !defined(THROW_SPEC) | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
#define THROW_SPEC(x) | #define THROW_SPEC(x) | |||
#define THROW | #define THROW | |||
#else | #else | |||
#define THROW_SPEC(x) throw (x) | #define THROW_SPEC(x) throw (x) | |||
#define THROW throw () | #define THROW throw () | |||
#endif | #endif | |||
#endif | #endif | |||
#ifndef __UTIL_H__ | #ifndef __UTIL_H__ | |||
#define __UTIL_H__ | #define __UTIL_H__ | |||
#include <string> | ||||
#include "dyntypes.h" | #include "dyntypes.h" | |||
namespace Dyninst { | namespace Dyninst { | |||
COMMON_EXPORT unsigned addrHashCommon(const Address &addr); | COMMON_EXPORT unsigned addrHashCommon(const Address &addr); | |||
COMMON_EXPORT unsigned ptrHash(const void * addr); | COMMON_EXPORT unsigned ptrHash(const void * addr); | |||
COMMON_EXPORT unsigned ptrHash(void * addr); | COMMON_EXPORT unsigned ptrHash(void * addr); | |||
COMMON_EXPORT unsigned addrHash(const Address &addr); | COMMON_EXPORT unsigned addrHash(const Address &addr); | |||
COMMON_EXPORT unsigned addrHash4(const Address &addr); | COMMON_EXPORT unsigned addrHash4(const Address &addr); | |||
COMMON_EXPORT unsigned addrHash16(const Address &addr); | COMMON_EXPORT unsigned addrHash16(const Address &addr); | |||
End of changes. 5 change blocks. | ||||
7 lines changed or deleted | 55 lines changed or added | |||