Skip to content

Commit

Permalink
Move SyscallEntryOrExit to replay_syscall.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed Mar 18, 2015
1 parent a980a00 commit 81e5ba8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
13 changes: 0 additions & 13 deletions src/Event.cc
Expand Up @@ -342,19 +342,6 @@ std::string Event::type_name() const {
}
}

const char* state_name(SyscallEntryOrExit state) {
switch (state) {
#define CASE(_id) \
case _id: \
return #_id
CASE(SYSCALL_ENTRY);
CASE(SYSCALL_EXIT);
#undef CASE
default:
return "???state";
}
}

const char* state_name(SyscallState state) {
switch (state) {
#define CASE(_id) \
Expand Down
10 changes: 0 additions & 10 deletions src/Event.h
Expand Up @@ -60,11 +60,6 @@ enum EventType {
EV_LAST
};

enum SyscallEntryOrExit {
SYSCALL_ENTRY,
SYSCALL_EXIT
};

enum HasExecInfo {
NO_EXEC_INFO,
HAS_EXEC_INFO
Expand Down Expand Up @@ -365,11 +360,6 @@ inline static std::ostream& operator<<(std::ostream& o,
return o << Event(ev);
}

/**
* Return the symbolic name of |state|, or "???state" if unknown.
*/
const char* state_name(SyscallEntryOrExit state);

const char* state_name(SyscallState state);

#endif // EVENT_H_
21 changes: 21 additions & 0 deletions src/replay_syscall.cc
Expand Up @@ -84,6 +84,27 @@ template <typename Arch> struct syscall_defs {

#endif // CHECK_SYSCALL_NUMBERS

enum SyscallEntryOrExit {
SYSCALL_ENTRY,
SYSCALL_EXIT
};

/**
* Return the symbolic name of |state|, or "???state" if unknown.
*/
static const char* state_name(SyscallEntryOrExit state) {
switch (state) {
#define CASE(_id) \
case _id: \
return #_id
CASE(SYSCALL_ENTRY);
CASE(SYSCALL_EXIT);
#undef CASE
default:
return "???state";
}
}

/**
* Proceeds until the next system call, which is not executed.
*/
Expand Down

0 comments on commit 81e5ba8

Please sign in to comment.