Skip to content

Commit

Permalink
Replace all *_EXPORT with DYNINST_EXPORT
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed May 3, 2024
1 parent 7c69b20 commit 1e213b1
Show file tree
Hide file tree
Showing 168 changed files with 1,213 additions and 1,224 deletions.
12 changes: 6 additions & 6 deletions common/h/Annotatable.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
namespace Dyninst
{

COMMON_EXPORT bool annotation_debug_flag();
COMMON_EXPORT int annotatable_printf(const char *format, ...)
DYNINST_EXPORT bool annotation_debug_flag();
DYNINST_EXPORT int annotatable_printf(const char *format, ...)
DYNINST_PRINTF_ANNOTATION(1, 2);

typedef unsigned short AnnotationClassID;
Expand All @@ -60,7 +60,7 @@ typedef bool (*anno_cmp_func_t)(void *, void*);
extern int newAnnotationClass();
extern bool void_ptr_cmp_func(void *, void *);

class COMMON_EXPORT AnnotationClassBase
class DYNINST_EXPORT AnnotationClassBase
{
private:
static std::vector<AnnotationClassBase *> *annotation_types;
Expand Down Expand Up @@ -127,9 +127,9 @@ typedef enum {
sp_rem_cont_item = 5
} ser_post_op_t;

COMMON_EXPORT const char *serPostOp2Str(ser_post_op_t);
DYNINST_EXPORT const char *serPostOp2Str(ser_post_op_t);

class COMMON_EXPORT AnnotatableDense
class DYNINST_EXPORT AnnotatableDense
{
typedef void *anno_list_t;

Expand Down Expand Up @@ -334,7 +334,7 @@ class COMMON_EXPORT AnnotatableDense

#define AN_INLINE inline

class COMMON_EXPORT AnnotatableSparse
class DYNINST_EXPORT AnnotatableSparse
{
public:
struct void_ptr_hasher
Expand Down
2 changes: 1 addition & 1 deletion common/h/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace Dyninst {
// Dyninst internal codeGen structure that aims to be more user-friendly. Tiers 2 and 3
// are TODO.

class COMMON_EXPORT Buffer {
class DYNINST_EXPORT Buffer {
public:
Buffer(Address addr, unsigned initial_size);
Buffer();
Expand Down
4 changes: 2 additions & 2 deletions common/h/DynAST.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class name : public AST { \
Children kids_; \
} \

class COMMON_EXPORT AST : public boost::enable_shared_from_this<AST> {
class DYNINST_EXPORT AST : public boost::enable_shared_from_this<AST> {
public:

// This is a global list of all AST types, including those that are not
Expand Down Expand Up @@ -234,7 +234,7 @@ class COMMON_EXPORT AST : public boost::enable_shared_from_this<AST> {
virtual bool isStrictEqual(const AST &rhs) const = 0;
};

class COMMON_EXPORT ASTVisitor {
class DYNINST_EXPORT ASTVisitor {
public:
typedef boost::shared_ptr<AST> ASTPtr;

Expand Down
4 changes: 2 additions & 2 deletions common/h/Edge.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace Dyninst {
class Graph;
class Node;

class COMMON_EXPORT Edge : public AnnotatableSparse {
class DYNINST_EXPORT Edge : public AnnotatableSparse {
friend class Node;
friend class Graph;
friend class Creator;
Expand Down Expand Up @@ -82,7 +82,7 @@ class COMMON_EXPORT Edge : public AnnotatableSparse {

class EdgeIteratorImpl;

class COMMON_EXPORT EdgeIterator {
class DYNINST_EXPORT EdgeIterator {
friend class Node;
friend class Graph;
friend class Edge;
Expand Down
2 changes: 1 addition & 1 deletion common/h/Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Node;
class NodeIterator;
class EdgeIterator;

class COMMON_EXPORT Graph : public AnnotatableSparse {
class DYNINST_EXPORT Graph : public AnnotatableSparse {
friend class Edge;
friend class Node;
friend class Creator;
Expand Down
2 changes: 1 addition & 1 deletion common/h/MachSyscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace ProcControlAPI
MachSyscall makeFromID(boost::shared_ptr<Process> proc, unsigned long id);
}

class COMMON_EXPORT MachSyscall
class DYNINST_EXPORT MachSyscall
{
public:
typedef unsigned long SyscallIDPlatform;
Expand Down
8 changes: 4 additions & 4 deletions common/h/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Graph;
class NodeIterator;
class EdgeIterator;

class COMMON_EXPORT Node {
class DYNINST_EXPORT Node {
friend class Edge;
friend class Graph;

Expand Down Expand Up @@ -114,7 +114,7 @@ class COMMON_EXPORT Node {
static const Address INVALID_ADDR;
};

class COMMON_EXPORT PhysicalNode : public Node {
class DYNINST_EXPORT PhysicalNode : public Node {
public:
typedef boost::shared_ptr<PhysicalNode> Ptr;

Expand All @@ -136,7 +136,7 @@ class COMMON_EXPORT PhysicalNode : public Node {
Address addr_;
};

class COMMON_EXPORT VirtualNode : public Node {
class DYNINST_EXPORT VirtualNode : public Node {
friend class Edge;
friend class Graph;

Expand Down Expand Up @@ -166,7 +166,7 @@ class COMMON_EXPORT VirtualNode : public Node {

class NodeIteratorImpl;

class COMMON_EXPORT NodeIterator {
class DYNINST_EXPORT NodeIterator {
friend class Node;
friend class Graph;
friend class Edge;
Expand Down
4 changes: 2 additions & 2 deletions common/h/SymReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct SymSegment {
* that the underlying implementation could be made re-enterant safe (so it
* could be called from a signal handler).
**/
class COMMON_EXPORT SymReader
class DYNINST_EXPORT SymReader
{
protected:
SymReader() {}
Expand Down Expand Up @@ -123,7 +123,7 @@ class COMMON_EXPORT SymReader

};

class COMMON_EXPORT SymbolReaderFactory
class DYNINST_EXPORT SymbolReaderFactory
{
public:
SymbolReaderFactory() {}
Expand Down
4 changes: 2 additions & 2 deletions common/h/VariableLocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef enum {
storageRegOffset
} storageClass;

COMMON_EXPORT const char *storageClass2Str(storageClass sc);
DYNINST_EXPORT const char *storageClass2Str(storageClass sc);

/*
* storageRefClass: Encodes if a variable can be accessed through a register/address.
Expand All @@ -66,7 +66,7 @@ typedef enum {
storageNoRef
} storageRefClass;

COMMON_EXPORT const char *storageRefClass2Str(storageRefClass sc);
DYNINST_EXPORT const char *storageRefClass2Str(storageRefClass sc);

//location for a variable
//Use mr_reg instead of reg for new code. reg left in for backwards
Expand Down
16 changes: 8 additions & 8 deletions common/h/concurrent.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
namespace Dyninst {

namespace dyn_c_annotations {
void COMMON_EXPORT rwinit(void*);
void COMMON_EXPORT rwdeinit(void*);
void COMMON_EXPORT wlock(void*);
void COMMON_EXPORT wunlock(void*);
void COMMON_EXPORT rlock(void*);
void COMMON_EXPORT runlock(void*);
void DYNINST_EXPORT rwinit(void*);
void DYNINST_EXPORT rwdeinit(void*);
void DYNINST_EXPORT wlock(void*);
void DYNINST_EXPORT wunlock(void*);
void DYNINST_EXPORT rlock(void*);
void DYNINST_EXPORT runlock(void*);
}

namespace concurrent {
Expand Down Expand Up @@ -207,7 +207,7 @@ class dyn_mutex : public boost::mutex {
using unique_lock = boost::unique_lock<dyn_mutex>;
};

class COMMON_EXPORT dyn_rwlock {
class DYNINST_EXPORT dyn_rwlock {
// Reader management members
boost::atomic<unsigned int> rin;
boost::atomic<unsigned int> rout;
Expand All @@ -234,7 +234,7 @@ class COMMON_EXPORT dyn_rwlock {
using shared_lock = boost::shared_lock<dyn_rwlock>;
};

class COMMON_EXPORT dyn_thread {
class DYNINST_EXPORT dyn_thread {
public:
dyn_thread();
unsigned int getId();
Expand Down
4 changes: 2 additions & 2 deletions common/h/entryIDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ enum prefixEntryID : unsigned int {
};

namespace NS_x86 {
COMMON_EXPORT extern dyn_hash_map<entryID, std::string> entryNames_IAPI;
COMMON_EXPORT extern dyn_hash_map<prefixEntryID, std::string> prefixEntryNames_IAPI;
DYNINST_EXPORT extern dyn_hash_map<entryID, std::string> entryNames_IAPI;
DYNINST_EXPORT extern dyn_hash_map<prefixEntryID, std::string> prefixEntryNames_IAPI;
}

#endif
2 changes: 1 addition & 1 deletion common/h/registers/MachRegister.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
namespace Dyninst {
typedef unsigned long MachRegisterVal;

class COMMON_EXPORT MachRegister {
class DYNINST_EXPORT MachRegister {
private:
int32_t reg;

Expand Down
4 changes: 2 additions & 2 deletions common/h/registers/reg_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
// const.
# define DEF_REGISTER(name, value, Arch) \
const signed int i##name = (value); \
COMMON_EXPORT MachRegister name(i##name, Arch "::" #name)
DYNINST_EXPORT MachRegister name(i##name, Arch "::" #name)
#else
# define DEF_REGISTER(name, value, Arch) \
const signed int i##name = (value); \
COMMON_EXPORT extern MachRegister name
DYNINST_EXPORT extern MachRegister name

#endif

Expand Down
2 changes: 1 addition & 1 deletion common/src/Annotatable.C
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int annotatable_printf(const char *format, ...)
return ret;
}

COMMON_EXPORT int AnnotationClass_nextId;
DYNINST_EXPORT int AnnotationClass_nextId;

bool void_ptr_cmp_func(void *v1, void *v2)
{
Expand Down
22 changes: 11 additions & 11 deletions common/src/MappedFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ class MappedFile {
static dyn_hash_map<std::string, MappedFile *> mapped_files;

public:
COMMON_EXPORT static MappedFile *createMappedFile(std::string fullpath_);
COMMON_EXPORT static MappedFile *createMappedFile(void *map_loc, unsigned long size_, const std::string &name);
COMMON_EXPORT static void closeMappedFile(MappedFile *&mf);
DYNINST_EXPORT static MappedFile *createMappedFile(std::string fullpath_);
DYNINST_EXPORT static MappedFile *createMappedFile(void *map_loc, unsigned long size_, const std::string &name);
DYNINST_EXPORT static void closeMappedFile(MappedFile *&mf);

COMMON_EXPORT std::string filename();
COMMON_EXPORT void *base_addr() {return map_addr;}
DYNINST_EXPORT std::string filename();
DYNINST_EXPORT void *base_addr() {return map_addr;}
#if defined(os_windows)
COMMON_EXPORT HANDLE getFileHandle() {return hFile;}
DYNINST_EXPORT HANDLE getFileHandle() {return hFile;}
#else
COMMON_EXPORT int getFD() {return fd;}
DYNINST_EXPORT int getFD() {return fd;}
#endif
COMMON_EXPORT unsigned long size() {return file_size;}
COMMON_EXPORT MappedFile *clone() { refCount++; return this; }
DYNINST_EXPORT unsigned long size() {return file_size;}
DYNINST_EXPORT MappedFile *clone() { refCount++; return this; }

COMMON_EXPORT void setSharing(bool s);
COMMON_EXPORT bool canBeShared();
DYNINST_EXPORT void setSharing(bool s);
DYNINST_EXPORT bool canBeShared();

private:

Expand Down
2 changes: 1 addition & 1 deletion common/src/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* class timer
************************************************************************/

class COMMON_EXPORT timer {
class DYNINST_EXPORT timer {
public:
timer ();
timer (const timer &);
Expand Down
6 changes: 3 additions & 3 deletions common/src/addrtranslate.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ using namespace std;

namespace Dyninst {

class COMMON_EXPORT LoadedLib {
class DYNINST_EXPORT LoadedLib {
friend class AddressTranslate;
friend class AddressTranslateSysV;
protected:
Expand Down Expand Up @@ -90,15 +90,15 @@ class COMMON_EXPORT LoadedLib {

struct LoadedLibCmp
{
COMMON_EXPORT bool operator()(const LoadedLib *a, const LoadedLib *b) const
DYNINST_EXPORT bool operator()(const LoadedLib *a, const LoadedLib *b) const
{
if (a->getCodeLoadAddr() != b->getCodeLoadAddr())
return a->getCodeLoadAddr() < b->getCodeLoadAddr();
return (a->getName() < b->getName());
}
};

class COMMON_EXPORT AddressTranslate {
class DYNINST_EXPORT AddressTranslate {
protected:
PID pid;
PROC_HANDLE phandle;
Expand Down
2 changes: 1 addition & 1 deletion common/src/arch-aarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ typedef unsigned codeBufIndex_t;
// Helps to mitigate host/target endian mismatches
unsigned int swapBytesIfNeeded(unsigned int i);

class COMMON_EXPORT instruction {
class DYNINST_EXPORT instruction {
private:
instructUnion insn_;

Expand Down
4 changes: 2 additions & 2 deletions common/src/arch-power.h
Original file line number Diff line number Diff line change
Expand Up @@ -785,13 +785,13 @@ typedef unsigned codeBufIndex_t;
#define MIN_IMM48 ((long)(~MAX_IMM48)) // compilers.

// Helps to mitigate host/target endian mismatches
COMMON_EXPORT unsigned int swapBytesIfNeeded(unsigned int i);
DYNINST_EXPORT unsigned int swapBytesIfNeeded(unsigned int i);

///////////////////////////////////////////////////////
// Bum bum bum.....
///////////////////////////////////////////////////////

class COMMON_EXPORT instruction {
class DYNINST_EXPORT instruction {
private:
instructUnion insn_;

Expand Down
4 changes: 2 additions & 2 deletions common/src/arch-x86.C
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ enum {
fCMPS
};

COMMON_EXPORT dyn_hash_map<entryID, std::string> entryNames_IAPI = map_list_of
DYNINST_EXPORT dyn_hash_map<entryID, std::string> entryNames_IAPI = map_list_of
(e_aaa, "aaa")
(e_aad, "aad")
(e_aam, "aam")
Expand Down Expand Up @@ -2025,7 +2025,7 @@ dyn_hash_map<prefixEntryID, std::string> prefixEntryNames_IAPI = map_list_of
dyn_hash_map<entryID, flagInfo> ia32_instruction::flagTable;


COMMON_EXPORT dyn_hash_map<entryID, flagInfo> const& ia32_instruction::getFlagTable()
DYNINST_EXPORT dyn_hash_map<entryID, flagInfo> const& ia32_instruction::getFlagTable()
{
static std::once_flag flagTableInit;
std::call_once(flagTableInit, [&]() {
Expand Down

0 comments on commit 1e213b1

Please sign in to comment.