diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile index 3a84c23ce8..b0049c4f36 100644 --- a/src/apps/debugger/Jamfile +++ b/src/apps/debugger/Jamfile @@ -146,6 +146,7 @@ Application Debugger : Image.cpp ImageInfo.cpp ReturnValueInfo.cpp + SemaphoreInfo.cpp SourceCode.cpp StackFrame.cpp StackFrameValues.cpp diff --git a/src/apps/debugger/model/SemaphoreInfo.cpp b/src/apps/debugger/model/SemaphoreInfo.cpp new file mode 100644 index 0000000000..8d7eddd951 --- /dev/null +++ b/src/apps/debugger/model/SemaphoreInfo.cpp @@ -0,0 +1,53 @@ +/* + * Copyright 2013, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ + + +#include "SemaphoreInfo.h" + + +SemaphoreInfo::SemaphoreInfo() + : + fTeam(-1), + fSemaphore(-1), + fName(), + fCount(0), + fLatestHolder(-1) +{ +} + + +SemaphoreInfo::SemaphoreInfo(const SemaphoreInfo &other) + : + fTeam(other.fTeam), + fSemaphore(other.fSemaphore), + fName(other.fName), + fCount(other.fCount), + fLatestHolder(other.fLatestHolder) +{ +} + + +SemaphoreInfo::SemaphoreInfo(team_id team, sem_id semaphore, + const BString& name, int32 count, thread_id latestHolder) + : + fTeam(team), + fSemaphore(semaphore), + fName(name), + fCount(count), + fLatestHolder(latestHolder) +{ +} + + +void +SemaphoreInfo::SetTo(team_id team, sem_id semaphore, const BString& name, + int32 count, thread_id latestHolder) +{ + fTeam = team; + fSemaphore = semaphore; + fName = name; + fCount = count; + fLatestHolder = latestHolder; +} diff --git a/src/apps/debugger/model/SemaphoreInfo.h b/src/apps/debugger/model/SemaphoreInfo.h new file mode 100644 index 0000000000..579bdcbb3a --- /dev/null +++ b/src/apps/debugger/model/SemaphoreInfo.h @@ -0,0 +1,42 @@ +/* + * Copyright 2013, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ +#ifndef SEMAPHORE_INFO_H +#define SEMAPHORE_INFO_H + +#include +#include + +#include "Types.h" + + +class SemaphoreInfo { +public: + SemaphoreInfo(); + SemaphoreInfo(const SemaphoreInfo& other); + SemaphoreInfo(team_id team, sem_id semaphore, + const BString& name, int32 count, + thread_id latestHolder); + + void SetTo(team_id team, sem_id semaphore, + const BString& name, int32 count, + thread_id latestHolder); + + team_id TeamID() const { return fTeam; } + area_id SemID() const { return fSemaphore; } + const BString& Name() const { return fName; } + + int32 Count() const { return fCount; } + thread_id LatestHolder() const + { return fLatestHolder; } +private: + team_id fTeam; + sem_id fSemaphore; + BString fName; + int32 fCount; + thread_id fLatestHolder; +}; + + +#endif // AREA_INFO_H