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