Revert preservation of watchpoints in settings.
This commit is contained in:
@@ -150,7 +150,6 @@ Application Debugger :
|
|||||||
TeamSettings.cpp
|
TeamSettings.cpp
|
||||||
TeamUiSettings.cpp
|
TeamUiSettings.cpp
|
||||||
TeamUiSettingsFactory.cpp
|
TeamUiSettingsFactory.cpp
|
||||||
WatchpointSetting.cpp
|
|
||||||
|
|
||||||
# settings/generic
|
# settings/generic
|
||||||
Setting.cpp
|
Setting.cpp
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
#include "ValueNodeContainer.h"
|
#include "ValueNodeContainer.h"
|
||||||
#include "Variable.h"
|
#include "Variable.h"
|
||||||
#include "WatchpointManager.h"
|
#include "WatchpointManager.h"
|
||||||
#include "WatchpointSetting.h"
|
|
||||||
|
|
||||||
// #pragma mark - ImageHandler
|
// #pragma mark - ImageHandler
|
||||||
|
|
||||||
@@ -1583,21 +1583,6 @@ TeamDebugger::_LoadSettings()
|
|||||||
breakpointSetting->IsEnabled());
|
breakpointSetting->IsEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the saved watchpoints;
|
|
||||||
for (int32 i = 0; const WatchpointSetting* watchpointSetting
|
|
||||||
= fTeamSettings.WatchpointAt(i); i++) {
|
|
||||||
Watchpoint* watchpoint = new(std::nothrow) Watchpoint(
|
|
||||||
watchpointSetting->Address(), watchpointSetting->Type(),
|
|
||||||
watchpointSetting->Length());
|
|
||||||
if (watchpoint == NULL)
|
|
||||||
return;
|
|
||||||
BReference<Watchpoint> watchpointReference(watchpoint, true);
|
|
||||||
|
|
||||||
// install it
|
|
||||||
fWatchpointManager->InstallWatchpoint(watchpoint,
|
|
||||||
watchpointSetting->IsEnabled());
|
|
||||||
}
|
|
||||||
|
|
||||||
const TeamUiSettings* uiSettings = fTeamSettings.UiSettingFor(
|
const TeamUiSettings* uiSettings = fTeamSettings.UiSettingFor(
|
||||||
fUserInterface->ID());
|
fUserInterface->ID());
|
||||||
if (uiSettings != NULL)
|
if (uiSettings != NULL)
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#include "TeamUiSettings.h"
|
#include "TeamUiSettings.h"
|
||||||
#include "TeamUiSettingsFactory.h"
|
#include "TeamUiSettingsFactory.h"
|
||||||
#include "UserBreakpoint.h"
|
#include "UserBreakpoint.h"
|
||||||
#include "WatchpointSetting.h"
|
|
||||||
|
|
||||||
|
|
||||||
TeamSettings::TeamSettings()
|
TeamSettings::TeamSettings()
|
||||||
@@ -71,23 +70,6 @@ TeamSettings::SetTo(Team* team)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add watchpoints
|
|
||||||
for (int32 i = 0; Watchpoint* watchpoint = team->WatchpointAt(i); i++) {
|
|
||||||
WatchpointSetting* watchpointSetting
|
|
||||||
= new(std::nothrow) WatchpointSetting;
|
|
||||||
if (watchpointSetting == NULL)
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
|
|
||||||
status_t error = watchpointSetting->SetTo(*watchpoint,
|
|
||||||
watchpoint->IsEnabled());
|
|
||||||
if (error == B_OK && !fWatchpoints.AddItem(watchpointSetting))
|
|
||||||
error = B_NO_MEMORY;
|
|
||||||
if (error != B_OK) {
|
|
||||||
delete watchpointSetting;
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,24 +101,6 @@ TeamSettings::SetTo(const BMessage& archive)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add watchpoints
|
|
||||||
for (int32 i = 0; archive.FindMessage("watchpoints", i, &childArchive)
|
|
||||||
== B_OK; i++) {
|
|
||||||
WatchpointSetting* watchpointSetting
|
|
||||||
= new(std::nothrow) WatchpointSetting;
|
|
||||||
if (watchpointSetting == NULL)
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
|
|
||||||
error = watchpointSetting->SetTo(childArchive);
|
|
||||||
if (error == B_OK && !fWatchpoints.AddItem(watchpointSetting))
|
|
||||||
error = B_NO_MEMORY;
|
|
||||||
if (error != B_OK) {
|
|
||||||
delete watchpointSetting;
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// add UI settings
|
// add UI settings
|
||||||
for (int32 i = 0; archive.FindMessage("uisettings", i, &childArchive)
|
for (int32 i = 0; archive.FindMessage("uisettings", i, &childArchive)
|
||||||
== B_OK; i++) {
|
== B_OK; i++) {
|
||||||
@@ -173,17 +137,6 @@ TeamSettings::WriteTo(BMessage& archive) const
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32 i = 0; WatchpointSetting* watchpoint = fWatchpoints.ItemAt(i);
|
|
||||||
i++) {
|
|
||||||
error = watchpoint->WriteTo(childArchive);
|
|
||||||
if (error != B_OK)
|
|
||||||
return error;
|
|
||||||
|
|
||||||
error = archive.AddMessage("watchpoints", &childArchive);
|
|
||||||
if (error != B_OK)
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int32 i = 0; TeamUiSettings* uiSetting = fUiSettings.ItemAt(i);
|
for (int32 i = 0; TeamUiSettings* uiSetting = fUiSettings.ItemAt(i);
|
||||||
i++) {
|
i++) {
|
||||||
error = uiSetting->WriteTo(childArchive);
|
error = uiSetting->WriteTo(childArchive);
|
||||||
@@ -213,20 +166,6 @@ TeamSettings::BreakpointAt(int32 index) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32
|
|
||||||
TeamSettings::CountWatchpoints() const
|
|
||||||
{
|
|
||||||
return fWatchpoints.CountItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const WatchpointSetting*
|
|
||||||
TeamSettings::WatchpointAt(int32 index) const
|
|
||||||
{
|
|
||||||
return fWatchpoints.ItemAt(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int32
|
int32
|
||||||
TeamSettings::CountUiSettings() const
|
TeamSettings::CountUiSettings() const
|
||||||
{
|
{
|
||||||
@@ -284,16 +223,6 @@ TeamSettings::operator=(const TeamSettings& other)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32 i = 0; WatchpointSetting* watchpoint
|
|
||||||
= other.fWatchpoints.ItemAt(i); i++) {
|
|
||||||
WatchpointSetting* clonedWatchpoint
|
|
||||||
= new WatchpointSetting(*watchpoint);
|
|
||||||
if (!fWatchpoints.AddItem(clonedWatchpoint)) {
|
|
||||||
delete clonedWatchpoint;
|
|
||||||
throw std::bad_alloc();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int32 i = 0; TeamUiSettings* uiSetting
|
for (int32 i = 0; TeamUiSettings* uiSetting
|
||||||
= other.fUiSettings.ItemAt(i); i++) {
|
= other.fUiSettings.ItemAt(i); i++) {
|
||||||
TeamUiSettings* clonedSetting
|
TeamUiSettings* clonedSetting
|
||||||
@@ -316,16 +245,10 @@ TeamSettings::_Unset()
|
|||||||
delete breakpoint;
|
delete breakpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32 i = 0; WatchpointSetting* watchpoint = fWatchpoints.ItemAt(i);
|
|
||||||
i++) {
|
|
||||||
delete watchpoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int32 i = 0; TeamUiSettings* uiSetting = fUiSettings.ItemAt(i); i++)
|
for (int32 i = 0; TeamUiSettings* uiSetting = fUiSettings.ItemAt(i); i++)
|
||||||
delete uiSetting;
|
delete uiSetting;
|
||||||
|
|
||||||
fBreakpoints.MakeEmpty();
|
fBreakpoints.MakeEmpty();
|
||||||
fWatchpoints.MakeEmpty();
|
|
||||||
fUiSettings.MakeEmpty();
|
fUiSettings.MakeEmpty();
|
||||||
|
|
||||||
fTeamName.Truncate(0);
|
fTeamName.Truncate(0);
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ class BMessage;
|
|||||||
class Team;
|
class Team;
|
||||||
class BreakpointSetting;
|
class BreakpointSetting;
|
||||||
class TeamUiSettings;
|
class TeamUiSettings;
|
||||||
class WatchpointSetting;
|
|
||||||
|
|
||||||
|
|
||||||
class TeamSettings {
|
class TeamSettings {
|
||||||
@@ -34,9 +33,6 @@ public:
|
|||||||
int32 CountBreakpoints() const;
|
int32 CountBreakpoints() const;
|
||||||
const BreakpointSetting* BreakpointAt(int32 index) const;
|
const BreakpointSetting* BreakpointAt(int32 index) const;
|
||||||
|
|
||||||
int32 CountWatchpoints() const;
|
|
||||||
const WatchpointSetting* WatchpointAt(int32 index) const;
|
|
||||||
|
|
||||||
int32 CountUiSettings() const;
|
int32 CountUiSettings() const;
|
||||||
const TeamUiSettings* UiSettingAt(int32 index) const;
|
const TeamUiSettings* UiSettingAt(int32 index) const;
|
||||||
const TeamUiSettings* UiSettingFor(const char* id) const;
|
const TeamUiSettings* UiSettingFor(const char* id) const;
|
||||||
@@ -48,14 +44,12 @@ public:
|
|||||||
private:
|
private:
|
||||||
typedef BObjectList<BreakpointSetting> BreakpointList;
|
typedef BObjectList<BreakpointSetting> BreakpointList;
|
||||||
typedef BObjectList<TeamUiSettings> UiSettingsList;
|
typedef BObjectList<TeamUiSettings> UiSettingsList;
|
||||||
typedef BObjectList<WatchpointSetting> WatchpointList;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _Unset();
|
void _Unset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BreakpointList fBreakpoints;
|
BreakpointList fBreakpoints;
|
||||||
WatchpointList fWatchpoints;
|
|
||||||
UiSettingsList fUiSettings;
|
UiSettingsList fUiSettings;
|
||||||
BString fTeamName;
|
BString fTeamName;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,100 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
|
||||||
* Copyright 2012, Rene Gollent, [email protected].
|
|
||||||
* Distributed under the terms of the MIT License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "WatchpointSetting.h"
|
|
||||||
|
|
||||||
#include <Message.h>
|
|
||||||
|
|
||||||
#include "Watchpoint.h"
|
|
||||||
|
|
||||||
|
|
||||||
WatchpointSetting::WatchpointSetting()
|
|
||||||
:
|
|
||||||
fAddress(0),
|
|
||||||
fType(0),
|
|
||||||
fLength(0),
|
|
||||||
fEnabled(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WatchpointSetting::WatchpointSetting(const WatchpointSetting& other)
|
|
||||||
:
|
|
||||||
fAddress(other.fAddress),
|
|
||||||
fType(other.fType),
|
|
||||||
fLength(other.fLength),
|
|
||||||
fEnabled(other.fEnabled)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WatchpointSetting::~WatchpointSetting()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
WatchpointSetting::SetTo(const Watchpoint& watchpoint, bool enabled)
|
|
||||||
{
|
|
||||||
fAddress = watchpoint.Address();
|
|
||||||
fType = watchpoint.Type();
|
|
||||||
fLength = watchpoint.Length();
|
|
||||||
fEnabled = enabled;
|
|
||||||
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
WatchpointSetting::SetTo(const BMessage& archive)
|
|
||||||
{
|
|
||||||
if (archive.FindUInt64("address", &fAddress) != B_OK)
|
|
||||||
fAddress = 0;
|
|
||||||
|
|
||||||
if (archive.FindUInt32("type", &fType) != B_OK)
|
|
||||||
fType = 0;
|
|
||||||
|
|
||||||
if (archive.FindInt32("length", &fLength) != B_OK)
|
|
||||||
fLength = 0;
|
|
||||||
|
|
||||||
if (archive.FindBool("enabled", &fEnabled) != B_OK)
|
|
||||||
fEnabled = false;
|
|
||||||
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
WatchpointSetting::WriteTo(BMessage& archive) const
|
|
||||||
{
|
|
||||||
archive.MakeEmpty();
|
|
||||||
|
|
||||||
status_t error;
|
|
||||||
if ((error = archive.AddUInt64("address", fAddress)) != B_OK
|
|
||||||
|| (error = archive.AddUInt32("type", fType)) != B_OK
|
|
||||||
|| (error = archive.AddInt32("length", fLength)) != B_OK
|
|
||||||
|| (error = archive.AddBool("enabled", fEnabled)) != B_OK) {
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WatchpointSetting&
|
|
||||||
WatchpointSetting::operator=(const WatchpointSetting& other)
|
|
||||||
{
|
|
||||||
if (this == &other)
|
|
||||||
return *this;
|
|
||||||
|
|
||||||
fAddress = other.fAddress;
|
|
||||||
fType = other.fType;
|
|
||||||
fLength = other.fLength;
|
|
||||||
fEnabled = other.fEnabled;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
|
||||||
* Copyright 2012, Rene Gollent, [email protected].
|
|
||||||
* Distributed under the terms of the MIT License.
|
|
||||||
*/
|
|
||||||
#ifndef WATCHPOINT_SETTING_H
|
|
||||||
#define WATCHPOINT_SETTING_H
|
|
||||||
|
|
||||||
|
|
||||||
#include <String.h>
|
|
||||||
|
|
||||||
#include "types/Types.h"
|
|
||||||
|
|
||||||
class BMessage;
|
|
||||||
class Watchpoint;
|
|
||||||
|
|
||||||
|
|
||||||
class WatchpointSetting {
|
|
||||||
public:
|
|
||||||
WatchpointSetting();
|
|
||||||
WatchpointSetting(
|
|
||||||
const WatchpointSetting& other);
|
|
||||||
~WatchpointSetting();
|
|
||||||
|
|
||||||
status_t SetTo(const Watchpoint& watchpoint,
|
|
||||||
bool enabled);
|
|
||||||
status_t SetTo(const BMessage& archive);
|
|
||||||
status_t WriteTo(BMessage& archive) const;
|
|
||||||
|
|
||||||
target_addr_t Address() const { return fAddress; }
|
|
||||||
uint32 Type() const { return fType; }
|
|
||||||
int32 Length() const { return fLength; }
|
|
||||||
|
|
||||||
bool IsEnabled() const { return fEnabled; }
|
|
||||||
|
|
||||||
WatchpointSetting& operator=(const WatchpointSetting& other);
|
|
||||||
|
|
||||||
private:
|
|
||||||
target_addr_t fAddress;
|
|
||||||
uint32 fType;
|
|
||||||
int32 fLength;
|
|
||||||
bool fEnabled;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif // BREAKPOINT_SETTING_H
|
|
||||||
Reference in New Issue
Block a user