Debugger: Add SignalInfo model class.

- Represents information about a signal being delivered to the team.
This commit is contained in:
Rene Gollent 2015-06-26 22:26:50 -04:00
parent ce3124335f
commit 17cbae24ce
3 changed files with 82 additions and 0 deletions

View File

@ -177,6 +177,7 @@ Application Debugger :
LineDataSource.cpp
ReturnValueInfo.cpp
SemaphoreInfo.cpp
SignalInfo.cpp
SourceCode.cpp
StackFrame.cpp
StackFrameValues.cpp

View File

@ -0,0 +1,46 @@
/*
* Copyright 2015, Rene Gollent, rene@gollent.com.
* 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));
}

View File

@ -0,0 +1,35 @@
/*
* Copyright 2015, Rene Gollent, rene@gollent.com.
* 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