Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Commit

Permalink
Address @fjricci's review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSB committed Apr 7, 2018
1 parent 6081095 commit 7f4e6f9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Headers/DebugServer2/Core/HardwareBreakpointManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ class HardwareBreakpointManager : public BreakpointManager {

protected:
bool softwareImplementationOfReadonlyWatchpoints(Address const &address,
Site & site);
Site &site);
ErrorCode storeNewValueAtAddress(Address const &address);

protected:
bool enabled(Target::Thread *thread = nullptr) const override;

public:
virtual size_t maxWatchpoints();
virtual bool checkIfWrittenTo(Address const &address);
virtual bool wasWritten(Address const &address);

public:
void enable(Target::Thread *thread = nullptr) override;
Expand Down
6 changes: 2 additions & 4 deletions Sources/Core/ARM/HardwareBreakpointManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ size_t HardwareBreakpointManager::maxWatchpoints() {
return _process->getMaxWatchpoints();
}

bool HardwareBreakpointManager::checkIfWrittenTo(Address const &address) {
bool implemented = false;
DS2ASSERT(implemented);
return implemented;
bool HardwareBreakpointManager::wasWritten(Address const &address) {
DS2BUG("not implemented");
}

ErrorCode HardwareBreakpointManager::isValid(Address const &address,
Expand Down
5 changes: 2 additions & 3 deletions Sources/Core/HardwareBreakpointManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ HardwareBreakpointManager::HardwareBreakpointManager(
Target::ProcessBase *process)
: super(process), _locations(maxWatchpoints()) {}


HardwareBreakpointManager::~HardwareBreakpointManager() {}

ErrorCode HardwareBreakpointManager::add(Address const &address,
Expand Down Expand Up @@ -106,7 +105,7 @@ HardwareBreakpointManager::softwareImplementationOfReadonlyWatchpoints(
// if this is a readonly hardware watchpoint
case kModeRead:
// if written to, return false. if not, invoke super.
return checkIfWrittenTo(address) ? false : super::hit(address, site);
return wasWritten(address) ? false : super::hit(address, site);
break;
default:
return super::hit(address, site);
Expand Down Expand Up @@ -143,7 +142,7 @@ int HardwareBreakpointManager::getAvailableLocation() {
auto it = std::find(_locations.begin(), _locations.end(), 0);
DS2ASSERT(it != _locations.end());

return (it - _locations.begin());
return it - _locations.begin();
}

void HardwareBreakpointManager::enumerateThreads(
Expand Down
2 changes: 1 addition & 1 deletion Sources/Core/X86/HardwareBreakpointManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ size_t HardwareBreakpointManager::maxWatchpoints() {
return 4; // dr0, dr1, dr2, dr3
}

bool HardwareBreakpointManager::checkIfWrittenTo(Address const &address) {
bool HardwareBreakpointManager::wasWritten(Address const &address) {
Site site;
try {
site = _sites.at(address);
Expand Down

0 comments on commit 7f4e6f9

Please sign in to comment.