Debugger: Add SignalInfo model class.
- Represents information about a signal being delivered to the team.
This commit is contained in:
@@ -177,6 +177,7 @@ Application Debugger :
|
|||||||
LineDataSource.cpp
|
LineDataSource.cpp
|
||||||
ReturnValueInfo.cpp
|
ReturnValueInfo.cpp
|
||||||
SemaphoreInfo.cpp
|
SemaphoreInfo.cpp
|
||||||
|
SignalInfo.cpp
|
||||||
SourceCode.cpp
|
SourceCode.cpp
|
||||||
StackFrame.cpp
|
StackFrame.cpp
|
||||||
StackFrameValues.cpp
|
StackFrameValues.cpp
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2015, Rene Gollent, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "SignalInfo.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
SignalInfo::SignalInfo()
|
||||||
|
:
|
||||||
|
fSignal(0),
|
||||||
|
fDeadly(false)
|
||||||
|
{
|
||||||
|
memset(&fHandler, 0, sizeof(fHandler));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SignalInfo::SignalInfo(const SignalInfo& other)
|
||||||
|
:
|
||||||
|
fSignal(other.fSignal),
|
||||||
|
fDeadly(other.fDeadly)
|
||||||
|
{
|
||||||
|
memcpy(&fHandler, &other.fHandler, sizeof(fHandler));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SignalInfo::SignalInfo(int signal, const struct sigaction& handler,
|
||||||
|
bool deadly)
|
||||||
|
:
|
||||||
|
fSignal(signal),
|
||||||
|
fDeadly(deadly)
|
||||||
|
{
|
||||||
|
memcpy(&fHandler, &handler, sizeof(fHandler));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SignalInfo::SetTo(int signal, const struct sigaction& handler, bool deadly)
|
||||||
|
{
|
||||||
|
fSignal = signal;
|
||||||
|
fDeadly = deadly;
|
||||||
|
|
||||||
|
memcpy(&fHandler, &handler, sizeof(fHandler));
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2015, Rene Gollent, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef SIGNAL_INFO_H
|
||||||
|
#define SIGNAL_INFO_H
|
||||||
|
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include "Types.h"
|
||||||
|
|
||||||
|
|
||||||
|
class SignalInfo {
|
||||||
|
public:
|
||||||
|
SignalInfo();
|
||||||
|
SignalInfo(const SignalInfo& other);
|
||||||
|
SignalInfo(int signal,
|
||||||
|
const struct sigaction& handler,
|
||||||
|
bool deadly);
|
||||||
|
|
||||||
|
void SetTo(int signal,
|
||||||
|
const struct sigaction& handler,
|
||||||
|
bool deadly);
|
||||||
|
|
||||||
|
int Signal() const { return fSignal; }
|
||||||
|
const struct sigaction& Handler() const { return fHandler; }
|
||||||
|
bool Deadly() const { return fDeadly; }
|
||||||
|
private:
|
||||||
|
int fSignal;
|
||||||
|
struct sigaction fHandler;
|
||||||
|
bool fDeadly;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // SIGNAL_INFO_H
|
||||||
Reference in New Issue
Block a user