Add ReturnValueInfo class for storing function return information.
This commit is contained in:
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013, Rene Gollent, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ReturnValueInfo.h"
|
||||||
|
|
||||||
|
#include "CpuState.h"
|
||||||
|
|
||||||
|
|
||||||
|
ReturnValueInfo::ReturnValueInfo()
|
||||||
|
:
|
||||||
|
BReferenceable(),
|
||||||
|
fAddress(0),
|
||||||
|
fState(NULL)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ReturnValueInfo::ReturnValueInfo(target_addr_t address, CpuState* state)
|
||||||
|
:
|
||||||
|
BReferenceable(),
|
||||||
|
fAddress(address),
|
||||||
|
fState(state)
|
||||||
|
{
|
||||||
|
state->AcquireReference();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ReturnValueInfo::~ReturnValueInfo()
|
||||||
|
{
|
||||||
|
if (fState != NULL)
|
||||||
|
fState->ReleaseReference();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ReturnValueInfo::SetTo(target_addr_t address, CpuState* state)
|
||||||
|
{
|
||||||
|
fAddress = address;
|
||||||
|
|
||||||
|
if (fState != NULL)
|
||||||
|
fState->ReleaseReference();
|
||||||
|
|
||||||
|
fState = state;
|
||||||
|
fState->AcquireReference();
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013, Rene Gollent, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef RETURN_VALUE_INFO_H
|
||||||
|
#define RETURN_VALUE_INFO_H
|
||||||
|
|
||||||
|
#include "ObjectList.h"
|
||||||
|
#include "Referenceable.h"
|
||||||
|
#include "Types.h"
|
||||||
|
|
||||||
|
|
||||||
|
class CpuState;
|
||||||
|
|
||||||
|
|
||||||
|
class ReturnValueInfo : public BReferenceable {
|
||||||
|
public:
|
||||||
|
ReturnValueInfo();
|
||||||
|
ReturnValueInfo(target_addr_t address,
|
||||||
|
CpuState* state);
|
||||||
|
~ReturnValueInfo();
|
||||||
|
|
||||||
|
void SetTo(target_addr_t address, CpuState* state);
|
||||||
|
|
||||||
|
target_addr_t SubroutineAddress() const
|
||||||
|
{ return fAddress; }
|
||||||
|
CpuState* State() const { return fState; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
target_addr_t fAddress;
|
||||||
|
CpuState* fState;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef BObjectList<ReturnValueInfo> ReturnValueInfoList;
|
||||||
|
|
||||||
|
|
||||||
|
#endif // RETURN_VALUE_INFO_H
|
||||||
Reference in New Issue
Block a user