Replaced uses of obsolescent BReference[able] API.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39869 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -725,7 +725,7 @@ HeaderView::HeaderView()
|
|||||||
fState(fDefaultState)
|
fState(fDefaultState)
|
||||||
{
|
{
|
||||||
HeaderModel* model = new(std::nothrow) HeaderModel;
|
HeaderModel* model = new(std::nothrow) HeaderModel;
|
||||||
Reference<HeaderModel> modelReference(model, true);
|
BReference<HeaderModel> modelReference(model, true);
|
||||||
SetModel(model);
|
SetModel(model);
|
||||||
|
|
||||||
SetViewColor(B_TRANSPARENT_32_BIT);
|
SetViewColor(B_TRANSPARENT_32_BIT);
|
||||||
|
|||||||
@@ -58,14 +58,14 @@ SubWindow::SubWindow(SubWindowManager* manager, BRect frame, const char* title,
|
|||||||
fSubWindowKey(NULL)
|
fSubWindowKey(NULL)
|
||||||
|
|
||||||
{
|
{
|
||||||
fSubWindowManager->AddReference();
|
fSubWindowManager->AcquireReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SubWindow::~SubWindow()
|
SubWindow::~SubWindow()
|
||||||
{
|
{
|
||||||
RemoveFromSubWindowManager();
|
RemoveFromSubWindowManager();
|
||||||
fSubWindowManager->RemoveReference();
|
fSubWindowManager->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "SubWindow.h"
|
#include "SubWindow.h"
|
||||||
|
|
||||||
|
|
||||||
class SubWindowManager : public Referenceable, public BLocker {
|
class SubWindowManager : public BReferenceable, public BLocker {
|
||||||
public:
|
public:
|
||||||
SubWindowManager(BLooper* parent);
|
SubWindowManager(BLooper* parent);
|
||||||
virtual ~SubWindowManager();
|
virtual ~SubWindowManager();
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ MainWindow::~MainWindow()
|
|||||||
fModelLoader->Delete();
|
fModelLoader->Delete();
|
||||||
|
|
||||||
if (fModel != NULL)
|
if (fModel != NULL)
|
||||||
fModel->RemoveReference();
|
fModel->ReleaseReference();
|
||||||
|
|
||||||
fSubWindowManager->RemoveReference();
|
fSubWindowManager->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ printf("MSG_MODEL_LOADED_SUCCESSFULLY\n");
|
|||||||
fModelLoader->Delete();
|
fModelLoader->Delete();
|
||||||
fModelLoader = NULL;
|
fModelLoader = NULL;
|
||||||
_SetModel(model);
|
_SetModel(model);
|
||||||
model->RemoveReference();
|
model->ReleaseReference();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,12 +196,12 @@ void
|
|||||||
MainWindow::_SetModel(Model* model)
|
MainWindow::_SetModel(Model* model)
|
||||||
{
|
{
|
||||||
if (fModel != NULL)
|
if (fModel != NULL)
|
||||||
fModel->RemoveReference();
|
fModel->ReleaseReference();
|
||||||
|
|
||||||
fModel = model;
|
fModel = model;
|
||||||
|
|
||||||
if (fModel != NULL)
|
if (fModel != NULL)
|
||||||
fModel->AddReference();
|
fModel->AcquireReference();
|
||||||
|
|
||||||
fGeneralPage->SetModel(fModel);
|
fGeneralPage->SetModel(fModel);
|
||||||
fTeamsPage->SetModel(fModel);
|
fTeamsPage->SetModel(fModel);
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ ThreadWindow::ThreadWindow(SubWindowManager* manager, Model* model,
|
|||||||
|
|
||||||
fGeneralPage->SetModel(fModel, fThread);
|
fGeneralPage->SetModel(fModel, fThread);
|
||||||
|
|
||||||
fModel->AddReference();
|
fModel->AcquireReference();
|
||||||
|
|
||||||
// create a thread model loader
|
// create a thread model loader
|
||||||
fThreadModelLoader = new ThreadModelLoader(fModel, fThread,
|
fThreadModelLoader = new ThreadModelLoader(fModel, fThread,
|
||||||
@@ -77,7 +77,7 @@ ThreadWindow::~ThreadWindow()
|
|||||||
|
|
||||||
delete fThreadModel;
|
delete fThreadModel;
|
||||||
|
|
||||||
fModel->RemoveReference();
|
fModel->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const char* thread_state_name(ThreadState state);
|
|||||||
const char* wait_object_type_name(uint32 type);
|
const char* wait_object_type_name(uint32 type);
|
||||||
|
|
||||||
|
|
||||||
class Model : public Referenceable {
|
class Model : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
struct creation_time_id;
|
struct creation_time_id;
|
||||||
struct type_and_object;
|
struct type_and_object;
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ BreakpointManager::InstallTemporaryBreakpoint(target_addr_t address,
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<Breakpoint> breakpointReference(breakpoint);
|
BReference<Breakpoint> breakpointReference(breakpoint);
|
||||||
|
|
||||||
// add the client
|
// add the client
|
||||||
status_t error;
|
status_t error;
|
||||||
@@ -298,7 +298,7 @@ BreakpointManager::UninstallTemporaryBreakpoint(target_addr_t address,
|
|||||||
&& breakpoint->IsInstalled();
|
&& breakpoint->IsInstalled();
|
||||||
|
|
||||||
// if unused remove it
|
// if unused remove it
|
||||||
Reference<Breakpoint> breakpointReference(breakpoint);
|
BReference<Breakpoint> breakpointReference(breakpoint);
|
||||||
if (breakpoint->IsUnused())
|
if (breakpoint->IsUnused())
|
||||||
fTeam->RemoveBreakpoint(breakpoint);
|
fTeam->RemoveBreakpoint(breakpoint);
|
||||||
|
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ Debugger::_StartTeamDebugger(team_id teamID, thread_id threadID, bool stopInMain
|
|||||||
fprintf(stderr, "Error: Out of memory!\n");
|
fprintf(stderr, "Error: Out of memory!\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Reference<UserInterface> userInterfaceReference(userInterface, true);
|
BReference<UserInterface> userInterfaceReference(userInterface, true);
|
||||||
|
|
||||||
status_t error = B_NO_MEMORY;
|
status_t error = B_NO_MEMORY;
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ GetThreadStateJob::Do()
|
|||||||
{
|
{
|
||||||
CpuState* state = NULL;
|
CpuState* state = NULL;
|
||||||
status_t error = fDebuggerInterface->GetCpuState(fThread->ID(), state);
|
status_t error = fDebuggerInterface->GetCpuState(fThread->ID(), state);
|
||||||
Reference<CpuState> reference(state, true);
|
BReference<CpuState> reference(state, true);
|
||||||
|
|
||||||
AutoLocker<Team> locker(fThread->GetTeam());
|
AutoLocker<Team> locker(fThread->GetTeam());
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ GetCpuStateJob::Do()
|
|||||||
status_t error = fDebuggerInterface->GetCpuState(fThread->ID(), state);
|
status_t error = fDebuggerInterface->GetCpuState(fThread->ID(), state);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<CpuState> reference(state, true);
|
BReference<CpuState> reference(state, true);
|
||||||
|
|
||||||
AutoLocker<Team> locker(fThread->GetTeam());
|
AutoLocker<Team> locker(fThread->GetTeam());
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ GetStackTraceJob::Do()
|
|||||||
fCpuState, stackTrace);
|
fCpuState, stackTrace);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<StackTrace> stackTraceReference(stackTrace, true);
|
BReference<StackTrace> stackTraceReference(stackTrace, true);
|
||||||
|
|
||||||
// set the stack trace, unless something has changed
|
// set the stack trace, unless something has changed
|
||||||
AutoLocker<Team> locker(fThread->GetTeam());
|
AutoLocker<Team> locker(fThread->GetTeam());
|
||||||
@@ -483,10 +483,10 @@ ResolveValueNodeValueJob::_ResolveNodeValue()
|
|||||||
// get the node child and parent node
|
// get the node child and parent node
|
||||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||||
ValueNodeChild* nodeChild = fValueNode->NodeChild();
|
ValueNodeChild* nodeChild = fValueNode->NodeChild();
|
||||||
Reference<ValueNodeChild> nodeChildReference(nodeChild);
|
BReference<ValueNodeChild> nodeChildReference(nodeChild);
|
||||||
|
|
||||||
ValueNode* parentNode = nodeChild->Parent();
|
ValueNode* parentNode = nodeChild->Parent();
|
||||||
Reference<ValueNode> parentNodeReference(parentNode);
|
BReference<ValueNode> parentNodeReference(parentNode);
|
||||||
|
|
||||||
// Check whether the node child location has been resolved already
|
// Check whether the node child location has been resolved already
|
||||||
// (successfully).
|
// (successfully).
|
||||||
@@ -542,8 +542,8 @@ ResolveValueNodeValueJob::_ResolveNodeValue()
|
|||||||
"failed\n", fValueNode, fValueNode->Name().String());
|
"failed\n", fValueNode, fValueNode->Name().String());
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
Reference<ValueLocation> locationReference(location, true);
|
BReference<ValueLocation> locationReference(location, true);
|
||||||
Reference<Value> valueReference(value, true);
|
BReference<Value> valueReference(value, true);
|
||||||
|
|
||||||
// set location and value on the node
|
// set location and value on the node
|
||||||
containerLocker.Lock();
|
containerLocker.Lock();
|
||||||
@@ -565,7 +565,7 @@ ResolveValueNodeValueJob::_ResolveNodeChildLocation(ValueNodeChild* nodeChild)
|
|||||||
ValueLoader valueLoader(fArchitecture, fDebuggerInterface, fCpuState);
|
ValueLoader valueLoader(fArchitecture, fDebuggerInterface, fCpuState);
|
||||||
ValueLocation* location = NULL;
|
ValueLocation* location = NULL;
|
||||||
status_t error = nodeChild->ResolveLocation(&valueLoader, location);
|
status_t error = nodeChild->ResolveLocation(&valueLoader, location);
|
||||||
Reference<ValueLocation> locationReference(location, true);
|
BReference<ValueLocation> locationReference(location, true);
|
||||||
|
|
||||||
// set the location on the node child
|
// set the location on the node child
|
||||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
// #pragma mark - ImageHandler
|
// #pragma mark - ImageHandler
|
||||||
|
|
||||||
|
|
||||||
struct TeamDebugger::ImageHandler : public Referenceable,
|
struct TeamDebugger::ImageHandler : public BReferenceable,
|
||||||
private LocatableFile::Listener {
|
private LocatableFile::Listener {
|
||||||
public:
|
public:
|
||||||
ImageHandler(TeamDebugger* teamDebugger, Image* image)
|
ImageHandler(TeamDebugger* teamDebugger, Image* image)
|
||||||
@@ -233,7 +233,7 @@ TeamDebugger::Init(team_id teamID, thread_id threadID, bool stopInMain)
|
|||||||
fFileManager);
|
fFileManager);
|
||||||
if (teamDebugInfo == NULL)
|
if (teamDebugInfo == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<TeamDebugInfo> teamDebugInfoReference(teamDebugInfo);
|
BReference<TeamDebugInfo> teamDebugInfoReference(teamDebugInfo);
|
||||||
|
|
||||||
error = teamDebugInfo->Init();
|
error = teamDebugInfo->Init();
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
@@ -410,7 +410,7 @@ TeamDebugger::MessageReceived(BMessage* message)
|
|||||||
|
|
||||||
if (ThreadHandler* handler = _GetThreadHandler(threadID)) {
|
if (ThreadHandler* handler = _GetThreadHandler(threadID)) {
|
||||||
handler->HandleThreadAction(message->what);
|
handler->HandleThreadAction(message->what);
|
||||||
handler->RemoveReference();
|
handler->ReleaseReference();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -419,7 +419,7 @@ TeamDebugger::MessageReceived(BMessage* message)
|
|||||||
case MSG_CLEAR_BREAKPOINT:
|
case MSG_CLEAR_BREAKPOINT:
|
||||||
{
|
{
|
||||||
UserBreakpoint* breakpoint = NULL;
|
UserBreakpoint* breakpoint = NULL;
|
||||||
Reference<UserBreakpoint> breakpointReference;
|
BReference<UserBreakpoint> breakpointReference;
|
||||||
uint64 address = 0;
|
uint64 address = 0;
|
||||||
|
|
||||||
if (message->FindPointer("breakpoint", (void**)&breakpoint) == B_OK)
|
if (message->FindPointer("breakpoint", (void**)&breakpoint) == B_OK)
|
||||||
@@ -454,7 +454,7 @@ TeamDebugger::MessageReceived(BMessage* message)
|
|||||||
|
|
||||||
if (ThreadHandler* handler = _GetThreadHandler(threadID)) {
|
if (ThreadHandler* handler = _GetThreadHandler(threadID)) {
|
||||||
handler->HandleThreadStateChanged();
|
handler->HandleThreadStateChanged();
|
||||||
handler->RemoveReference();
|
handler->ReleaseReference();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -466,7 +466,7 @@ TeamDebugger::MessageReceived(BMessage* message)
|
|||||||
|
|
||||||
if (ThreadHandler* handler = _GetThreadHandler(threadID)) {
|
if (ThreadHandler* handler = _GetThreadHandler(threadID)) {
|
||||||
handler->HandleCpuStateChanged();
|
handler->HandleCpuStateChanged();
|
||||||
handler->RemoveReference();
|
handler->ReleaseReference();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -478,7 +478,7 @@ TeamDebugger::MessageReceived(BMessage* message)
|
|||||||
|
|
||||||
if (ThreadHandler* handler = _GetThreadHandler(threadID)) {
|
if (ThreadHandler* handler = _GetThreadHandler(threadID)) {
|
||||||
handler->HandleStackTraceChanged();
|
handler->HandleStackTraceChanged();
|
||||||
handler->RemoveReference();
|
handler->ReleaseReference();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -631,7 +631,7 @@ TeamDebugger::SetBreakpointEnabledRequested(UserBreakpoint* breakpoint,
|
|||||||
bool enabled)
|
bool enabled)
|
||||||
{
|
{
|
||||||
BMessage message(MSG_SET_BREAKPOINT);
|
BMessage message(MSG_SET_BREAKPOINT);
|
||||||
Reference<UserBreakpoint> breakpointReference(breakpoint);
|
BReference<UserBreakpoint> breakpointReference(breakpoint);
|
||||||
if (message.AddPointer("breakpoint", breakpoint) == B_OK
|
if (message.AddPointer("breakpoint", breakpoint) == B_OK
|
||||||
&& message.AddBool("enabled", enabled) == B_OK
|
&& message.AddBool("enabled", enabled) == B_OK
|
||||||
&& PostMessage(&message) == B_OK) {
|
&& PostMessage(&message) == B_OK) {
|
||||||
@@ -653,7 +653,7 @@ void
|
|||||||
TeamDebugger::ClearBreakpointRequested(UserBreakpoint* breakpoint)
|
TeamDebugger::ClearBreakpointRequested(UserBreakpoint* breakpoint)
|
||||||
{
|
{
|
||||||
BMessage message(MSG_CLEAR_BREAKPOINT);
|
BMessage message(MSG_CLEAR_BREAKPOINT);
|
||||||
Reference<UserBreakpoint> breakpointReference(breakpoint);
|
BReference<UserBreakpoint> breakpointReference(breakpoint);
|
||||||
if (message.AddPointer("breakpoint", breakpoint) == B_OK
|
if (message.AddPointer("breakpoint", breakpoint) == B_OK
|
||||||
&& PostMessage(&message) == B_OK) {
|
&& PostMessage(&message) == B_OK) {
|
||||||
breakpointReference.Detach();
|
breakpointReference.Detach();
|
||||||
@@ -805,7 +805,7 @@ TeamDebugger::_HandleDebuggerMessage(DebugEvent* event)
|
|||||||
bool handled = false;
|
bool handled = false;
|
||||||
|
|
||||||
ThreadHandler* handler = _GetThreadHandler(event->Thread());
|
ThreadHandler* handler = _GetThreadHandler(event->Thread());
|
||||||
Reference<ThreadHandler> handlerReference(handler);
|
BReference<ThreadHandler> handlerReference(handler);
|
||||||
|
|
||||||
switch (event->EventType()) {
|
switch (event->EventType()) {
|
||||||
case B_DEBUGGER_MESSAGE_THREAD_DEBUGGED:
|
case B_DEBUGGER_MESSAGE_THREAD_DEBUGGED:
|
||||||
@@ -1001,7 +1001,7 @@ TeamDebugger::_HandleThreadDeleted(ThreadDeletedEvent* event)
|
|||||||
AutoLocker< ::Team> locker(fTeam);
|
AutoLocker< ::Team> locker(fTeam);
|
||||||
if (ThreadHandler* handler = fThreadHandlers.Lookup(event->Thread())) {
|
if (ThreadHandler* handler = fThreadHandlers.Lookup(event->Thread())) {
|
||||||
fThreadHandlers.Remove(handler);
|
fThreadHandlers.Remove(handler);
|
||||||
handler->RemoveReference();
|
handler->ReleaseReference();
|
||||||
}
|
}
|
||||||
fTeam->RemoveThread(event->Thread());
|
fTeam->RemoveThread(event->Thread());
|
||||||
return false;
|
return false;
|
||||||
@@ -1029,7 +1029,7 @@ TeamDebugger::_HandleImageDeleted(ImageDeletedEvent* event)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
fImageHandlers->Remove(imageHandler);
|
fImageHandlers->Remove(imageHandler);
|
||||||
Reference<ImageHandler> imageHandlerReference(imageHandler, true);
|
BReference<ImageHandler> imageHandlerReference(imageHandler, true);
|
||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
|
|
||||||
// remove breakpoints in the image
|
// remove breakpoints in the image
|
||||||
@@ -1049,7 +1049,7 @@ TeamDebugger::_HandleImageDebugInfoChanged(image_id imageID)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Image* image = imageHandler->GetImage();
|
Image* image = imageHandler->GetImage();
|
||||||
Reference<Image> imageReference(image);
|
BReference<Image> imageReference(image);
|
||||||
|
|
||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
|
|
||||||
@@ -1079,7 +1079,7 @@ TeamDebugger::_HandleSetUserBreakpoint(target_addr_t address, bool enabled)
|
|||||||
UserBreakpoint* userBreakpoint = NULL;
|
UserBreakpoint* userBreakpoint = NULL;
|
||||||
if (breakpoint != NULL && breakpoint->FirstUserBreakpoint() != NULL)
|
if (breakpoint != NULL && breakpoint->FirstUserBreakpoint() != NULL)
|
||||||
userBreakpoint = breakpoint->FirstUserBreakpoint()->GetUserBreakpoint();
|
userBreakpoint = breakpoint->FirstUserBreakpoint()->GetUserBreakpoint();
|
||||||
Reference<UserBreakpoint> userBreakpointReference(userBreakpoint);
|
BReference<UserBreakpoint> userBreakpointReference(userBreakpoint);
|
||||||
|
|
||||||
if (userBreakpoint == NULL) {
|
if (userBreakpoint == NULL) {
|
||||||
TRACE_CONTROL(" no breakpoint yet\n");
|
TRACE_CONTROL(" no breakpoint yet\n");
|
||||||
@@ -1132,7 +1132,7 @@ TeamDebugger::_HandleSetUserBreakpoint(target_addr_t address, bool enabled)
|
|||||||
FunctionID* functionID = functionInstance->GetFunctionID();
|
FunctionID* functionID = functionInstance->GetFunctionID();
|
||||||
if (functionID == NULL)
|
if (functionID == NULL)
|
||||||
return;
|
return;
|
||||||
Reference<FunctionID> functionIDReference(functionID, true);
|
BReference<FunctionID> functionIDReference(functionID, true);
|
||||||
|
|
||||||
// create the user breakpoint
|
// create the user breakpoint
|
||||||
userBreakpoint = new(std::nothrow) UserBreakpoint(
|
userBreakpoint = new(std::nothrow) UserBreakpoint(
|
||||||
@@ -1228,7 +1228,7 @@ TeamDebugger::_HandleClearUserBreakpoint(target_addr_t address)
|
|||||||
return;
|
return;
|
||||||
UserBreakpoint* userBreakpoint
|
UserBreakpoint* userBreakpoint
|
||||||
= breakpoint->FirstUserBreakpoint()->GetUserBreakpoint();
|
= breakpoint->FirstUserBreakpoint()->GetUserBreakpoint();
|
||||||
Reference<UserBreakpoint> userBreakpointReference(userBreakpoint);
|
BReference<UserBreakpoint> userBreakpointReference(userBreakpoint);
|
||||||
|
|
||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
|
|
||||||
@@ -1250,7 +1250,7 @@ TeamDebugger::_GetThreadHandler(thread_id threadID)
|
|||||||
|
|
||||||
ThreadHandler* handler = fThreadHandlers.Lookup(threadID);
|
ThreadHandler* handler = fThreadHandlers.Lookup(threadID);
|
||||||
if (handler != NULL)
|
if (handler != NULL)
|
||||||
handler->AddReference();
|
handler->AcquireReference();
|
||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1261,7 +1261,7 @@ TeamDebugger::_AddImage(const ImageInfo& imageInfo, Image** _image)
|
|||||||
LocatableFile* file = NULL;
|
LocatableFile* file = NULL;
|
||||||
if (strchr(imageInfo.Name(), '/') != NULL)
|
if (strchr(imageInfo.Name(), '/') != NULL)
|
||||||
file = fFileManager->GetTargetFile(imageInfo.Name());
|
file = fFileManager->GetTargetFile(imageInfo.Name());
|
||||||
Reference<LocatableFile> imageFileReference(file, true);
|
BReference<LocatableFile> imageFileReference(file, true);
|
||||||
|
|
||||||
Image* image;
|
Image* image;
|
||||||
status_t error = fTeam->AddImage(imageInfo, file, &image);
|
status_t error = fTeam->AddImage(imageInfo, file, &image);
|
||||||
@@ -1308,7 +1308,7 @@ TeamDebugger::_LoadSettings()
|
|||||||
if (sourceFile == NULL)
|
if (sourceFile == NULL)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Reference<LocatableFile> sourceFileReference(sourceFile, true);
|
BReference<LocatableFile> sourceFileReference(sourceFile, true);
|
||||||
|
|
||||||
// create the breakpoint
|
// create the breakpoint
|
||||||
UserBreakpointLocation location(breakpointSetting->GetFunctionID(),
|
UserBreakpointLocation location(breakpointSetting->GetFunctionID(),
|
||||||
@@ -1318,7 +1318,7 @@ TeamDebugger::_LoadSettings()
|
|||||||
UserBreakpoint* breakpoint = new(std::nothrow) UserBreakpoint(location);
|
UserBreakpoint* breakpoint = new(std::nothrow) UserBreakpoint(location);
|
||||||
if (breakpoint == NULL)
|
if (breakpoint == NULL)
|
||||||
return;
|
return;
|
||||||
Reference<UserBreakpoint> breakpointReference(breakpoint, true);
|
BReference<UserBreakpoint> breakpointReference(breakpoint, true);
|
||||||
|
|
||||||
// install it
|
// install it
|
||||||
fBreakpointManager->InstallUserBreakpoint(breakpoint,
|
fBreakpointManager->InstallUserBreakpoint(breakpoint,
|
||||||
|
|||||||
@@ -211,8 +211,8 @@ ThreadHandler::HandleThreadAction(uint32 action)
|
|||||||
// When stepping we need a stack trace. Save it before unsetting the state.
|
// When stepping we need a stack trace. Save it before unsetting the state.
|
||||||
CpuState* cpuState = fThread->GetCpuState();
|
CpuState* cpuState = fThread->GetCpuState();
|
||||||
StackTrace* stackTrace = fThread->GetStackTrace();
|
StackTrace* stackTrace = fThread->GetStackTrace();
|
||||||
Reference<CpuState> cpuStateReference(cpuState);
|
BReference<CpuState> cpuStateReference(cpuState);
|
||||||
Reference<StackTrace> stackTraceReference(stackTrace);
|
BReference<StackTrace> stackTraceReference(stackTrace);
|
||||||
|
|
||||||
// When continuing the thread update thread state before actually issuing
|
// When continuing the thread update thread state before actually issuing
|
||||||
// the command, since we need to unlock.
|
// the command, since we need to unlock.
|
||||||
@@ -380,7 +380,7 @@ ThreadHandler::GetImageDebugInfo(Image* image, ImageDebugInfo*& _info)
|
|||||||
|
|
||||||
if (image->GetImageDebugInfo() != NULL) {
|
if (image->GetImageDebugInfo() != NULL) {
|
||||||
_info = image->GetImageDebugInfo();
|
_info = image->GetImageDebugInfo();
|
||||||
_info->AddReference();
|
_info->AcquireReference();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,7 +431,7 @@ ThreadHandler::_GetStatementAtInstructionPointer(StackFrame* frame)
|
|||||||
// Statement* statement = sourceCode->StatementAtAddress(
|
// Statement* statement = sourceCode->StatementAtAddress(
|
||||||
// frame->InstructionPointer());
|
// frame->InstructionPointer());
|
||||||
// if (statement != NULL)
|
// if (statement != NULL)
|
||||||
// statement->AddReference();
|
// statement->AcquireReference();
|
||||||
// return statement;
|
// return statement;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@@ -522,7 +522,7 @@ ThreadHandler::_ClearContinuationState()
|
|||||||
_UninstallTemporaryBreakpoint();
|
_UninstallTemporaryBreakpoint();
|
||||||
|
|
||||||
if (fStepStatement != NULL) {
|
if (fStepStatement != NULL) {
|
||||||
fStepStatement->RemoveReference();
|
fStepStatement->ReleaseReference();
|
||||||
fStepStatement = NULL;
|
fStepStatement = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,7 +593,7 @@ ThreadHandler::_HandleSingleStepStep(CpuState* cpuState)
|
|||||||
}
|
}
|
||||||
|
|
||||||
StackTrace* stackTrace = fThread->GetStackTrace();
|
StackTrace* stackTrace = fThread->GetStackTrace();
|
||||||
Reference<StackTrace> stackTraceReference(stackTrace);
|
BReference<StackTrace> stackTraceReference(stackTrace);
|
||||||
|
|
||||||
if (stackTrace == NULL && cpuState != NULL) {
|
if (stackTrace == NULL && cpuState != NULL) {
|
||||||
if (fDebuggerInterface->GetArchitecture()->CreateStackTrace(
|
if (fDebuggerInterface->GetArchitecture()->CreateStackTrace(
|
||||||
@@ -609,7 +609,7 @@ ThreadHandler::_HandleSingleStepStep(CpuState* cpuState)
|
|||||||
if (GetImageDebugInfo(image, info) != B_OK)
|
if (GetImageDebugInfo(image, info) != B_OK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Reference<ImageDebugInfo>(info, true);
|
BReference<ImageDebugInfo>(info, true);
|
||||||
if (info->GetAddressSectionType(
|
if (info->GetAddressSectionType(
|
||||||
cpuState->InstructionPointer())
|
cpuState->InstructionPointer())
|
||||||
== ADDRESS_SECTION_TYPE_PLT) {
|
== ADDRESS_SECTION_TYPE_PLT) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Statement;
|
|||||||
class Worker;
|
class Worker;
|
||||||
|
|
||||||
|
|
||||||
class ThreadHandler : public Referenceable, private ImageDebugInfoProvider,
|
class ThreadHandler : public BReferenceable, private ImageDebugInfoProvider,
|
||||||
private BreakpointClient {
|
private BreakpointClient {
|
||||||
public:
|
public:
|
||||||
ThreadHandler(Thread* thread, Worker* worker,
|
ThreadHandler(Thread* thread, Worker* worker,
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ Worker::ScheduleJob(Job* job, JobListener* listener)
|
|||||||
if (job == NULL)
|
if (job == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
Reference<Job> jobReference(job, true);
|
BReference<Job> jobReference(job, true);
|
||||||
AutoLocker<Worker> locker(this);
|
AutoLocker<Worker> locker(this);
|
||||||
|
|
||||||
if (fTerminating)
|
if (fTerminating)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
typedef DoublyLinkedList<Job> JobList;
|
typedef DoublyLinkedList<Job> JobList;
|
||||||
|
|
||||||
|
|
||||||
class Job : public Referenceable, public DoublyLinkedListLinkImpl<Job> {
|
class Job : public BReferenceable, public DoublyLinkedListLinkImpl<Job> {
|
||||||
public:
|
public:
|
||||||
Job();
|
Job();
|
||||||
virtual ~Job();
|
virtual ~Job();
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ Architecture::CreateStackTrace(Team* team,
|
|||||||
ImageDebugInfoProvider* imageInfoProvider, CpuState* cpuState,
|
ImageDebugInfoProvider* imageInfoProvider, CpuState* cpuState,
|
||||||
StackTrace*& _stackTrace)
|
StackTrace*& _stackTrace)
|
||||||
{
|
{
|
||||||
Reference<CpuState> cpuStateReference(cpuState);
|
BReference<CpuState> cpuStateReference(cpuState);
|
||||||
|
|
||||||
// create the object
|
// create the object
|
||||||
StackTrace* stackTrace = new(std::nothrow) StackTrace;
|
StackTrace* stackTrace = new(std::nothrow) StackTrace;
|
||||||
@@ -115,14 +115,15 @@ Architecture::CreateStackTrace(Team* team,
|
|||||||
// get the image for the instruction pointer
|
// get the image for the instruction pointer
|
||||||
AutoLocker<Team> teamLocker(team);
|
AutoLocker<Team> teamLocker(team);
|
||||||
Image* image = team->ImageByAddress(instructionPointer);
|
Image* image = team->ImageByAddress(instructionPointer);
|
||||||
Reference<Image> imageReference(image);
|
BReference<Image> imageReference(image);
|
||||||
teamLocker.Unlock();
|
teamLocker.Unlock();
|
||||||
|
|
||||||
// get the image debug info
|
// get the image debug info
|
||||||
ImageDebugInfo* imageDebugInfo = NULL;
|
ImageDebugInfo* imageDebugInfo = NULL;
|
||||||
if (image != NULL)
|
if (image != NULL)
|
||||||
imageInfoProvider->GetImageDebugInfo(image, imageDebugInfo);
|
imageInfoProvider->GetImageDebugInfo(image, imageDebugInfo);
|
||||||
Reference<ImageDebugInfo> imageDebugInfoReference(imageDebugInfo, true);
|
BReference<ImageDebugInfo> imageDebugInfoReference(imageDebugInfo,
|
||||||
|
true);
|
||||||
|
|
||||||
// get the function
|
// get the function
|
||||||
teamLocker.Lock();
|
teamLocker.Lock();
|
||||||
@@ -133,7 +134,7 @@ Architecture::CreateStackTrace(Team* team,
|
|||||||
if (function != NULL)
|
if (function != NULL)
|
||||||
functionDebugInfo = function->GetFunctionDebugInfo();
|
functionDebugInfo = function->GetFunctionDebugInfo();
|
||||||
}
|
}
|
||||||
Reference<FunctionInstance> functionReference(function);
|
BReference<FunctionInstance> functionReference(function);
|
||||||
teamLocker.Unlock();
|
teamLocker.Unlock();
|
||||||
|
|
||||||
// If the CPU state's instruction pointer is actually the return address
|
// If the CPU state's instruction pointer is actually the return address
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Team;
|
|||||||
class TeamMemory;
|
class TeamMemory;
|
||||||
|
|
||||||
|
|
||||||
class Architecture : public Referenceable {
|
class Architecture : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
Architecture(TeamMemory* teamMemory,
|
Architecture(TeamMemory* teamMemory,
|
||||||
uint8 addressSize, bool bigEndian);
|
uint8 addressSize, bool bigEndian);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
class Register;
|
class Register;
|
||||||
|
|
||||||
|
|
||||||
class CpuState : public Referenceable {
|
class CpuState : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~CpuState();
|
virtual ~CpuState();
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <Referenceable.h>
|
#include <Referenceable.h>
|
||||||
|
|
||||||
|
|
||||||
class RegisterMap : public Referenceable {
|
class RegisterMap : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~RegisterMap();
|
virtual ~RegisterMap();
|
||||||
|
|
||||||
|
|||||||
@@ -340,14 +340,14 @@ ArchitectureX86::CreateStackFrame(Image* image, FunctionDebugInfo* function,
|
|||||||
= new(std::nothrow) NoOpStackFrameDebugInfo;
|
= new(std::nothrow) NoOpStackFrameDebugInfo;
|
||||||
if (stackFrameDebugInfo == NULL)
|
if (stackFrameDebugInfo == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<StackFrameDebugInfo> stackFrameDebugInfoReference(
|
BReference<StackFrameDebugInfo> stackFrameDebugInfoReference(
|
||||||
stackFrameDebugInfo, true);
|
stackFrameDebugInfo, true);
|
||||||
|
|
||||||
StackFrame* frame = new(std::nothrow) StackFrame(frameType, cpuState,
|
StackFrame* frame = new(std::nothrow) StackFrame(frameType, cpuState,
|
||||||
framePointer, eip, stackFrameDebugInfo);
|
framePointer, eip, stackFrameDebugInfo);
|
||||||
if (frame == NULL)
|
if (frame == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<StackFrame> frameReference(frame, true);
|
BReference<StackFrame> frameReference(frame, true);
|
||||||
|
|
||||||
status_t error = frame->Init();
|
status_t error = frame->Init();
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
@@ -498,7 +498,7 @@ ArchitectureX86::DisassembleCode(FunctionDebugInfo* function,
|
|||||||
fAssemblyLanguage);
|
fAssemblyLanguage);
|
||||||
if (source == NULL)
|
if (source == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<DisassembledCode> sourceReference(source, true);
|
BReference<DisassembledCode> sourceReference(source, true);
|
||||||
|
|
||||||
// init disassembler
|
// init disassembler
|
||||||
DisassemblerX86 disassembler;
|
DisassemblerX86 disassembler;
|
||||||
|
|||||||
@@ -18,13 +18,13 @@ BasicFunctionDebugInfo::BasicFunctionDebugInfo(
|
|||||||
fName(name),
|
fName(name),
|
||||||
fPrettyName(prettyName)
|
fPrettyName(prettyName)
|
||||||
{
|
{
|
||||||
fImageDebugInfo->AddReference();
|
fImageDebugInfo->AcquireReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BasicFunctionDebugInfo::~BasicFunctionDebugInfo()
|
BasicFunctionDebugInfo::~BasicFunctionDebugInfo()
|
||||||
{
|
{
|
||||||
fImageDebugInfo->RemoveReference();
|
fImageDebugInfo->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ DwarfImageDebugInfo::GetFunctions(BObjectList<FunctionDebugInfo>& functions)
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
// TODO: Clean up already added functions!
|
// TODO: Clean up already added functions!
|
||||||
}
|
}
|
||||||
Reference<TargetAddressRangeList> rangeListReference(rangeList,
|
BReference<TargetAddressRangeList> rangeListReference(rangeList,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
// get the source location
|
// get the source location
|
||||||
@@ -343,7 +343,7 @@ DwarfImageDebugInfo::GetFunctions(BObjectList<FunctionDebugInfo>& functions)
|
|||||||
file = fFileManager->GetSourceFile(directoryPath,
|
file = fFileManager->GetSourceFile(directoryPath,
|
||||||
fileName);
|
fileName);
|
||||||
}
|
}
|
||||||
Reference<LocatableFile> fileReference(file, true);
|
BReference<LocatableFile> fileReference(file, true);
|
||||||
|
|
||||||
// create and add the functions
|
// create and add the functions
|
||||||
DwarfFunctionDebugInfo* function
|
DwarfFunctionDebugInfo* function
|
||||||
@@ -393,7 +393,7 @@ DwarfImageDebugInfo::GetType(GlobalTypeCache* cache,
|
|||||||
status_t error = fArchitecture->GetDwarfRegisterMaps(NULL, &fromDwarfMap);
|
status_t error = fArchitecture->GetDwarfRegisterMaps(NULL, &fromDwarfMap);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<RegisterMap> fromDwarfMapReference(fromDwarfMap, true);
|
BReference<RegisterMap> fromDwarfMapReference(fromDwarfMap, true);
|
||||||
|
|
||||||
// create the target interface
|
// create the target interface
|
||||||
BasicTargetInterface inputInterface(registers, registerCount, fromDwarfMap,
|
BasicTargetInterface inputInterface(registers, registerCount, fromDwarfMap,
|
||||||
@@ -403,7 +403,7 @@ DwarfImageDebugInfo::GetType(GlobalTypeCache* cache,
|
|||||||
for (int32 i = 0; CompilationUnit* unit = fFile->CompilationUnitAt(i);
|
for (int32 i = 0; CompilationUnit* unit = fFile->CompilationUnitAt(i);
|
||||||
i++) {
|
i++) {
|
||||||
DwarfTypeContext* typeContext = NULL;
|
DwarfTypeContext* typeContext = NULL;
|
||||||
Reference<DwarfTypeContext> typeContextReference;
|
BReference<DwarfTypeContext> typeContextReference;
|
||||||
|
|
||||||
// iterate through all types of the compilation unit
|
// iterate through all types of the compilation unit
|
||||||
for (DebugInfoEntryList::ConstIterator it
|
for (DebugInfoEntryList::ConstIterator it
|
||||||
@@ -448,7 +448,7 @@ DwarfImageDebugInfo::GetType(GlobalTypeCache* cache,
|
|||||||
AddressSectionType
|
AddressSectionType
|
||||||
DwarfImageDebugInfo::GetAddressSectionType(target_addr_t address)
|
DwarfImageDebugInfo::GetAddressSectionType(target_addr_t address)
|
||||||
{
|
{
|
||||||
if (address >= fTextSectionStart && address < fTextSectionEnd)
|
if (address >= fTextSectionStart && address < fTextSectionEnd)
|
||||||
return ADDRESS_SECTION_TYPE_FUNCTION;
|
return ADDRESS_SECTION_TYPE_FUNCTION;
|
||||||
|
|
||||||
if (address >= fPLTSectionStart && address < fPLTSectionEnd)
|
if (address >= fPLTSectionStart && address < fPLTSectionEnd)
|
||||||
@@ -471,7 +471,7 @@ DwarfImageDebugInfo::CreateFrame(Image* image,
|
|||||||
FunctionID* functionID = functionInstance->GetFunctionID();
|
FunctionID* functionID = functionInstance->GetFunctionID();
|
||||||
if (functionID == NULL)
|
if (functionID == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<FunctionID> functionIDReference(functionID, true);
|
BReference<FunctionID> functionIDReference(functionID, true);
|
||||||
|
|
||||||
TRACE_CFI("DwarfImageDebugInfo::CreateFrame(): subprogram DIE: %p, "
|
TRACE_CFI("DwarfImageDebugInfo::CreateFrame(): subprogram DIE: %p, "
|
||||||
"function: %s\n", function->SubprogramEntry(),
|
"function: %s\n", function->SubprogramEntry(),
|
||||||
@@ -487,15 +487,15 @@ DwarfImageDebugInfo::CreateFrame(Image* image,
|
|||||||
&fromDwarfMap);
|
&fromDwarfMap);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<RegisterMap> toDwarfMapReference(toDwarfMap, true);
|
BReference<RegisterMap> toDwarfMapReference(toDwarfMap, true);
|
||||||
Reference<RegisterMap> fromDwarfMapReference(fromDwarfMap, true);
|
BReference<RegisterMap> fromDwarfMapReference(fromDwarfMap, true);
|
||||||
|
|
||||||
// create a clean CPU state for the previous frame
|
// create a clean CPU state for the previous frame
|
||||||
CpuState* previousCpuState;
|
CpuState* previousCpuState;
|
||||||
error = fArchitecture->CreateCpuState(previousCpuState);
|
error = fArchitecture->CreateCpuState(previousCpuState);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<CpuState> previousCpuStateReference(previousCpuState, true);
|
BReference<CpuState> previousCpuStateReference(previousCpuState, true);
|
||||||
|
|
||||||
// create the target interfaces
|
// create the target interfaces
|
||||||
UnwindTargetInterface* inputInterface
|
UnwindTargetInterface* inputInterface
|
||||||
@@ -503,7 +503,7 @@ DwarfImageDebugInfo::CreateFrame(Image* image,
|
|||||||
fromDwarfMap, toDwarfMap, cpuState, fArchitecture, fTeamMemory);
|
fromDwarfMap, toDwarfMap, cpuState, fArchitecture, fTeamMemory);
|
||||||
if (inputInterface == NULL)
|
if (inputInterface == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<UnwindTargetInterface> inputInterfaceReference(inputInterface,
|
BReference<UnwindTargetInterface> inputInterfaceReference(inputInterface,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
UnwindTargetInterface* outputInterface
|
UnwindTargetInterface* outputInterface
|
||||||
@@ -512,7 +512,7 @@ DwarfImageDebugInfo::CreateFrame(Image* image,
|
|||||||
fTeamMemory);
|
fTeamMemory);
|
||||||
if (outputInterface == NULL)
|
if (outputInterface == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<UnwindTargetInterface> outputInterfaceReference(outputInterface,
|
BReference<UnwindTargetInterface> outputInterfaceReference(outputInterface,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
// do the unwinding
|
// do the unwinding
|
||||||
@@ -548,7 +548,7 @@ DwarfImageDebugInfo::CreateFrame(Image* image,
|
|||||||
inputInterface, fromDwarfMap);
|
inputInterface, fromDwarfMap);
|
||||||
if (stackFrameDebugInfo == NULL)
|
if (stackFrameDebugInfo == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<DwarfStackFrameDebugInfo> stackFrameDebugInfoReference(
|
BReference<DwarfStackFrameDebugInfo> stackFrameDebugInfoReference(
|
||||||
stackFrameDebugInfo, true);
|
stackFrameDebugInfo, true);
|
||||||
|
|
||||||
error = stackFrameDebugInfo->Init();
|
error = stackFrameDebugInfo->Init();
|
||||||
@@ -561,7 +561,7 @@ DwarfImageDebugInfo::CreateFrame(Image* image,
|
|||||||
stackFrameDebugInfo);
|
stackFrameDebugInfo);
|
||||||
if (frame == NULL)
|
if (frame == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<StackFrame> frameReference(frame, true);
|
BReference<StackFrame> frameReference(frame, true);
|
||||||
|
|
||||||
error = frame->Init();
|
error = frame->Init();
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
@@ -589,7 +589,7 @@ DwarfImageDebugInfo::CreateFrame(Image* image,
|
|||||||
parameter) != B_OK) {
|
parameter) != B_OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Reference<Variable> parameterReference(parameter, true);
|
BReference<Variable> parameterReference(parameter, true);
|
||||||
|
|
||||||
if (!frame->AddParameter(parameter))
|
if (!frame->AddParameter(parameter))
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -954,7 +954,7 @@ DwarfImageDebugInfo::_CreateLocalVariables(CompilationUnit* unit,
|
|||||||
!= B_OK) {
|
!= B_OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Reference<Variable> variableReference(variable, true);
|
BReference<Variable> variableReference(variable, true);
|
||||||
|
|
||||||
if (!frame->AddLocalVariable(variable))
|
if (!frame->AddLocalVariable(variable))
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -985,7 +985,7 @@ DwarfImageDebugInfo::_CreateLocalVariables(CompilationUnit* unit,
|
|||||||
TRACE_LOCALS(" failed to get ranges\n");
|
TRACE_LOCALS(" failed to get ranges\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Reference<TargetAddressRangeList> rangeListReference(rangeList,
|
BReference<TargetAddressRangeList> rangeListReference(rangeList,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
if (!rangeList->Contains(instructionPointer)) {
|
if (!rangeList->Contains(instructionPointer)) {
|
||||||
|
|||||||
@@ -159,11 +159,11 @@ DwarfStackFrameDebugInfo::Init()
|
|||||||
DwarfTypeContext* typeContext = new(std::nothrow) DwarfTypeContext(
|
DwarfTypeContext* typeContext = new(std::nothrow) DwarfTypeContext(
|
||||||
fTypeContext->GetArchitecture(), fTypeContext->ImageID(),
|
fTypeContext->GetArchitecture(), fTypeContext->ImageID(),
|
||||||
fTypeContext->File(), fTypeContext->GetCompilationUnit(), NULL, 0, 0,
|
fTypeContext->File(), fTypeContext->GetCompilationUnit(), NULL, 0, 0,
|
||||||
fTypeContext->RelocationDelta(), fTypeContext->TargetInterface(),
|
fTypeContext->RelocationDelta(), fTypeContext->TargetInterface(),
|
||||||
fTypeContext->FromDwarfRegisterMap());
|
fTypeContext->FromDwarfRegisterMap());
|
||||||
if (typeContext == NULL)
|
if (typeContext == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<DwarfTypeContext> typeContextReference(typeContext, true);
|
BReference<DwarfTypeContext> typeContextReference(typeContext, true);
|
||||||
|
|
||||||
// create the type factory
|
// create the type factory
|
||||||
fTypeFactory = new(std::nothrow) DwarfTypeFactory(typeContext, fTypeLookup,
|
fTypeFactory = new(std::nothrow) DwarfTypeFactory(typeContext, fTypeLookup,
|
||||||
@@ -191,7 +191,7 @@ DwarfStackFrameDebugInfo::CreateParameter(FunctionID* functionID,
|
|||||||
functionID, name);
|
functionID, name);
|
||||||
if (id == NULL)
|
if (id == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<DwarfFunctionParameterID> idReference(id, true);
|
BReference<DwarfFunctionParameterID> idReference(id, true);
|
||||||
|
|
||||||
// create the variable
|
// create the variable
|
||||||
return _CreateVariable(id, name, _GetDIEType(parameterEntry),
|
return _CreateVariable(id, name, _GetDIEType(parameterEntry),
|
||||||
@@ -226,7 +226,7 @@ DwarfStackFrameDebugInfo::CreateLocalVariable(FunctionID* functionID,
|
|||||||
functionID, name, line, column);
|
functionID, name, line, column);
|
||||||
if (id == NULL)
|
if (id == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<DwarfLocalVariableID> idReference(id, true);
|
BReference<DwarfLocalVariableID> idReference(id, true);
|
||||||
|
|
||||||
// create the variable
|
// create the variable
|
||||||
return _CreateVariable(id, name, _GetDIEType(variableEntry),
|
return _CreateVariable(id, name, _GetDIEType(variableEntry),
|
||||||
@@ -247,14 +247,14 @@ DwarfStackFrameDebugInfo::_CreateVariable(ObjectID* id, const BString& name,
|
|||||||
status_t error = fTypeFactory->CreateType(typeEntry, type);
|
status_t error = fTypeFactory->CreateType(typeEntry, type);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<DwarfType> typeReference(type, true);
|
BReference<DwarfType> typeReference(type, true);
|
||||||
|
|
||||||
// get the location, if possible
|
// get the location, if possible
|
||||||
ValueLocation* location = new(std::nothrow) ValueLocation(
|
ValueLocation* location = new(std::nothrow) ValueLocation(
|
||||||
fTypeContext->GetArchitecture()->IsBigEndian());
|
fTypeContext->GetArchitecture()->IsBigEndian());
|
||||||
if (location == NULL)
|
if (location == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<ValueLocation> locationReference(location, true);
|
BReference<ValueLocation> locationReference(location, true);
|
||||||
|
|
||||||
if (locationDescription->IsValid()) {
|
if (locationDescription->IsValid()) {
|
||||||
status_t error = type->ResolveLocation(fTypeContext,
|
status_t error = type->ResolveLocation(fTypeContext,
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ DwarfTeamDebugInfo::CreateImageDebugInfo(const ImageInfo& imageInfo,
|
|||||||
status_t error = fManager->LoadFile(filePath, file);
|
status_t error = fManager->LoadFile(filePath, file);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<DwarfFile> fileReference(file, true);
|
BReference<DwarfFile> fileReference(file, true);
|
||||||
|
|
||||||
error = fManager->FinishLoading();
|
error = fManager->FinishLoading();
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ DwarfTypeFactory::CreateType(DIEType* typeEntry, DwarfType*& _type)
|
|||||||
status_t error = _CreateTypeInternal(name, typeEntry, type);
|
status_t error = _CreateTypeInternal(name, typeEntry, type);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<DwarfType> typeReference(type, true);
|
BReference<DwarfType> typeReference(type, true);
|
||||||
|
|
||||||
// Insert the type into the cache. Re-check, as the type may already
|
// Insert the type into the cache. Re-check, as the type may already
|
||||||
// have been inserted (e.g. in the compound type case).
|
// have been inserted (e.g. in the compound type case).
|
||||||
@@ -453,7 +453,7 @@ DwarfTypeFactory::_CreateCompoundType(const BString& name,
|
|||||||
name, typeEntry);
|
name, typeEntry);
|
||||||
if (type == NULL)
|
if (type == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<DwarfCompoundType> typeReference(type, true);
|
BReference<DwarfCompoundType> typeReference(type, true);
|
||||||
|
|
||||||
// Already add the type at this pointer to the cache, since otherwise
|
// Already add the type at this pointer to the cache, since otherwise
|
||||||
// we could run into an infinite recursion when trying to create the types
|
// we could run into an infinite recursion when trying to create the types
|
||||||
@@ -487,7 +487,7 @@ printf(" -> failed to add type to cache\n");
|
|||||||
DwarfType* memberType;
|
DwarfType* memberType;
|
||||||
if (CreateType(memberEntry->GetType(), memberType) != B_OK)
|
if (CreateType(memberEntry->GetType(), memberType) != B_OK)
|
||||||
continue;
|
continue;
|
||||||
Reference<DwarfType> memberTypeReference(memberType, true);
|
BReference<DwarfType> memberTypeReference(memberType, true);
|
||||||
|
|
||||||
// get the name
|
// get the name
|
||||||
BString memberName;
|
BString memberName;
|
||||||
@@ -496,7 +496,7 @@ printf(" -> failed to add type to cache\n");
|
|||||||
// create and add the member object
|
// create and add the member object
|
||||||
DwarfDataMember* member = new(std::nothrow) DwarfDataMember(
|
DwarfDataMember* member = new(std::nothrow) DwarfDataMember(
|
||||||
memberEntry, memberName, memberType);
|
memberEntry, memberName, memberType);
|
||||||
Reference<DwarfDataMember> memberReference(member, true);
|
BReference<DwarfDataMember> memberReference(member, true);
|
||||||
if (member == NULL || !type->AddDataMember(member)) {
|
if (member == NULL || !type->AddDataMember(member)) {
|
||||||
cacheLocker.Lock();
|
cacheLocker.Lock();
|
||||||
fTypeCache->RemoveType(type);
|
fTypeCache->RemoveType(type);
|
||||||
@@ -525,12 +525,12 @@ printf(" -> failed to add type to cache\n");
|
|||||||
DwarfType* baseType;
|
DwarfType* baseType;
|
||||||
if (CreateType(inheritanceEntry->GetType(), baseType) != B_OK)
|
if (CreateType(inheritanceEntry->GetType(), baseType) != B_OK)
|
||||||
continue;
|
continue;
|
||||||
Reference<DwarfType> baseTypeReference(baseType, true);
|
BReference<DwarfType> baseTypeReference(baseType, true);
|
||||||
|
|
||||||
// create and add the inheritance object
|
// create and add the inheritance object
|
||||||
DwarfInheritance* inheritance = new(std::nothrow)
|
DwarfInheritance* inheritance = new(std::nothrow)
|
||||||
DwarfInheritance(inheritanceEntry, baseType);
|
DwarfInheritance(inheritanceEntry, baseType);
|
||||||
Reference<DwarfInheritance> inheritanceReference(inheritance,
|
BReference<DwarfInheritance> inheritanceReference(inheritance,
|
||||||
true);
|
true);
|
||||||
if (inheritance == NULL || !type->AddInheritance(inheritance)) {
|
if (inheritance == NULL || !type->AddInheritance(inheritance)) {
|
||||||
cacheLocker.Lock();
|
cacheLocker.Lock();
|
||||||
@@ -680,7 +680,7 @@ DwarfTypeFactory::_CreateAddressType(const BString& name,
|
|||||||
if (baseType == NULL)
|
if (baseType == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
Reference<Type> baseTypeReference(baseType, true);
|
BReference<Type> baseTypeReference(baseType, true);
|
||||||
|
|
||||||
DwarfAddressType* type = new(std::nothrow) DwarfAddressType(fTypeContext,
|
DwarfAddressType* type = new(std::nothrow) DwarfAddressType(fTypeContext,
|
||||||
name, typeEntry, addressKind, baseType);
|
name, typeEntry, addressKind, baseType);
|
||||||
@@ -759,7 +759,7 @@ DwarfTypeFactory::_CreateModifiedType(const BString& name,
|
|||||||
status_t error = CreateType(baseTypeEntry, baseType);
|
status_t error = CreateType(baseTypeEntry, baseType);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<Type> baseTypeReference(baseType, true);
|
BReference<Type> baseTypeReference(baseType, true);
|
||||||
|
|
||||||
DwarfModifiedType* type = new(std::nothrow) DwarfModifiedType(fTypeContext,
|
DwarfModifiedType* type = new(std::nothrow) DwarfModifiedType(fTypeContext,
|
||||||
name, typeEntry, modifiers, baseType);
|
name, typeEntry, modifiers, baseType);
|
||||||
@@ -786,7 +786,7 @@ DwarfTypeFactory::_CreateTypedefType(const BString& name,
|
|||||||
error = CreateType(baseTypeEntry, baseType);
|
error = CreateType(baseTypeEntry, baseType);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<Type> baseTypeReference(baseType, true);
|
BReference<Type> baseTypeReference(baseType, true);
|
||||||
|
|
||||||
DwarfTypedefType* type = new(std::nothrow) DwarfTypedefType(fTypeContext,
|
DwarfTypedefType* type = new(std::nothrow) DwarfTypedefType(fTypeContext,
|
||||||
name, typeEntry, baseType);
|
name, typeEntry, baseType);
|
||||||
@@ -821,14 +821,14 @@ DwarfTypeFactory::_CreateArrayType(const BString& name,
|
|||||||
name.String(), strerror(error));
|
name.String(), strerror(error));
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
Reference<Type> baseTypeReference(baseType, true);
|
BReference<Type> baseTypeReference(baseType, true);
|
||||||
|
|
||||||
// create the array type
|
// create the array type
|
||||||
DwarfArrayType* type = new(std::nothrow) DwarfArrayType(fTypeContext, name,
|
DwarfArrayType* type = new(std::nothrow) DwarfArrayType(fTypeContext, name,
|
||||||
typeEntry, baseType);
|
typeEntry, baseType);
|
||||||
if (type == NULL)
|
if (type == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<DwarfType> typeReference(type, true);
|
BReference<DwarfType> typeReference(type, true);
|
||||||
|
|
||||||
// add the array dimensions
|
// add the array dimensions
|
||||||
DIEArrayType* dimensionOwnerEntry = DwarfUtils::GetDIEByPredicate(
|
DIEArrayType* dimensionOwnerEntry = DwarfUtils::GetDIEByPredicate(
|
||||||
@@ -853,12 +853,12 @@ DwarfTypeFactory::_CreateArrayType(const BString& name,
|
|||||||
strerror(error));
|
strerror(error));
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
Reference<Type> dimensionTypeReference(dimensionType, true);
|
BReference<Type> dimensionTypeReference(dimensionType, true);
|
||||||
|
|
||||||
// create and add the array dimension object
|
// create and add the array dimension object
|
||||||
DwarfArrayDimension* dimension
|
DwarfArrayDimension* dimension
|
||||||
= new(std::nothrow) DwarfArrayDimension(dimensionType);
|
= new(std::nothrow) DwarfArrayDimension(dimensionType);
|
||||||
Reference<DwarfArrayDimension> dimensionReference(dimension, true);
|
BReference<DwarfArrayDimension> dimensionReference(dimension, true);
|
||||||
if (dimension == NULL || !type->AddDimension(dimension))
|
if (dimension == NULL || !type->AddDimension(dimension))
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -882,14 +882,14 @@ DwarfTypeFactory::_CreateEnumerationType(const BString& name,
|
|||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
Reference<Type> baseTypeReference(baseType, true);
|
BReference<Type> baseTypeReference(baseType, true);
|
||||||
|
|
||||||
// create the enumeration type
|
// create the enumeration type
|
||||||
DwarfEnumerationType* type = new(std::nothrow) DwarfEnumerationType(
|
DwarfEnumerationType* type = new(std::nothrow) DwarfEnumerationType(
|
||||||
fTypeContext, name, typeEntry, baseType);
|
fTypeContext, name, typeEntry, baseType);
|
||||||
if (type == NULL)
|
if (type == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<DwarfEnumerationType> typeReference(type, true);
|
BReference<DwarfEnumerationType> typeReference(type, true);
|
||||||
|
|
||||||
// get the enumeration values
|
// get the enumeration values
|
||||||
DIEEnumerationType* enumeratorOwnerEntry = DwarfUtils::GetDIEByPredicate(
|
DIEEnumerationType* enumeratorOwnerEntry = DwarfUtils::GetDIEByPredicate(
|
||||||
@@ -922,7 +922,8 @@ DwarfTypeFactory::_CreateEnumerationType(const BString& name,
|
|||||||
DwarfEnumeratorValue* enumValue
|
DwarfEnumeratorValue* enumValue
|
||||||
= new(std::nothrow) DwarfEnumeratorValue(enumeratorEntry,
|
= new(std::nothrow) DwarfEnumeratorValue(enumeratorEntry,
|
||||||
enumeratorEntry->Name(), value);
|
enumeratorEntry->Name(), value);
|
||||||
Reference<DwarfEnumeratorValue> enumValueReference(enumValue, true);
|
BReference<DwarfEnumeratorValue> enumValueReference(enumValue,
|
||||||
|
true);
|
||||||
if (enumValue == NULL || !type->AddValue(enumValue))
|
if (enumValue == NULL || !type->AddValue(enumValue))
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -1046,7 +1047,7 @@ DwarfTypeFactory::_CreateSubrangeType(const BString& name,
|
|||||||
}
|
}
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<Type> baseTypeReference(baseType, true);
|
BReference<Type> baseTypeReference(baseType, true);
|
||||||
|
|
||||||
// TODO: Support the thread scaling attribute!
|
// TODO: Support the thread scaling attribute!
|
||||||
|
|
||||||
@@ -1090,13 +1091,13 @@ DwarfTypeFactory::_CreateFunctionType(const BString& name,
|
|||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
Reference<Type> returnTypeReference(returnType, true);
|
BReference<Type> returnTypeReference(returnType, true);
|
||||||
|
|
||||||
DwarfFunctionType* type = new(std::nothrow) DwarfFunctionType(fTypeContext,
|
DwarfFunctionType* type = new(std::nothrow) DwarfFunctionType(fTypeContext,
|
||||||
name, typeEntry, returnType);
|
name, typeEntry, returnType);
|
||||||
if (type == NULL)
|
if (type == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<DwarfType> typeReference(type, true);
|
BReference<DwarfType> typeReference(type, true);
|
||||||
|
|
||||||
// get the parameters
|
// get the parameters
|
||||||
DIESubroutineType* parameterOwnerEntry = DwarfUtils::GetDIEByPredicate(
|
DIESubroutineType* parameterOwnerEntry = DwarfUtils::GetDIEByPredicate(
|
||||||
@@ -1125,7 +1126,7 @@ DwarfTypeFactory::_CreateFunctionType(const BString& name,
|
|||||||
parameterType);
|
parameterType);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<DwarfType> parameterTypeReference(parameterType, true);
|
BReference<DwarfType> parameterTypeReference(parameterType, true);
|
||||||
|
|
||||||
// get the name
|
// get the name
|
||||||
BString parameterName;
|
BString parameterName;
|
||||||
@@ -1135,7 +1136,7 @@ DwarfTypeFactory::_CreateFunctionType(const BString& name,
|
|||||||
DwarfFunctionParameter* parameter
|
DwarfFunctionParameter* parameter
|
||||||
= new(std::nothrow) DwarfFunctionParameter(parameterEntry,
|
= new(std::nothrow) DwarfFunctionParameter(parameterEntry,
|
||||||
parameterName, parameterType);
|
parameterName, parameterType);
|
||||||
Reference<DwarfFunctionParameter> parameterReference(parameter,
|
BReference<DwarfFunctionParameter> parameterReference(parameter,
|
||||||
true);
|
true);
|
||||||
if (parameter == NULL || !type->AddParameter(parameter))
|
if (parameter == NULL || !type->AddParameter(parameter))
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -1171,7 +1172,7 @@ DwarfTypeFactory::_CreatePointerToMemberType(const BString& name,
|
|||||||
containingType);
|
containingType);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<Type> containingTypeReference(containingType, true);
|
BReference<Type> containingTypeReference(containingType, true);
|
||||||
|
|
||||||
DwarfCompoundType* compoundContainingType
|
DwarfCompoundType* compoundContainingType
|
||||||
= dynamic_cast<DwarfCompoundType*>(containingType);
|
= dynamic_cast<DwarfCompoundType*>(containingType);
|
||||||
@@ -1186,7 +1187,7 @@ DwarfTypeFactory::_CreatePointerToMemberType(const BString& name,
|
|||||||
error = CreateType(baseTypeOwnerEntry->GetType(), baseType);
|
error = CreateType(baseTypeOwnerEntry->GetType(), baseType);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<Type> baseTypeReference(baseType, true);
|
BReference<Type> baseTypeReference(baseType, true);
|
||||||
|
|
||||||
// create the type object
|
// create the type object
|
||||||
DwarfPointerToMemberType* type = new(std::nothrow) DwarfPointerToMemberType(
|
DwarfPointerToMemberType* type = new(std::nothrow) DwarfPointerToMemberType(
|
||||||
|
|||||||
@@ -537,7 +537,7 @@ DwarfCompoundType::ResolveDataMemberLocation(DataMember* _member,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<ValueLocation> locationReference(location);
|
BReference<ValueLocation> locationReference(location);
|
||||||
|
|
||||||
// get the byte size
|
// get the byte size
|
||||||
target_addr_t byteSize;
|
target_addr_t byteSize;
|
||||||
@@ -592,7 +592,7 @@ DwarfCompoundType::ResolveDataMemberLocation(DataMember* _member,
|
|||||||
ValueLocation* bitFieldLocation = new(std::nothrow) ValueLocation;
|
ValueLocation* bitFieldLocation = new(std::nothrow) ValueLocation;
|
||||||
if (bitFieldLocation == NULL)
|
if (bitFieldLocation == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<ValueLocation> bitFieldLocationReference(bitFieldLocation, true);
|
BReference<ValueLocation> bitFieldLocationReference(bitFieldLocation, true);
|
||||||
|
|
||||||
if (!bitFieldLocation->SetTo(*location, bitOffset, bitSize))
|
if (!bitFieldLocation->SetTo(*location, bitOffset, bitSize))
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -641,7 +641,7 @@ DwarfCompoundType::_ResolveDataMemberLocation(DwarfType* memberType,
|
|||||||
parentLocation.IsBigEndian());
|
parentLocation.IsBigEndian());
|
||||||
if (location == NULL)
|
if (location == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<ValueLocation> locationReference(location, true);
|
BReference<ValueLocation> locationReference(location, true);
|
||||||
|
|
||||||
switch (memberLocation->attributeClass) {
|
switch (memberLocation->attributeClass) {
|
||||||
case ATTRIBUTE_CLASS_CONSTANT:
|
case ATTRIBUTE_CLASS_CONSTANT:
|
||||||
@@ -872,7 +872,7 @@ DwarfArrayType::ResolveElementLocation(const ArrayIndexPath& indexPath,
|
|||||||
parentLocation.IsBigEndian());
|
parentLocation.IsBigEndian());
|
||||||
if (location == NULL)
|
if (location == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<ValueLocation> locationReference(location, true);
|
BReference<ValueLocation> locationReference(location, true);
|
||||||
|
|
||||||
// If we have a single memory piece location for the array, we compute the
|
// If we have a single memory piece location for the array, we compute the
|
||||||
// element's location by hand -- not uncommonly the array size isn't known.
|
// element's location by hand -- not uncommonly the array size isn't known.
|
||||||
|
|||||||
@@ -36,13 +36,13 @@ Function::SetSourceCode(FileSourceCode* source, function_source_state state)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fSourceCode != NULL)
|
if (fSourceCode != NULL)
|
||||||
fSourceCode->RemoveReference();
|
fSourceCode->ReleaseReference();
|
||||||
|
|
||||||
fSourceCode = source;
|
fSourceCode = source;
|
||||||
fSourceCodeState = state;
|
fSourceCodeState = state;
|
||||||
|
|
||||||
if (fSourceCode != NULL) {
|
if (fSourceCode != NULL) {
|
||||||
fSourceCode->AddReference();
|
fSourceCode->AcquireReference();
|
||||||
|
|
||||||
// unset all instances' source codes
|
// unset all instances' source codes
|
||||||
fNotificationsDisabled++;
|
fNotificationsDisabled++;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
class FileSourceCode;
|
class FileSourceCode;
|
||||||
|
|
||||||
|
|
||||||
class Function : public Referenceable, private LocatableFile::Listener {
|
class Function : public BReferenceable, private LocatableFile::Listener {
|
||||||
public:
|
public:
|
||||||
class Listener;
|
class Listener;
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class LocatableFile;
|
|||||||
class SpecificImageDebugInfo;
|
class SpecificImageDebugInfo;
|
||||||
|
|
||||||
|
|
||||||
class FunctionDebugInfo : public Referenceable {
|
class FunctionDebugInfo : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
FunctionDebugInfo();
|
FunctionDebugInfo();
|
||||||
virtual ~FunctionDebugInfo();
|
virtual ~FunctionDebugInfo();
|
||||||
|
|||||||
@@ -71,13 +71,13 @@ FunctionInstance::SetSourceCode(DisassembledCode* source,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fSourceCode != NULL)
|
if (fSourceCode != NULL)
|
||||||
fSourceCode->RemoveReference();
|
fSourceCode->ReleaseReference();
|
||||||
|
|
||||||
fSourceCode = source;
|
fSourceCode = source;
|
||||||
fSourceCodeState = state;
|
fSourceCodeState = state;
|
||||||
|
|
||||||
if (fSourceCode != NULL)
|
if (fSourceCode != NULL)
|
||||||
fSourceCode->AddReference();
|
fSourceCode->AcquireReference();
|
||||||
|
|
||||||
if (fFunction != NULL)
|
if (fFunction != NULL)
|
||||||
fFunction->NotifySourceCodeChanged();
|
fFunction->NotifySourceCodeChanged();
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class FunctionID;
|
|||||||
class ImageDebugInfo;
|
class ImageDebugInfo;
|
||||||
|
|
||||||
|
|
||||||
class FunctionInstance : public Referenceable,
|
class FunctionInstance : public BReferenceable,
|
||||||
public DoublyLinkedListLinkImpl<FunctionInstance> {
|
public DoublyLinkedListLinkImpl<FunctionInstance> {
|
||||||
public:
|
public:
|
||||||
FunctionInstance(ImageDebugInfo* imageDebugInfo,
|
FunctionInstance(ImageDebugInfo* imageDebugInfo,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ enum global_type_cache_scope {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class GlobalTypeCache : public Referenceable {
|
class GlobalTypeCache : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
GlobalTypeCache();
|
GlobalTypeCache();
|
||||||
~GlobalTypeCache();
|
~GlobalTypeCache();
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ ImageDebugInfo::FinishInit()
|
|||||||
// FunctionInstance objects have references, now.
|
// FunctionInstance objects have references, now.
|
||||||
for (int32 k = 0; FunctionDebugInfo* function = functions.ItemAt(k);
|
for (int32 k = 0; FunctionDebugInfo* function = functions.ItemAt(k);
|
||||||
k++) {
|
k++) {
|
||||||
function->RemoveReference();
|
function->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class SpecificImageDebugInfo;
|
|||||||
class Type;
|
class Type;
|
||||||
|
|
||||||
|
|
||||||
class ImageDebugInfo : public Referenceable {
|
class ImageDebugInfo : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
ImageDebugInfo(const ImageInfo& imageInfo);
|
ImageDebugInfo(const ImageInfo& imageInfo);
|
||||||
~ImageDebugInfo();
|
~ImageDebugInfo();
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Type;
|
|||||||
class ValueLocation;
|
class ValueLocation;
|
||||||
|
|
||||||
|
|
||||||
class SpecificImageDebugInfo : public Referenceable {
|
class SpecificImageDebugInfo : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~SpecificImageDebugInfo();
|
virtual ~SpecificImageDebugInfo();
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class Type;
|
|||||||
class ValueLocation;
|
class ValueLocation;
|
||||||
|
|
||||||
|
|
||||||
class StackFrameDebugInfo : public Referenceable {
|
class StackFrameDebugInfo : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
StackFrameDebugInfo();
|
StackFrameDebugInfo();
|
||||||
virtual ~StackFrameDebugInfo();
|
virtual ~StackFrameDebugInfo();
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ TeamDebugInfo::LoadSourceCode(LocatableFile* file, FileSourceCode*& _sourceCode)
|
|||||||
->GetSourceLanguage(functionDebugInfo, language);
|
->GetSourceLanguage(functionDebugInfo, language);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
Reference<SourceLanguage> languageReference(language, true);
|
BReference<SourceLanguage> languageReference(language, true);
|
||||||
|
|
||||||
// no source code yet
|
// no source code yet
|
||||||
// locker.Unlock();
|
// locker.Unlock();
|
||||||
@@ -489,7 +489,7 @@ TeamDebugInfo::LoadSourceCode(LocatableFile* file, FileSourceCode*& _sourceCode)
|
|||||||
sourceFile->ReleaseReference();
|
sourceFile->ReleaseReference();
|
||||||
if (sourceCode == NULL)
|
if (sourceCode == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<FileSourceCode> sourceCodeReference(sourceCode, true);
|
BReference<FileSourceCode> sourceCodeReference(sourceCode, true);
|
||||||
|
|
||||||
error = sourceCode->Init();
|
error = sourceCode->Init();
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
@@ -673,7 +673,7 @@ TeamDebugInfo::FunctionByID(FunctionID* functionID) const
|
|||||||
sourceFunctionID->SourceFilePath());
|
sourceFunctionID->SourceFilePath());
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
Reference<LocatableFile> fileReference(file, true);
|
BReference<LocatableFile> fileReference(file, true);
|
||||||
|
|
||||||
if (SourceFileEntry* entry = fSourceFiles->Lookup(file))
|
if (SourceFileEntry* entry = fSourceFiles->Lookup(file))
|
||||||
return entry->FunctionByName(functionID->FunctionName());
|
return entry->FunctionByName(functionID->FunctionName());
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class SourceLocation;
|
|||||||
class SpecificTeamDebugInfo;
|
class SpecificTeamDebugInfo;
|
||||||
|
|
||||||
|
|
||||||
class TeamDebugInfo : public Referenceable, public GlobalTypeLookup {
|
class TeamDebugInfo : public BReferenceable, public GlobalTypeLookup {
|
||||||
public:
|
public:
|
||||||
TeamDebugInfo(
|
TeamDebugInfo(
|
||||||
DebuggerInterface* debuggerInterface,
|
DebuggerInterface* debuggerInterface,
|
||||||
|
|||||||
@@ -44,14 +44,14 @@ CpuStateEvent::CpuStateEvent(debug_debugger_message eventType, team_id team,
|
|||||||
fCpuState(state)
|
fCpuState(state)
|
||||||
{
|
{
|
||||||
if (fCpuState != NULL)
|
if (fCpuState != NULL)
|
||||||
fCpuState->AddReference();
|
fCpuState->AcquireReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CpuStateEvent::~CpuStateEvent()
|
CpuStateEvent::~CpuStateEvent()
|
||||||
{
|
{
|
||||||
if (fCpuState != NULL)
|
if (fCpuState != NULL)
|
||||||
fCpuState->RemoveReference();
|
fCpuState->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ DebuggerInterface::DebuggerInterface(team_id teamID)
|
|||||||
|
|
||||||
DebuggerInterface::~DebuggerInterface()
|
DebuggerInterface::~DebuggerInterface()
|
||||||
{
|
{
|
||||||
fArchitecture->RemoveReference();
|
fArchitecture->ReleaseReference();
|
||||||
|
|
||||||
Close(false);
|
Close(false);
|
||||||
|
|
||||||
@@ -632,7 +632,7 @@ DebuggerInterface::_CreateDebugEvent(int32 messageCode,
|
|||||||
|
|
||||||
event = new(std::nothrow) BreakpointHitEvent(message.origin.team,
|
event = new(std::nothrow) BreakpointHitEvent(message.origin.team,
|
||||||
message.origin.thread, state);
|
message.origin.thread, state);
|
||||||
state->RemoveReference();
|
state->ReleaseReference();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case B_DEBUGGER_MESSAGE_WATCHPOINT_HIT:
|
case B_DEBUGGER_MESSAGE_WATCHPOINT_HIT:
|
||||||
@@ -646,7 +646,7 @@ DebuggerInterface::_CreateDebugEvent(int32 messageCode,
|
|||||||
|
|
||||||
event = new(std::nothrow) WatchpointHitEvent(message.origin.team,
|
event = new(std::nothrow) WatchpointHitEvent(message.origin.team,
|
||||||
message.origin.thread, state);
|
message.origin.thread, state);
|
||||||
state->RemoveReference();
|
state->ReleaseReference();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case B_DEBUGGER_MESSAGE_SINGLE_STEP:
|
case B_DEBUGGER_MESSAGE_SINGLE_STEP:
|
||||||
@@ -660,7 +660,7 @@ DebuggerInterface::_CreateDebugEvent(int32 messageCode,
|
|||||||
|
|
||||||
event = new(std::nothrow) SingleStepEvent(message.origin.team,
|
event = new(std::nothrow) SingleStepEvent(message.origin.team,
|
||||||
message.origin.thread, state);
|
message.origin.thread, state);
|
||||||
state->RemoveReference();
|
state->ReleaseReference();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case B_DEBUGGER_MESSAGE_EXCEPTION_OCCURRED:
|
case B_DEBUGGER_MESSAGE_EXCEPTION_OCCURRED:
|
||||||
|
|||||||
@@ -511,7 +511,7 @@ DwarfFile::ResolveRangeList(CompilationUnit* unit, uint64 offset) const
|
|||||||
ERROR("Out of memory.\n");
|
ERROR("Out of memory.\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Reference<TargetAddressRangeList> rangesReference(ranges, true);
|
BReference<TargetAddressRangeList> rangesReference(ranges, true);
|
||||||
|
|
||||||
target_addr_t baseAddress = unit->AddressRangeBase();
|
target_addr_t baseAddress = unit->AddressRangeBase();
|
||||||
target_addr_t maxAddress = unit->MaxAddress();
|
target_addr_t maxAddress = unit->MaxAddress();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class CfaContext;
|
|||||||
class Register;
|
class Register;
|
||||||
|
|
||||||
|
|
||||||
class DwarfTargetInterface : public Referenceable {
|
class DwarfTargetInterface : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~DwarfTargetInterface();
|
virtual ~DwarfTargetInterface();
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class LocatableEntry : public Referenceable,
|
class LocatableEntry : public BReferenceable,
|
||||||
public DoublyLinkedListLinkImpl<LocatableEntry> {
|
public DoublyLinkedListLinkImpl<LocatableEntry> {
|
||||||
public:
|
public:
|
||||||
LocatableEntry(LocatableEntryOwner* owner,
|
LocatableEntry(LocatableEntryOwner* owner,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SourceFile : public Referenceable {
|
class SourceFile : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
SourceFile(SourceFileOwner* owner);
|
SourceFile(SourceFileOwner* owner);
|
||||||
~SourceFile();
|
~SourceFile();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <Referenceable.h>
|
#include <Referenceable.h>
|
||||||
|
|
||||||
|
|
||||||
class ObjectID : public Referenceable {
|
class ObjectID : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
ObjectID();
|
ObjectID();
|
||||||
virtual ~ObjectID();
|
virtual ~ObjectID();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Breakpoint : public Referenceable {
|
class Breakpoint : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
Breakpoint(Image* image, target_addr_t address);
|
Breakpoint(Image* image, target_addr_t address);
|
||||||
~Breakpoint();
|
~Breakpoint();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ DisassembledCode::DisassembledCode(SourceLanguage* language)
|
|||||||
DisassembledCode::~DisassembledCode()
|
DisassembledCode::~DisassembledCode()
|
||||||
{
|
{
|
||||||
for (int32 i = 0; Statement* statement = fStatements.ItemAt(i); i++)
|
for (int32 i = 0; Statement* statement = fStatements.ItemAt(i); i++)
|
||||||
statement->RemoveReference();
|
statement->ReleaseReference();
|
||||||
|
|
||||||
fLanguage->ReleaseReference();
|
fLanguage->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ Image::SetImageDebugInfo(ImageDebugInfo* debugInfo,
|
|||||||
|
|
||||||
if (fDebugInfo != NULL) {
|
if (fDebugInfo != NULL) {
|
||||||
fTeam->DebugInfo()->RemoveImageDebugInfo(fDebugInfo);
|
fTeam->DebugInfo()->RemoveImageDebugInfo(fDebugInfo);
|
||||||
fDebugInfo->RemoveReference();
|
fDebugInfo->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
fDebugInfo = debugInfo;
|
fDebugInfo = debugInfo;
|
||||||
@@ -69,7 +69,7 @@ Image::SetImageDebugInfo(ImageDebugInfo* debugInfo,
|
|||||||
if (fDebugInfo != NULL) {
|
if (fDebugInfo != NULL) {
|
||||||
error = fTeam->DebugInfo()->AddImageDebugInfo(fDebugInfo);
|
error = fTeam->DebugInfo()->AddImageDebugInfo(fDebugInfo);
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
fDebugInfo->AddReference();
|
fDebugInfo->AcquireReference();
|
||||||
} else {
|
} else {
|
||||||
fDebugInfo = NULL;
|
fDebugInfo = NULL;
|
||||||
fDebugInfoState = IMAGE_DEBUG_INFO_UNAVAILABLE;
|
fDebugInfoState = IMAGE_DEBUG_INFO_UNAVAILABLE;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class LocatableFile;
|
|||||||
class Team;
|
class Team;
|
||||||
|
|
||||||
|
|
||||||
class Image : public Referenceable, public DoublyLinkedListLinkImpl<Image> {
|
class Image : public BReferenceable, public DoublyLinkedListLinkImpl<Image> {
|
||||||
public:
|
public:
|
||||||
Image(Team* team, const ImageInfo& imageInfo,
|
Image(Team* team, const ImageInfo& imageInfo,
|
||||||
LocatableFile* imageFile);
|
LocatableFile* imageFile);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class SourceLocation;
|
|||||||
class Statement;
|
class Statement;
|
||||||
|
|
||||||
|
|
||||||
class SourceCode : public Referenceable {
|
class SourceCode : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~SourceCode();
|
virtual ~SourceCode();
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class TypeComponentPath;
|
|||||||
class Variable;
|
class Variable;
|
||||||
|
|
||||||
|
|
||||||
class StackFrame : public Referenceable {
|
class StackFrame : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
class Listener;
|
class Listener;
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class TypeComponentPath;
|
|||||||
class ValueLocation;
|
class ValueLocation;
|
||||||
|
|
||||||
|
|
||||||
class StackFrameValueInfos : public Referenceable {
|
class StackFrameValueInfos : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
StackFrameValueInfos();
|
StackFrameValueInfos();
|
||||||
virtual ~StackFrameValueInfos();
|
virtual ~StackFrameValueInfos();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ObjectID;
|
|||||||
class TypeComponentPath;
|
class TypeComponentPath;
|
||||||
|
|
||||||
|
|
||||||
class StackFrameValues : public Referenceable {
|
class StackFrameValues : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
StackFrameValues();
|
StackFrameValues();
|
||||||
StackFrameValues(const StackFrameValues& other);
|
StackFrameValues(const StackFrameValues& other);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ StackTrace::StackTrace()
|
|||||||
StackTrace::~StackTrace()
|
StackTrace::~StackTrace()
|
||||||
{
|
{
|
||||||
for (int32 i = 0; StackFrame* frame = FrameAt(i); i++)
|
for (int32 i = 0; StackFrame* frame = FrameAt(i); i++)
|
||||||
frame->RemoveReference();
|
frame->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ StackTrace::AddFrame(StackFrame* frame)
|
|||||||
if (fStackFrames.AddItem(frame))
|
if (fStackFrames.AddItem(frame))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
frame->RemoveReference();
|
frame->ReleaseReference();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "StackFrame.h"
|
#include "StackFrame.h"
|
||||||
|
|
||||||
|
|
||||||
class StackTrace : public Referenceable {
|
class StackTrace : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
StackTrace();
|
StackTrace();
|
||||||
virtual ~StackTrace();
|
virtual ~StackTrace();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
|
|
||||||
|
|
||||||
class Statement : public Referenceable {
|
class Statement : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~Statement();
|
virtual ~Statement();
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ Thread::Thread(Team* team, thread_id threadID)
|
|||||||
Thread::~Thread()
|
Thread::~Thread()
|
||||||
{
|
{
|
||||||
if (fCpuState != NULL)
|
if (fCpuState != NULL)
|
||||||
fCpuState->RemoveReference();
|
fCpuState->ReleaseReference();
|
||||||
if (fStackTrace != NULL)
|
if (fStackTrace != NULL)
|
||||||
fStackTrace->RemoveReference();
|
fStackTrace->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -81,12 +81,12 @@ Thread::SetCpuState(CpuState* state)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fCpuState != NULL)
|
if (fCpuState != NULL)
|
||||||
fCpuState->RemoveReference();
|
fCpuState->ReleaseReference();
|
||||||
|
|
||||||
fCpuState = state;
|
fCpuState = state;
|
||||||
|
|
||||||
if (fCpuState != NULL)
|
if (fCpuState != NULL)
|
||||||
fCpuState->AddReference();
|
fCpuState->AcquireReference();
|
||||||
|
|
||||||
fTeam->NotifyThreadCpuStateChanged(this);
|
fTeam->NotifyThreadCpuStateChanged(this);
|
||||||
}
|
}
|
||||||
@@ -99,12 +99,12 @@ Thread::SetStackTrace(StackTrace* trace)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fStackTrace != NULL)
|
if (fStackTrace != NULL)
|
||||||
fStackTrace->RemoveReference();
|
fStackTrace->ReleaseReference();
|
||||||
|
|
||||||
fStackTrace = trace;
|
fStackTrace = trace;
|
||||||
|
|
||||||
if (fStackTrace != NULL)
|
if (fStackTrace != NULL)
|
||||||
fStackTrace->AddReference();
|
fStackTrace->AcquireReference();
|
||||||
|
|
||||||
fTeam->NotifyThreadStackTraceChanged(this);
|
fTeam->NotifyThreadStackTraceChanged(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Thread : public Referenceable, public DoublyLinkedListLinkImpl<Thread> {
|
class Thread : public BReferenceable, public DoublyLinkedListLinkImpl<Thread> {
|
||||||
public:
|
public:
|
||||||
Thread(Team* team, thread_id threadID);
|
Thread(Team* team, thread_id threadID);
|
||||||
~Thread();
|
~Thread();
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class Type;
|
|||||||
class ValueLocation;
|
class ValueLocation;
|
||||||
|
|
||||||
|
|
||||||
class BaseType : public Referenceable {
|
class BaseType : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~BaseType();
|
virtual ~BaseType();
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class DataMember : public Referenceable {
|
class DataMember : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~DataMember();
|
virtual ~DataMember();
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class EnumeratorValue : public Referenceable {
|
class EnumeratorValue : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~EnumeratorValue();
|
virtual ~EnumeratorValue();
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ArrayDimension : public Referenceable {
|
class ArrayDimension : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~ArrayDimension();
|
virtual ~ArrayDimension();
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FunctionParameter : public Referenceable {
|
class FunctionParameter : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~FunctionParameter();
|
virtual ~FunctionParameter();
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Type : public Referenceable {
|
class Type : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~Type();
|
virtual ~Type();
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ TypeComponentPath::CreateSubPath(int32 componentCount) const
|
|||||||
TypeComponentPath* path = new(std::nothrow) TypeComponentPath;
|
TypeComponentPath* path = new(std::nothrow) TypeComponentPath;
|
||||||
if (path == NULL)
|
if (path == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
Reference<TypeComponentPath> pathReference(path, true);
|
BReference<TypeComponentPath> pathReference(path, true);
|
||||||
|
|
||||||
for (int32 i = 0; i < componentCount; i++) {
|
for (int32 i = 0; i < componentCount; i++) {
|
||||||
if (!path->AddComponent(*fComponents.ItemAt(i)))
|
if (!path->AddComponent(*fComponents.ItemAt(i)))
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ struct TypeComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class TypeComponentPath : public Referenceable {
|
class TypeComponentPath : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
TypeComponentPath();
|
TypeComponentPath();
|
||||||
TypeComponentPath(
|
TypeComponentPath(
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ private:
|
|||||||
typedef DoublyLinkedList<UserBreakpointInstance> UserBreakpointInstanceList;
|
typedef DoublyLinkedList<UserBreakpointInstance> UserBreakpointInstanceList;
|
||||||
|
|
||||||
|
|
||||||
class UserBreakpoint : public Referenceable,
|
class UserBreakpoint : public BReferenceable,
|
||||||
public DoublyLinkedListLinkImpl<UserBreakpoint> {
|
public DoublyLinkedListLinkImpl<UserBreakpoint> {
|
||||||
public:
|
public:
|
||||||
UserBreakpoint(
|
UserBreakpoint(
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Type;
|
|||||||
class ValueLocation;
|
class ValueLocation;
|
||||||
|
|
||||||
|
|
||||||
class Variable : public Referenceable {
|
class Variable : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
Variable(ObjectID* id, const BString& name,
|
Variable(ObjectID* id, const BString& name,
|
||||||
Type* type, ValueLocation* location);
|
Type* type, ValueLocation* location);
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ OptionsSettingImpl::AddOption(SettingsOption* option)
|
|||||||
if (!fOptions.AddItem(option))
|
if (!fOptions.AddItem(option))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
option->AddReference();
|
option->AcquireReference();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ OptionsSettingImpl::AddOption(const BString& id, const BString& name)
|
|||||||
Option* option = new(std::nothrow) Option(id, name);
|
Option* option = new(std::nothrow) Option(id, name);
|
||||||
if (option == NULL)
|
if (option == NULL)
|
||||||
return false;
|
return false;
|
||||||
Reference<Option> optionReference(option, true);
|
BReference<Option> optionReference(option, true);
|
||||||
|
|
||||||
return AddOption(option);
|
return AddOption(option);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
class SyntaxHighlighter;
|
class SyntaxHighlighter;
|
||||||
|
|
||||||
|
|
||||||
class SourceLanguage : public Referenceable {
|
class SourceLanguage : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~SourceLanguage();
|
virtual ~SourceLanguage();
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ enum syntax_highlight_type {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class SyntaxHighlightSource : public Referenceable {
|
class SyntaxHighlightSource : public BReferenceable {
|
||||||
virtual ~SyntaxHighlightSource();
|
virtual ~SyntaxHighlightSource();
|
||||||
|
|
||||||
virtual int32 CountLines() const = 0;
|
virtual int32 CountLines() const = 0;
|
||||||
@@ -41,7 +41,7 @@ class SyntaxHighlightInfo {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class SyntaxHighlighter : public Referenceable {
|
class SyntaxHighlighter : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
virtual ~SyntaxHighlighter();
|
virtual ~SyntaxHighlighter();
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "TargetAddressRange.h"
|
#include "TargetAddressRange.h"
|
||||||
|
|
||||||
|
|
||||||
class TargetAddressRangeList : public Referenceable {
|
class TargetAddressRangeList : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
TargetAddressRangeList();
|
TargetAddressRangeList();
|
||||||
TargetAddressRangeList(
|
TargetAddressRangeList(
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ struct ValuePieceLocation {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ValueLocation : public Referenceable {
|
class ValueLocation : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
ValueLocation();
|
ValueLocation();
|
||||||
ValueLocation(bool bigEndian);
|
ValueLocation(bool bigEndian);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class VariablesViewState : public Referenceable {
|
class VariablesViewState : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
VariablesViewState();
|
VariablesViewState();
|
||||||
virtual ~VariablesViewState();
|
virtual ~VariablesViewState();
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
for (int32 i = 0;
|
for (int32 i = 0;
|
||||||
UserBreakpoint* breakpoint = fBreakpoints.ItemAt(i);
|
UserBreakpoint* breakpoint = fBreakpoints.ItemAt(i);
|
||||||
i++) {
|
i++) {
|
||||||
breakpoint->RemoveReference();
|
breakpoint->ReleaseReference();
|
||||||
}
|
}
|
||||||
fBreakpoints.MakeEmpty();
|
fBreakpoints.MakeEmpty();
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
// TODO: Not particularly efficient!
|
// TODO: Not particularly efficient!
|
||||||
fBreakpoints.RemoveItemAt(index);
|
fBreakpoints.RemoveItemAt(index);
|
||||||
oldBreakpoint->RemoveReference();
|
oldBreakpoint->ReleaseReference();
|
||||||
NotifyRowsRemoved(index, 1);
|
NotifyRowsRemoved(index, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
if (!fBreakpoints.AddItem(newBreakpoint))
|
if (!fBreakpoints.AddItem(newBreakpoint))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
newBreakpoint->AddReference();
|
newBreakpoint->AcquireReference();
|
||||||
newBreakpoint = it.Next();
|
newBreakpoint = it.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -351,12 +351,12 @@ ImageFunctionsView::SetImageDebugInfo(ImageDebugInfo* imageDebugInfo)
|
|||||||
TRACE_GUI("ImageFunctionsView::SetImageDebugInfo(%p)\n", imageDebugInfo);
|
TRACE_GUI("ImageFunctionsView::SetImageDebugInfo(%p)\n", imageDebugInfo);
|
||||||
|
|
||||||
if (fImageDebugInfo != NULL)
|
if (fImageDebugInfo != NULL)
|
||||||
fImageDebugInfo->RemoveReference();
|
fImageDebugInfo->ReleaseReference();
|
||||||
|
|
||||||
fImageDebugInfo = imageDebugInfo;
|
fImageDebugInfo = imageDebugInfo;
|
||||||
|
|
||||||
if (fImageDebugInfo != NULL)
|
if (fImageDebugInfo != NULL)
|
||||||
fImageDebugInfo->AddReference();
|
fImageDebugInfo->AcquireReference();
|
||||||
|
|
||||||
fFunctionsTableModel->SetImageDebugInfo(fImageDebugInfo);
|
fFunctionsTableModel->SetImageDebugInfo(fImageDebugInfo);
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (fTeam == NULL) {
|
if (fTeam == NULL) {
|
||||||
for (int32 i = 0; Image* image = fImages.ItemAt(i); i++)
|
for (int32 i = 0; Image* image = fImages.ItemAt(i); i++)
|
||||||
image->RemoveReference();
|
image->ReleaseReference();
|
||||||
fImages.MakeEmpty();
|
fImages.MakeEmpty();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -66,7 +66,7 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
// TODO: Not particularly efficient!
|
// TODO: Not particularly efficient!
|
||||||
fImages.RemoveItemAt(index);
|
fImages.RemoveItemAt(index);
|
||||||
oldImage->RemoveReference();
|
oldImage->ReleaseReference();
|
||||||
NotifyRowsRemoved(index, 1);
|
NotifyRowsRemoved(index, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ public:
|
|||||||
if (!fImages.AddItem(newImage))
|
if (!fImages.AddItem(newImage))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
newImage->AddReference();
|
newImage->AcquireReference();
|
||||||
newImage = it.Next();
|
newImage = it.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,12 +186,12 @@ ImageListView::SetImage(Image* image)
|
|||||||
TRACE_GUI("ImageListView::SetImage(%p)\n", image);
|
TRACE_GUI("ImageListView::SetImage(%p)\n", image);
|
||||||
|
|
||||||
if (fImage != NULL)
|
if (fImage != NULL)
|
||||||
fImage->RemoveReference();
|
fImage->ReleaseReference();
|
||||||
|
|
||||||
fImage = image;
|
fImage = image;
|
||||||
|
|
||||||
if (fImage != NULL) {
|
if (fImage != NULL) {
|
||||||
fImage->AddReference();
|
fImage->AcquireReference();
|
||||||
|
|
||||||
for (int32 i = 0; Image* other = fImagesTableModel->ImageAt(i); i++) {
|
for (int32 i = 0; Image* other = fImagesTableModel->ImageAt(i); i++) {
|
||||||
if (fImage == other) {
|
if (fImage == other) {
|
||||||
|
|||||||
@@ -215,12 +215,12 @@ RegistersView::SetCpuState(CpuState* cpuState)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fCpuState != NULL)
|
if (fCpuState != NULL)
|
||||||
fCpuState->RemoveReference();
|
fCpuState->ReleaseReference();
|
||||||
|
|
||||||
fCpuState = cpuState;
|
fCpuState = cpuState;
|
||||||
|
|
||||||
if (fCpuState != NULL)
|
if (fCpuState != NULL)
|
||||||
fCpuState->AddReference();
|
fCpuState->AcquireReference();
|
||||||
|
|
||||||
fRegisterTableModel->SetCpuState(fCpuState);
|
fRegisterTableModel->SetCpuState(fCpuState);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -599,7 +599,7 @@ SourceView::MarkerManager::_UpdateIPMarkers()
|
|||||||
functionInstance, statement) != B_OK) {
|
functionInstance, statement) != B_OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Reference<Statement> statementReference(statement, true);
|
BReference<Statement> statementReference(statement, true);
|
||||||
|
|
||||||
int32 line = statement->StartSourceLocation().Line();
|
int32 line = statement->StartSourceLocation().Line();
|
||||||
if (line < 0 || line >= fSourceCode->CountLines())
|
if (line < 0 || line >= fSourceCode->CountLines())
|
||||||
@@ -662,7 +662,7 @@ SourceView::MarkerManager::_UpdateBreakpointMarkers()
|
|||||||
statement) != B_OK) {
|
statement) != B_OK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Reference<Statement> statementReference(statement, true);
|
BReference<Statement> statementReference(statement, true);
|
||||||
|
|
||||||
int32 line = statement->StartSourceLocation().Line();
|
int32 line = statement->StartSourceLocation().Line();
|
||||||
if (line < 0 || line >= fSourceCode->CountLines())
|
if (line < 0 || line >= fSourceCode->CountLines())
|
||||||
@@ -916,7 +916,7 @@ SourceView::MarkerView::MouseDown(BPoint where)
|
|||||||
SourceLocation(line), statement) != B_OK) {
|
SourceLocation(line), statement) != B_OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Reference<Statement> statementReference(statement, true);
|
BReference<Statement> statementReference(statement, true);
|
||||||
if (statement->StartSourceLocation().Line() != line)
|
if (statement->StartSourceLocation().Line() != line)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1684,13 +1684,13 @@ SourceView::SetStackTrace(StackTrace* stackTrace)
|
|||||||
if (fStackTrace != NULL) {
|
if (fStackTrace != NULL) {
|
||||||
fMarkerManager->SetStackTrace(NULL);
|
fMarkerManager->SetStackTrace(NULL);
|
||||||
fMarkerView->SetStackTrace(NULL);
|
fMarkerView->SetStackTrace(NULL);
|
||||||
fStackTrace->RemoveReference();
|
fStackTrace->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
fStackTrace = stackTrace;
|
fStackTrace = stackTrace;
|
||||||
|
|
||||||
if (fStackTrace != NULL)
|
if (fStackTrace != NULL)
|
||||||
fStackTrace->AddReference();
|
fStackTrace->AcquireReference();
|
||||||
|
|
||||||
fMarkerManager->SetStackTrace(fStackTrace);
|
fMarkerManager->SetStackTrace(fStackTrace);
|
||||||
fMarkerView->SetStackTrace(fStackTrace);
|
fMarkerView->SetStackTrace(fStackTrace);
|
||||||
@@ -1707,13 +1707,13 @@ SourceView::SetStackFrame(StackFrame* stackFrame)
|
|||||||
if (fStackFrame != NULL) {
|
if (fStackFrame != NULL) {
|
||||||
fMarkerManager->SetStackFrame(NULL);
|
fMarkerManager->SetStackFrame(NULL);
|
||||||
fMarkerView->SetStackFrame(NULL);
|
fMarkerView->SetStackFrame(NULL);
|
||||||
fStackFrame->RemoveReference();
|
fStackFrame->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
fStackFrame = stackFrame;
|
fStackFrame = stackFrame;
|
||||||
|
|
||||||
if (fStackFrame != NULL)
|
if (fStackFrame != NULL)
|
||||||
fStackFrame->AddReference();
|
fStackFrame->AcquireReference();
|
||||||
|
|
||||||
fMarkerManager->SetStackFrame(fStackFrame);
|
fMarkerManager->SetStackFrame(fStackFrame);
|
||||||
fMarkerView->SetStackFrame(fStackFrame);
|
fMarkerView->SetStackFrame(fStackFrame);
|
||||||
@@ -1735,13 +1735,13 @@ SourceView::SetSourceCode(SourceCode* sourceCode)
|
|||||||
fMarkerManager->SetSourceCode(NULL);
|
fMarkerManager->SetSourceCode(NULL);
|
||||||
fTextView->SetSourceCode(NULL);
|
fTextView->SetSourceCode(NULL);
|
||||||
fMarkerView->SetSourceCode(NULL);
|
fMarkerView->SetSourceCode(NULL);
|
||||||
fSourceCode->RemoveReference();
|
fSourceCode->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
fSourceCode = sourceCode;
|
fSourceCode = sourceCode;
|
||||||
|
|
||||||
if (fSourceCode != NULL)
|
if (fSourceCode != NULL)
|
||||||
fSourceCode->AddReference();
|
fSourceCode->AcquireReference();
|
||||||
|
|
||||||
fMarkerManager->SetSourceCode(fSourceCode);
|
fMarkerManager->SetSourceCode(fSourceCode);
|
||||||
fTextView->SetSourceCode(fSourceCode);
|
fTextView->SetSourceCode(fSourceCode);
|
||||||
@@ -1778,7 +1778,7 @@ SourceView::ScrollToAddress(target_addr_t address)
|
|||||||
statement) != B_OK) {
|
statement) != B_OK) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Reference<Statement> statementReference(statement, true);
|
BReference<Statement> statementReference(statement, true);
|
||||||
|
|
||||||
return ScrollToLine(statement->StartSourceLocation().Line());
|
return ScrollToLine(statement->StartSourceLocation().Line());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,12 +169,12 @@ StackTraceView::SetStackTrace(StackTrace* stackTrace)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fStackTrace != NULL)
|
if (fStackTrace != NULL)
|
||||||
fStackTrace->RemoveReference();
|
fStackTrace->ReleaseReference();
|
||||||
|
|
||||||
fStackTrace = stackTrace;
|
fStackTrace = stackTrace;
|
||||||
|
|
||||||
if (fStackTrace != NULL)
|
if (fStackTrace != NULL)
|
||||||
fStackTrace->AddReference();
|
fStackTrace->AcquireReference();
|
||||||
|
|
||||||
fFramesTableModel->SetStackTrace(fStackTrace);
|
fFramesTableModel->SetStackTrace(fStackTrace);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ TeamWindow::MessageReceived(BMessage* message)
|
|||||||
UserBreakpoint* breakpoint;
|
UserBreakpoint* breakpoint;
|
||||||
if (message->FindPointer("breakpoint", (void**)&breakpoint) != B_OK)
|
if (message->FindPointer("breakpoint", (void**)&breakpoint) != B_OK)
|
||||||
break;
|
break;
|
||||||
Reference<UserBreakpoint> breakpointReference(breakpoint, true);
|
BReference<UserBreakpoint> breakpointReference(breakpoint, true);
|
||||||
|
|
||||||
_HandleUserBreakpointChanged(breakpoint);
|
_HandleUserBreakpointChanged(breakpoint);
|
||||||
break;
|
break;
|
||||||
@@ -424,7 +424,7 @@ void
|
|||||||
TeamWindow::UserBreakpointChanged(const Team::UserBreakpointEvent& event)
|
TeamWindow::UserBreakpointChanged(const Team::UserBreakpointEvent& event)
|
||||||
{
|
{
|
||||||
BMessage message(MSG_USER_BREAKPOINT_CHANGED);
|
BMessage message(MSG_USER_BREAKPOINT_CHANGED);
|
||||||
Reference<UserBreakpoint> breakpointReference(event.GetBreakpoint());
|
BReference<UserBreakpoint> breakpointReference(event.GetBreakpoint());
|
||||||
if (message.AddPointer("breakpoint", event.GetBreakpoint()) == B_OK
|
if (message.AddPointer("breakpoint", event.GetBreakpoint()) == B_OK
|
||||||
&& PostMessage(&message) == B_OK) {
|
&& PostMessage(&message) == B_OK) {
|
||||||
breakpointReference.Detach();
|
breakpointReference.Detach();
|
||||||
@@ -550,19 +550,19 @@ TeamWindow::_SetActiveThread(::Thread* thread)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fActiveThread != NULL)
|
if (fActiveThread != NULL)
|
||||||
fActiveThread->RemoveReference();
|
fActiveThread->ReleaseReference();
|
||||||
|
|
||||||
fActiveThread = thread;
|
fActiveThread = thread;
|
||||||
|
|
||||||
if (fActiveThread != NULL)
|
if (fActiveThread != NULL)
|
||||||
fActiveThread->AddReference();
|
fActiveThread->AcquireReference();
|
||||||
|
|
||||||
AutoLocker< ::Team> locker(fTeam);
|
AutoLocker< ::Team> locker(fTeam);
|
||||||
_UpdateRunButtons();
|
_UpdateRunButtons();
|
||||||
|
|
||||||
StackTrace* stackTrace = fActiveThread != NULL
|
StackTrace* stackTrace = fActiveThread != NULL
|
||||||
? fActiveThread->GetStackTrace() : NULL;
|
? fActiveThread->GetStackTrace() : NULL;
|
||||||
Reference<StackTrace> stackTraceReference(stackTrace);
|
BReference<StackTrace> stackTraceReference(stackTrace);
|
||||||
// hold a reference until we've set it
|
// hold a reference until we've set it
|
||||||
|
|
||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
@@ -581,17 +581,17 @@ TeamWindow::_SetActiveImage(Image* image)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fActiveImage != NULL)
|
if (fActiveImage != NULL)
|
||||||
fActiveImage->RemoveReference();
|
fActiveImage->ReleaseReference();
|
||||||
|
|
||||||
fActiveImage = image;
|
fActiveImage = image;
|
||||||
|
|
||||||
AutoLocker< ::Team> locker(fTeam);
|
AutoLocker< ::Team> locker(fTeam);
|
||||||
|
|
||||||
ImageDebugInfo* imageDebugInfo = NULL;
|
ImageDebugInfo* imageDebugInfo = NULL;
|
||||||
Reference<ImageDebugInfo> imageDebugInfoReference;
|
BReference<ImageDebugInfo> imageDebugInfoReference;
|
||||||
|
|
||||||
if (fActiveImage != NULL) {
|
if (fActiveImage != NULL) {
|
||||||
fActiveImage->AddReference();
|
fActiveImage->AcquireReference();
|
||||||
|
|
||||||
imageDebugInfo = fActiveImage->GetImageDebugInfo();
|
imageDebugInfo = fActiveImage->GetImageDebugInfo();
|
||||||
imageDebugInfoReference.SetTo(imageDebugInfo);
|
imageDebugInfoReference.SetTo(imageDebugInfo);
|
||||||
@@ -615,12 +615,12 @@ TeamWindow::_SetActiveStackTrace(StackTrace* stackTrace)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fActiveStackTrace != NULL)
|
if (fActiveStackTrace != NULL)
|
||||||
fActiveStackTrace->RemoveReference();
|
fActiveStackTrace->ReleaseReference();
|
||||||
|
|
||||||
fActiveStackTrace = stackTrace;
|
fActiveStackTrace = stackTrace;
|
||||||
|
|
||||||
if (fActiveStackTrace != NULL)
|
if (fActiveStackTrace != NULL)
|
||||||
fActiveStackTrace->AddReference();
|
fActiveStackTrace->AcquireReference();
|
||||||
|
|
||||||
fStackTraceView->SetStackTrace(fActiveStackTrace);
|
fStackTraceView->SetStackTrace(fActiveStackTrace);
|
||||||
fSourceView->SetStackTrace(fActiveStackTrace);
|
fSourceView->SetStackTrace(fActiveStackTrace);
|
||||||
@@ -641,13 +641,13 @@ TeamWindow::_SetActiveStackFrame(StackFrame* frame)
|
|||||||
fActiveStackFrame->RemoveListener(this);
|
fActiveStackFrame->RemoveListener(this);
|
||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
|
|
||||||
fActiveStackFrame->RemoveReference();
|
fActiveStackFrame->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
fActiveStackFrame = frame;
|
fActiveStackFrame = frame;
|
||||||
|
|
||||||
if (fActiveStackFrame != NULL) {
|
if (fActiveStackFrame != NULL) {
|
||||||
fActiveStackFrame->AddReference();
|
fActiveStackFrame->AcquireReference();
|
||||||
|
|
||||||
AutoLocker< ::Team> locker(fTeam);
|
AutoLocker< ::Team> locker(fTeam);
|
||||||
fActiveStackFrame->AddListener(this);
|
fActiveStackFrame->AddListener(this);
|
||||||
@@ -676,12 +676,12 @@ TeamWindow::_SetActiveBreakpoint(UserBreakpoint* breakpoint)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fActiveBreakpoint != NULL)
|
if (fActiveBreakpoint != NULL)
|
||||||
fActiveBreakpoint->RemoveReference();
|
fActiveBreakpoint->ReleaseReference();
|
||||||
|
|
||||||
fActiveBreakpoint = breakpoint;
|
fActiveBreakpoint = breakpoint;
|
||||||
|
|
||||||
if (fActiveBreakpoint != NULL) {
|
if (fActiveBreakpoint != NULL) {
|
||||||
fActiveBreakpoint->AddReference();
|
fActiveBreakpoint->AcquireReference();
|
||||||
|
|
||||||
// get the breakpoint's function (more exactly: some function instance)
|
// get the breakpoint's function (more exactly: some function instance)
|
||||||
AutoLocker< ::Team> locker(fTeam);
|
AutoLocker< ::Team> locker(fTeam);
|
||||||
@@ -690,7 +690,8 @@ TeamWindow::_SetActiveBreakpoint(UserBreakpoint* breakpoint)
|
|||||||
breakpoint->Location().GetFunctionID());
|
breakpoint->Location().GetFunctionID());
|
||||||
FunctionInstance* functionInstance = function != NULL
|
FunctionInstance* functionInstance = function != NULL
|
||||||
? function->FirstInstance() : NULL;
|
? function->FirstInstance() : NULL;
|
||||||
Reference<FunctionInstance> functionInstanceReference(functionInstance);
|
BReference<FunctionInstance> functionInstanceReference(
|
||||||
|
functionInstance);
|
||||||
|
|
||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
|
|
||||||
@@ -720,7 +721,7 @@ TeamWindow::_SetActiveFunction(FunctionInstance* functionInstance)
|
|||||||
|
|
||||||
if (fActiveFunction != NULL) {
|
if (fActiveFunction != NULL) {
|
||||||
fActiveFunction->GetFunction()->RemoveListener(this);
|
fActiveFunction->GetFunction()->RemoveListener(this);
|
||||||
fActiveFunction->RemoveReference();
|
fActiveFunction->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
// to avoid listener feedback problems, first unset the active function and
|
// to avoid listener feedback problems, first unset the active function and
|
||||||
@@ -737,10 +738,10 @@ TeamWindow::_SetActiveFunction(FunctionInstance* functionInstance)
|
|||||||
locker.Lock();
|
locker.Lock();
|
||||||
|
|
||||||
SourceCode* sourceCode = NULL;
|
SourceCode* sourceCode = NULL;
|
||||||
Reference<SourceCode> sourceCodeReference;
|
BReference<SourceCode> sourceCodeReference;
|
||||||
|
|
||||||
if (fActiveFunction != NULL) {
|
if (fActiveFunction != NULL) {
|
||||||
fActiveFunction->AddReference();
|
fActiveFunction->AcquireReference();
|
||||||
fActiveFunction->GetFunction()->AddListener(this);
|
fActiveFunction->GetFunction()->AddListener(this);
|
||||||
|
|
||||||
Function* function = fActiveFunction->GetFunction();
|
Function* function = fActiveFunction->GetFunction();
|
||||||
@@ -771,12 +772,12 @@ TeamWindow::_SetActiveSourceCode(SourceCode* sourceCode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fActiveSourceCode != NULL)
|
if (fActiveSourceCode != NULL)
|
||||||
fActiveSourceCode->RemoveReference();
|
fActiveSourceCode->ReleaseReference();
|
||||||
|
|
||||||
fActiveSourceCode = sourceCode;
|
fActiveSourceCode = sourceCode;
|
||||||
|
|
||||||
if (fActiveSourceCode != NULL)
|
if (fActiveSourceCode != NULL)
|
||||||
fActiveSourceCode->AddReference();
|
fActiveSourceCode->AcquireReference();
|
||||||
|
|
||||||
fSourceView->SetSourceCode(fActiveSourceCode);
|
fSourceView->SetSourceCode(fActiveSourceCode);
|
||||||
|
|
||||||
@@ -788,7 +789,7 @@ TeamWindow::_UpdateCpuState()
|
|||||||
{
|
{
|
||||||
// get the CPU state
|
// get the CPU state
|
||||||
CpuState* cpuState = NULL;
|
CpuState* cpuState = NULL;
|
||||||
Reference<CpuState> cpuStateReference;
|
BReference<CpuState> cpuStateReference;
|
||||||
// hold a reference until the register view has one
|
// hold a reference until the register view has one
|
||||||
|
|
||||||
if (fActiveThread != NULL) {
|
if (fActiveThread != NULL) {
|
||||||
@@ -928,7 +929,7 @@ TeamWindow::_HandleStackTraceChanged(thread_id threadID)
|
|||||||
|
|
||||||
StackTrace* stackTrace = fActiveThread != NULL
|
StackTrace* stackTrace = fActiveThread != NULL
|
||||||
? fActiveThread->GetStackTrace() : NULL;
|
? fActiveThread->GetStackTrace() : NULL;
|
||||||
Reference<StackTrace> stackTraceReference(stackTrace);
|
BReference<StackTrace> stackTraceReference(stackTrace);
|
||||||
// hold a reference until the register view has one
|
// hold a reference until the register view has one
|
||||||
|
|
||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
@@ -953,7 +954,7 @@ TeamWindow::_HandleImageDebugInfoChanged(image_id imageID)
|
|||||||
|
|
||||||
TRACE_GUI(" image debug info: %p\n", imageDebugInfo);
|
TRACE_GUI(" image debug info: %p\n", imageDebugInfo);
|
||||||
|
|
||||||
Reference<ImageDebugInfo> imageDebugInfoReference(imageDebugInfo);
|
BReference<ImageDebugInfo> imageDebugInfoReference(imageDebugInfo);
|
||||||
// hold a reference until we've set it
|
// hold a reference until we've set it
|
||||||
|
|
||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
@@ -994,7 +995,7 @@ TeamWindow::_HandleSourceCodeChanged()
|
|||||||
fSourcePathView->SetText("Source file unavailable.");
|
fSourcePathView->SetText("Source file unavailable.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<SourceCode> sourceCodeReference(sourceCode);
|
BReference<SourceCode> sourceCodeReference(sourceCode);
|
||||||
|
|
||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (fTeam == NULL) {
|
if (fTeam == NULL) {
|
||||||
for (int32 i = 0; Thread* thread = fThreads.ItemAt(i); i++)
|
for (int32 i = 0; Thread* thread = fThreads.ItemAt(i); i++)
|
||||||
thread->RemoveReference();
|
thread->ReleaseReference();
|
||||||
fThreads.MakeEmpty();
|
fThreads.MakeEmpty();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
// TODO: Not particularly efficient!
|
// TODO: Not particularly efficient!
|
||||||
fThreads.RemoveItemAt(index);
|
fThreads.RemoveItemAt(index);
|
||||||
oldThread->RemoveReference();
|
oldThread->ReleaseReference();
|
||||||
NotifyRowsRemoved(index, 1);
|
NotifyRowsRemoved(index, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ public:
|
|||||||
if (!fThreads.AddItem(newThread))
|
if (!fThreads.AddItem(newThread))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
newThread->AddReference();
|
newThread->AcquireReference();
|
||||||
newThread = it.Next();
|
newThread = it.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class VariablesView::ModelNode : public Referenceable {
|
class VariablesView::ModelNode : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
ModelNode(ModelNode* parent, ValueNodeChild* nodeChild,
|
ModelNode(ModelNode* parent, ValueNodeChild* nodeChild,
|
||||||
bool isPresentationNode)
|
bool isPresentationNode)
|
||||||
@@ -1404,13 +1404,13 @@ VariablesView::TreeTableCellMouseDown(TreeTable* table,
|
|||||||
SettingsMenu* settingsMenu;
|
SettingsMenu* settingsMenu;
|
||||||
status_t error = node->GetValueHandler()->CreateTableCellValueSettingsMenu(
|
status_t error = node->GetValueHandler()->CreateTableCellValueSettingsMenu(
|
||||||
node->GetValue(), settings, settingsMenu);
|
node->GetValue(), settings, settingsMenu);
|
||||||
Reference<SettingsMenu> settingsMenuReference(settingsMenu, true);
|
BReference<SettingsMenu> settingsMenuReference(settingsMenu, true);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TableCellContextMenuTracker* tracker = new(std::nothrow)
|
TableCellContextMenuTracker* tracker = new(std::nothrow)
|
||||||
TableCellContextMenuTracker(node, Looper(), this);
|
TableCellContextMenuTracker(node, Looper(), this);
|
||||||
Reference<TableCellContextMenuTracker> trackerReference(tracker);
|
BReference<TableCellContextMenuTracker> trackerReference(tracker);
|
||||||
if (tracker == NULL || tracker->Init(settings, settingsMenu) != B_OK)
|
if (tracker == NULL || tracker->Init(settings, settingsMenu) != B_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1455,7 +1455,7 @@ VariablesView::_RequestNodeValue(ModelNode* node)
|
|||||||
ValueNodeChild* nodeChild = node->NodeChild();
|
ValueNodeChild* nodeChild = node->NodeChild();
|
||||||
ValueNodeContainer* container = nodeChild->Container();
|
ValueNodeContainer* container = nodeChild->Container();
|
||||||
|
|
||||||
Reference<ValueNodeContainer> containerReference(container);
|
BReference<ValueNodeContainer> containerReference(container);
|
||||||
AutoLocker<ValueNodeContainer> containerLocker(container);
|
AutoLocker<ValueNodeContainer> containerLocker(container);
|
||||||
|
|
||||||
if (container == NULL || nodeChild->Container() != container)
|
if (container == NULL || nodeChild->Container() != container)
|
||||||
@@ -1469,7 +1469,7 @@ VariablesView::_RequestNodeValue(ModelNode* node)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<ValueNode> valueNodeReference(valueNode);
|
BReference<ValueNode> valueNodeReference(valueNode);
|
||||||
containerLocker.Unlock();
|
containerLocker.Unlock();
|
||||||
|
|
||||||
// request resolution of the value
|
// request resolution of the value
|
||||||
@@ -1503,13 +1503,13 @@ VariablesView::_SaveViewState() const
|
|||||||
FunctionID* functionID = fStackFrame->Function()->GetFunctionID();
|
FunctionID* functionID = fStackFrame->Function()->GetFunctionID();
|
||||||
if (functionID == NULL)
|
if (functionID == NULL)
|
||||||
return;
|
return;
|
||||||
Reference<FunctionID> functionIDReference(functionID, true);
|
BReference<FunctionID> functionIDReference(functionID, true);
|
||||||
|
|
||||||
// create an empty view state
|
// create an empty view state
|
||||||
VariablesViewState* viewState = new(std::nothrow) VariablesViewState;
|
VariablesViewState* viewState = new(std::nothrow) VariablesViewState;
|
||||||
if (viewState == NULL)
|
if (viewState == NULL)
|
||||||
return;
|
return;
|
||||||
Reference<VariablesViewState> viewStateReference(viewState, true);
|
BReference<VariablesViewState> viewStateReference(viewState, true);
|
||||||
|
|
||||||
if (viewState->Init() != B_OK)
|
if (viewState->Init() != B_OK)
|
||||||
return;
|
return;
|
||||||
@@ -1544,7 +1544,7 @@ VariablesView::_RestoreViewState()
|
|||||||
FunctionID* functionID = fStackFrame->Function()->GetFunctionID();
|
FunctionID* functionID = fStackFrame->Function()->GetFunctionID();
|
||||||
if (functionID == NULL)
|
if (functionID == NULL)
|
||||||
return;
|
return;
|
||||||
Reference<FunctionID> functionIDReference(functionID, true);
|
BReference<FunctionID> functionIDReference(functionID, true);
|
||||||
|
|
||||||
// get the previous view state
|
// get the previous view state
|
||||||
VariablesViewState* viewState = fViewStateHistory->GetState(fThread->ID(),
|
VariablesViewState* viewState = fViewStateHistory->GetState(fThread->ID(),
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ status_t
|
|||||||
TypeHandlerRoster::RegisterDefaultHandlers()
|
TypeHandlerRoster::RegisterDefaultHandlers()
|
||||||
{
|
{
|
||||||
TypeHandler* handler;
|
TypeHandler* handler;
|
||||||
Reference<TypeHandler> handlerReference;
|
BReference<TypeHandler> handlerReference;
|
||||||
|
|
||||||
#undef REGISTER_HANDLER
|
#undef REGISTER_HANDLER
|
||||||
#define REGISTER_HANDLER(name) \
|
#define REGISTER_HANDLER(name) \
|
||||||
@@ -187,7 +187,7 @@ TypeHandlerRoster::CreateValueNode(ValueNodeChild* nodeChild, Type* type,
|
|||||||
status_t error = FindTypeHandler(nodeChild, type, handler);
|
status_t error = FindTypeHandler(nodeChild, type, handler);
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
// let the handler create the node
|
// let the handler create the node
|
||||||
Reference<TypeHandler> handlerReference(handler, true);
|
BReference<TypeHandler> handlerReference(handler, true);
|
||||||
return handler->CreateValueNode(nodeChild, type, _node);
|
return handler->CreateValueNode(nodeChild, type, _node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,5 +216,5 @@ void
|
|||||||
TypeHandlerRoster::UnregisterHandler(TypeHandler* handler)
|
TypeHandlerRoster::UnregisterHandler(TypeHandler* handler)
|
||||||
{
|
{
|
||||||
if (fTypeHandlers.RemoveItem(handler))
|
if (fTypeHandlers.RemoveItem(handler))
|
||||||
handler->RemoveReference();
|
handler->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,5 +186,5 @@ void
|
|||||||
ValueHandlerRoster::UnregisterHandler(ValueHandler* handler)
|
ValueHandlerRoster::UnregisterHandler(ValueHandler* handler)
|
||||||
{
|
{
|
||||||
if (fValueHandlers.RemoveItem(handler))
|
if (fValueHandlers.RemoveItem(handler))
|
||||||
handler->RemoveReference();
|
handler->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ ValueNodeChild::SetNode(ValueNode* node)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ValueNode* oldNode = fNode;
|
ValueNode* oldNode = fNode;
|
||||||
Reference<ValueNode> oldNodeReference(oldNode, true);
|
BReference<ValueNode> oldNodeReference(oldNode, true);
|
||||||
|
|
||||||
if (fNode != NULL)
|
if (fNode != NULL)
|
||||||
fNode->SetContainer(NULL);
|
fNode->SetContainer(NULL);
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ ValueNodeContainer::RemoveChild(ValueNodeChild* child)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
child->SetContainer(NULL);
|
child->SetContainer(NULL);
|
||||||
child->RemoveReference();
|
child->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ ValueNodeContainer::RemoveAllChildren()
|
|||||||
{
|
{
|
||||||
for (int32 i = 0; ValueNodeChild* child = ChildAt(i); i++) {
|
for (int32 i = 0; ValueNodeChild* child = ChildAt(i); i++) {
|
||||||
child->SetContainer(NULL);
|
child->SetContainer(NULL);
|
||||||
child->RemoveReference();
|
child->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
fChildren.MakeEmpty();
|
fChildren.MakeEmpty();
|
||||||
|
|||||||
@@ -160,14 +160,14 @@ IntegerValueHandler::GetTableCellValueRenderer(Value* _value,
|
|||||||
= _CreateTableCellSettingsDescription(value);
|
= _CreateTableCellSettingsDescription(value);
|
||||||
if (settingsDescription == NULL)
|
if (settingsDescription == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<SettingsDescription> settingsDescriptionReference(
|
BReference<SettingsDescription> settingsDescriptionReference(
|
||||||
settingsDescription, true);
|
settingsDescription, true);
|
||||||
|
|
||||||
// create config
|
// create config
|
||||||
TableCellRendererConfig* config = new(std::nothrow) TableCellRendererConfig;
|
TableCellRendererConfig* config = new(std::nothrow) TableCellRendererConfig;
|
||||||
if (config == NULL)
|
if (config == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<TableCellRendererConfig> configReference(config, true);
|
BReference<TableCellRendererConfig> configReference(config, true);
|
||||||
|
|
||||||
status_t error = config->Init(settingsDescription);
|
status_t error = config->Init(settingsDescription);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
@@ -270,14 +270,14 @@ IntegerValueHandler::_CreateTableCellSettingsDescription(
|
|||||||
SettingsDescription* description = new(std::nothrow) SettingsDescription;
|
SettingsDescription* description = new(std::nothrow) SettingsDescription;
|
||||||
if (description == NULL)
|
if (description == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
Reference<SettingsDescription> descriptionReference(description, true);
|
BReference<SettingsDescription> descriptionReference(description, true);
|
||||||
|
|
||||||
// integer format setting
|
// integer format setting
|
||||||
OptionsSettingImpl* setting = new(std::nothrow) OptionsSettingImpl(
|
OptionsSettingImpl* setting = new(std::nothrow) OptionsSettingImpl(
|
||||||
kFormatSettingID, "Format");
|
kFormatSettingID, "Format");
|
||||||
if (setting == NULL)
|
if (setting == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
Reference<OptionsSettingImpl> settingReference(setting, true);
|
BReference<OptionsSettingImpl> settingReference(setting, true);
|
||||||
|
|
||||||
// add options
|
// add options
|
||||||
if (AddIntegerFormatSettingOptions(value, setting) != B_OK)
|
if (AddIntegerFormatSettingOptions(value, setting) != B_OK)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ AbstractArrayValueNode::~AbstractArrayValueNode()
|
|||||||
|
|
||||||
for (int32 i = 0; AbstractArrayValueNodeChild* child = fChildren.ItemAt(i);
|
for (int32 i = 0; AbstractArrayValueNodeChild* child = fChildren.ItemAt(i);
|
||||||
i++) {
|
i++) {
|
||||||
child->RemoveReference();
|
child->ReleaseReference();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ CompoundValueNode::~CompoundValueNode()
|
|||||||
fType->ReleaseReference();
|
fType->ReleaseReference();
|
||||||
|
|
||||||
for (int32 i = 0; Child* child = fChildren.ItemAt(i); i++)
|
for (int32 i = 0; Child* child = fChildren.ItemAt(i); i++)
|
||||||
child->RemoveReference();
|
child->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ DiskDeviceJob::DiskDeviceJob(PartitionReference* partition,
|
|||||||
fChild(child)
|
fChild(child)
|
||||||
{
|
{
|
||||||
if (fPartition)
|
if (fPartition)
|
||||||
fPartition->AddReference();
|
fPartition->AcquireReference();
|
||||||
|
|
||||||
if (fChild)
|
if (fChild)
|
||||||
fChild->AddReference();
|
fChild->AcquireReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -26,8 +26,8 @@ DiskDeviceJob::DiskDeviceJob(PartitionReference* partition,
|
|||||||
DiskDeviceJob::~DiskDeviceJob()
|
DiskDeviceJob::~DiskDeviceJob()
|
||||||
{
|
{
|
||||||
if (fPartition)
|
if (fPartition)
|
||||||
fPartition->RemoveReference();
|
fPartition->ReleaseReference();
|
||||||
|
|
||||||
if (fChild)
|
if (fChild)
|
||||||
fChild->RemoveReference();
|
fChild->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ struct DiskDeviceJobGenerator::PartitionRefInfo {
|
|||||||
~PartitionRefInfo()
|
~PartitionRefInfo()
|
||||||
{
|
{
|
||||||
if (reference)
|
if (reference)
|
||||||
reference->RemoveReference();
|
reference->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
BPartition* partition;
|
BPartition* partition;
|
||||||
|
|||||||
@@ -8,9 +8,10 @@
|
|||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
PartitionReference::PartitionReference(partition_id id, int32 changeCounter)
|
PartitionReference::PartitionReference(partition_id id, int32 changeCounter)
|
||||||
: Referenceable(true), // delete when unreferenced
|
:
|
||||||
fID(id),
|
BReferenceable(),
|
||||||
fChangeCounter(changeCounter)
|
fID(id),
|
||||||
|
fChangeCounter(changeCounter)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
|
|
||||||
class PartitionReference : public Referenceable {
|
class PartitionReference : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
PartitionReference(partition_id id = -1,
|
PartitionReference(partition_id id = -1,
|
||||||
int32 changeCounter = 0);
|
int32 changeCounter = 0);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ MoveJob::~MoveJob()
|
|||||||
{
|
{
|
||||||
if (fContents) {
|
if (fContents) {
|
||||||
for (int32 i = 0; i < fContentsCount; i++)
|
for (int32 i = 0; i < fContentsCount; i++)
|
||||||
fContents[i]->RemoveReference();
|
fContents[i]->ReleaseReference();
|
||||||
delete[] fContents;
|
delete[] fContents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@ MoveJob::Init(off_t offset, PartitionReference** contents, int32 contentsCount)
|
|||||||
fContentsCount = contentsCount;
|
fContentsCount = contentsCount;
|
||||||
for (int32 i = 0; i < contentsCount; i++) {
|
for (int32 i = 0; i < contentsCount; i++) {
|
||||||
fContents[i] = contents[i];
|
fContents[i] = contents[i];
|
||||||
fContents[i]->AddReference();
|
fContents[i]->AcquireReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
fOffset = offset;
|
fOffset = offset;
|
||||||
|
|||||||
Reference in New Issue
Block a user