Moved several classes into new "model" subdir.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31143 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
#include "StackFrame.h"
|
||||
|
||||
#include "CpuState.h"
|
||||
#include "FunctionDebugInfo.h"
|
||||
#include "Image.h"
|
||||
|
||||
|
||||
StackFrame::StackFrame(stack_frame_type type, CpuState* cpuState,
|
||||
target_addr_t frameAddress)
|
||||
:
|
||||
fType(type),
|
||||
fCpuState(cpuState),
|
||||
fFrameAddress(frameAddress),
|
||||
fReturnAddress(0),
|
||||
fImage(NULL),
|
||||
fFunction(NULL)
|
||||
{
|
||||
fCpuState->AddReference();
|
||||
}
|
||||
|
||||
|
||||
StackFrame::~StackFrame()
|
||||
{
|
||||
SetImage(NULL);
|
||||
SetFunction(NULL);
|
||||
fCpuState->RemoveReference();
|
||||
}
|
||||
|
||||
|
||||
target_addr_t
|
||||
StackFrame::InstructionPointer() const
|
||||
{
|
||||
return fCpuState->InstructionPointer();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
StackFrame::SetReturnAddress(target_addr_t address)
|
||||
{
|
||||
fReturnAddress = address;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
StackFrame::SetImage(Image* image)
|
||||
{
|
||||
if (fImage != NULL)
|
||||
fImage->RemoveReference();
|
||||
|
||||
fImage = image;
|
||||
|
||||
if (fImage != NULL)
|
||||
fImage->AddReference();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
StackFrame::SetFunction(FunctionDebugInfo* function)
|
||||
{
|
||||
if (fFunction != NULL)
|
||||
fFunction->RemoveReference();
|
||||
|
||||
fFunction = function;
|
||||
|
||||
if (fFunction != NULL)
|
||||
fFunction->AddReference();
|
||||
}
|
||||
Reference in New Issue
Block a user