From d08227bb68d298ef019b410fa6c0e0da29478a56 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Wed, 26 Jun 2013 21:43:57 -0400 Subject: [PATCH] Add SyscallInfoEvent model class. --- src/apps/debugger/Jamfile | 1 + src/apps/debugger/model/SyscallInfo.cpp | 54 +++++++++++++++++++++++++ src/apps/debugger/model/SyscallInfo.h | 43 ++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 src/apps/debugger/model/SyscallInfo.cpp create mode 100644 src/apps/debugger/model/SyscallInfo.h diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile index f6300edcc4..03831a5cca 100644 --- a/src/apps/debugger/Jamfile +++ b/src/apps/debugger/Jamfile @@ -154,6 +154,7 @@ Application Debugger : StackTrace.cpp Statement.cpp SymbolInfo.cpp + SyscallInfo.cpp SystemInfo.cpp Team.cpp TeamInfo.cpp diff --git a/src/apps/debugger/model/SyscallInfo.cpp b/src/apps/debugger/model/SyscallInfo.cpp new file mode 100644 index 0000000000..21b615e9e0 --- /dev/null +++ b/src/apps/debugger/model/SyscallInfo.cpp @@ -0,0 +1,54 @@ +/* + * Copyright 2013, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ + +#include "SyscallInfo.h" + +#include + + +SyscallInfo::SyscallInfo() + : + fStartTime(0), + fEndTime(0), + fReturnValue(0), + fSyscall(0) +{ + memset(fArguments, 0, sizeof(fArguments)); +} + + +SyscallInfo::SyscallInfo(const SyscallInfo& other) + : + fStartTime(other.fStartTime), + fEndTime(other.fEndTime), + fReturnValue(other.fReturnValue), + fSyscall(other.fSyscall) +{ + memcpy(fArguments, other.fArguments, sizeof(fArguments)); +} + + +SyscallInfo::SyscallInfo(bigtime_t startTime, bigtime_t endTime, + uint64 returnValue, uint32 syscall, const uint32* args) + : + fStartTime(startTime), + fEndTime(endTime), + fReturnValue(returnValue), + fSyscall(syscall) +{ + memcpy(fArguments, args, sizeof(fArguments)); +} + + +void +SyscallInfo::SetTo(bigtime_t startTime, bigtime_t endTime, uint64 returnValue, + uint32 syscall, const uint32* args) +{ + fStartTime = startTime; + fEndTime = endTime; + fReturnValue = returnValue; + fSyscall = syscall; + memcpy(fArguments, args, sizeof(fArguments)); +} diff --git a/src/apps/debugger/model/SyscallInfo.h b/src/apps/debugger/model/SyscallInfo.h new file mode 100644 index 0000000000..c2609c84a6 --- /dev/null +++ b/src/apps/debugger/model/SyscallInfo.h @@ -0,0 +1,43 @@ +/* + * Copyright 2013, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ +#ifndef SYSCALL_INFO_H +#define SYSCALL_INFO_H + +#include "Types.h" + + +class SyscallInfo { +public: + SyscallInfo(); + SyscallInfo(const SyscallInfo& other); + SyscallInfo(bigtime_t startTime, + bigtime_t endTime, + uint64 returnValue, + uint32 syscall, + const uint32* args); + + void SetTo(bigtime_t startTime, + bigtime_t endTime, + uint64 returnValue, + uint32 syscall, + const uint32* args); + + bigtime_t StartTime() const { return fStartTime; } + bigtime_t EndTime() const { return fEndTime; } + uint64 ReturnValue() const { return fReturnValue; } + uint32 Syscall() const { return fSyscall; } + + const uint32* Arguments() const { return fArguments; } + +private: + bigtime_t fStartTime; + bigtime_t fEndTime; + uint64 fReturnValue; + uint32 fSyscall; + uint32 fArguments[16]; +}; + + +#endif // SYSCALL_INFO_H