Add hidden attribute to UserBreakpoint.

Marks a breakpoint as one that should not be exposed in the UI's normal
breakpoint management interface. Adjust settings management to
preserve/restore appropriately.
This commit is contained in:
Rene Gollent 2013-06-15 14:45:16 -04:00
parent 41bf99064c
commit b9461dc8cd
5 changed files with 35 additions and 7 deletions

View File

@ -1,5 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
@ -99,7 +100,8 @@ UserBreakpoint::UserBreakpoint(const UserBreakpointLocation& location)
:
fLocation(location),
fValid(false),
fEnabled(false)
fEnabled(false),
fHidden(false)
{
}
@ -160,3 +162,10 @@ UserBreakpoint::SetEnabled(bool enabled)
{
fEnabled = enabled;
}
void
UserBreakpoint::SetHidden(bool hidden)
{
fHidden = hidden;
}

View File

@ -1,5 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef USER_BREAKPOINT_H
@ -100,6 +101,9 @@ public:
void SetEnabled(bool enabled);
// BreakpointManager only
bool IsHidden() const { return fHidden; }
void SetHidden(bool hidden);
private:
typedef BObjectList<UserBreakpointInstance> InstanceList;
@ -108,6 +112,7 @@ private:
InstanceList fInstances;
bool fValid;
bool fEnabled;
bool fHidden;
};

View File

@ -1,5 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
@ -20,7 +21,8 @@ BreakpointSetting::BreakpointSetting()
fSourceFile(),
fSourceLocation(),
fRelativeAddress(0),
fEnabled(false)
fEnabled(false),
fHidden(false)
{
}
@ -31,7 +33,8 @@ BreakpointSetting::BreakpointSetting(const BreakpointSetting& other)
fSourceFile(other.fSourceFile),
fSourceLocation(other.fSourceLocation),
fRelativeAddress(other.fRelativeAddress),
fEnabled(other.fEnabled)
fEnabled(other.fEnabled),
fHidden(other.fHidden)
{
if (fFunctionID != NULL)
fFunctionID->AcquireReference();
@ -45,7 +48,8 @@ BreakpointSetting::~BreakpointSetting()
status_t
BreakpointSetting::SetTo(const UserBreakpointLocation& location, bool enabled)
BreakpointSetting::SetTo(const UserBreakpointLocation& location, bool enabled,
bool hidden)
{
_Unset();
@ -59,6 +63,7 @@ BreakpointSetting::SetTo(const UserBreakpointLocation& location, bool enabled)
fSourceLocation = location.GetSourceLocation();
fRelativeAddress = location.RelativeAddress();
fEnabled = enabled;
fHidden = hidden;
return B_OK;
}
@ -92,6 +97,9 @@ BreakpointSetting::SetTo(const BMessage& archive)
if (archive.FindBool("enabled", &fEnabled) != B_OK)
fEnabled = false;
if (archive.FindBool("hidden", &fHidden) != B_OK)
fHidden = false;
return B_OK;
}
@ -113,7 +121,8 @@ BreakpointSetting::WriteTo(BMessage& archive) const
!= B_OK
|| (error = archive.AddUInt64("relativeAddress", fRelativeAddress))
!= B_OK
|| (error = archive.AddBool("enabled", fEnabled)) != B_OK) {
|| (error = archive.AddBool("enabled", fEnabled)) != B_OK
|| (error = archive.AddBool("hidden", fHidden)) != B_OK) {
return error;
}
@ -137,6 +146,7 @@ BreakpointSetting::operator=(const BreakpointSetting& other)
fSourceLocation = other.fSourceLocation;
fRelativeAddress = other.fRelativeAddress;
fEnabled = other.fEnabled;
fHidden = other.fHidden;
return *this;
}

View File

@ -1,5 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef BREAKPOINT_SETTING_H
@ -27,7 +28,7 @@ public:
~BreakpointSetting();
status_t SetTo(const UserBreakpointLocation& location,
bool enabled);
bool enabled, bool hidden);
status_t SetTo(const BMessage& archive);
status_t WriteTo(BMessage& archive) const;
@ -39,6 +40,7 @@ public:
{ return fRelativeAddress; }
bool IsEnabled() const { return fEnabled; }
bool IsHidden() const { return fHidden; }
BreakpointSetting& operator=(const BreakpointSetting& other);
@ -51,6 +53,7 @@ private:
SourceLocation fSourceLocation;
target_addr_t fRelativeAddress;
bool fEnabled;
bool fHidden;
};

View File

@ -1,5 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
@ -61,7 +62,7 @@ TeamSettings::SetTo(Team* team)
return B_NO_MEMORY;
status_t error = breakpointSetting->SetTo(breakpoint->Location(),
breakpoint->IsEnabled());
breakpoint->IsEnabled(), breakpoint->IsHidden());
if (error == B_OK && !fBreakpoints.AddItem(breakpointSetting))
error = B_NO_MEMORY;
if (error != B_OK) {