Debugger: Add SignalInfo model class.
- Represents information about a signal being delivered to the team.
This commit is contained in:
parent
ce3124335f
commit
17cbae24ce
@ -177,6 +177,7 @@ Application Debugger :
|
||||
LineDataSource.cpp
|
||||
ReturnValueInfo.cpp
|
||||
SemaphoreInfo.cpp
|
||||
SignalInfo.cpp
|
||||
SourceCode.cpp
|
||||
StackFrame.cpp
|
||||
StackFrameValues.cpp
|
||||
|
46
src/apps/debugger/model/SignalInfo.cpp
Normal file
46
src/apps/debugger/model/SignalInfo.cpp
Normal 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));
|
||||
}
|
35
src/apps/debugger/model/SignalInfo.h
Normal file
35
src/apps/debugger/model/SignalInfo.h
Normal 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
|
Loading…
Reference in New Issue
Block a user