From de17fa5b4ca86494c35021a0450b5a60d8eedf41 Mon Sep 17 00:00:00 2001 From: "ulan@chromium.org" Date: Tue, 2 Apr 2013 12:36:16 +0000 Subject: [PATCH] Cleanup: Rename Simulator::watched_stops to match style guide. BUG=none Review URL: https://chromiumcodereview.appspot.com/13469002 Patch from Hans Wennborg . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14113 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/simulator-arm.cc | 26 +++++++++++++------------- src/arm/simulator-arm.h | 6 +++--- src/mips/simulator-mips.cc | 26 +++++++++++++------------- src/mips/simulator-mips.h | 6 +++--- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc index b7bc839059..2551e14e49 100644 --- a/src/arm/simulator-arm.cc +++ b/src/arm/simulator-arm.cc @@ -112,8 +112,8 @@ void ArmDebugger::Stop(Instruction* instr) { ASSERT(msg != NULL); // Update this stop description. - if (isWatchedStop(code) && !watched_stops[code].desc) { - watched_stops[code].desc = msg; + if (isWatchedStop(code) && !watched_stops_[code].desc) { + watched_stops_[code].desc = msg; } if (strlen(msg) > 0) { @@ -141,8 +141,8 @@ void ArmDebugger::Stop(Instruction* instr) { char* msg = *reinterpret_cast(sim_->get_pc() + Instruction::kInstrSize); // Update this stop description. - if (sim_->isWatchedStop(code) && !sim_->watched_stops[code].desc) { - sim_->watched_stops[code].desc = msg; + if (sim_->isWatchedStop(code) && !sim_->watched_stops_[code].desc) { + sim_->watched_stops_[code].desc = msg; } // Print the stop message and code if it is not the default code. if (code != kMaxStopCode) { @@ -1880,14 +1880,14 @@ bool Simulator::isEnabledStop(uint32_t code) { ASSERT(code <= kMaxStopCode); // Unwatched stops are always enabled. return !isWatchedStop(code) || - !(watched_stops[code].count & kStopDisabledBit); + !(watched_stops_[code].count & kStopDisabledBit); } void Simulator::EnableStop(uint32_t code) { ASSERT(isWatchedStop(code)); if (!isEnabledStop(code)) { - watched_stops[code].count &= ~kStopDisabledBit; + watched_stops_[code].count &= ~kStopDisabledBit; } } @@ -1895,7 +1895,7 @@ void Simulator::EnableStop(uint32_t code) { void Simulator::DisableStop(uint32_t code) { ASSERT(isWatchedStop(code)); if (isEnabledStop(code)) { - watched_stops[code].count |= kStopDisabledBit; + watched_stops_[code].count |= kStopDisabledBit; } } @@ -1903,13 +1903,13 @@ void Simulator::DisableStop(uint32_t code) { void Simulator::IncreaseStopCounter(uint32_t code) { ASSERT(code <= kMaxStopCode); ASSERT(isWatchedStop(code)); - if ((watched_stops[code].count & ~(1 << 31)) == 0x7fffffff) { + if ((watched_stops_[code].count & ~(1 << 31)) == 0x7fffffff) { PrintF("Stop counter for code %i has overflowed.\n" "Enabling this code and reseting the counter to 0.\n", code); - watched_stops[code].count = 0; + watched_stops_[code].count = 0; EnableStop(code); } else { - watched_stops[code].count++; + watched_stops_[code].count++; } } @@ -1921,12 +1921,12 @@ void Simulator::PrintStopInfo(uint32_t code) { PrintF("Stop not watched."); } else { const char* state = isEnabledStop(code) ? "Enabled" : "Disabled"; - int32_t count = watched_stops[code].count & ~kStopDisabledBit; + int32_t count = watched_stops_[code].count & ~kStopDisabledBit; // Don't print the state of unused breakpoints. if (count != 0) { - if (watched_stops[code].desc) { + if (watched_stops_[code].desc) { PrintF("stop %i - 0x%x: \t%s, \tcounter = %i, \t%s\n", - code, code, state, count, watched_stops[code].desc); + code, code, state, count, watched_stops_[code].desc); } else { PrintF("stop %i - 0x%x: \t%s, \tcounter = %i\n", code, code, state, count); diff --git a/src/arm/simulator-arm.h b/src/arm/simulator-arm.h index 907a590665..b918ecf963 100644 --- a/src/arm/simulator-arm.h +++ b/src/arm/simulator-arm.h @@ -414,14 +414,14 @@ class Simulator { static const uint32_t kStopDisabledBit = 1 << 31; // A stop is enabled, meaning the simulator will stop when meeting the - // instruction, if bit 31 of watched_stops[code].count is unset. - // The value watched_stops[code].count & ~(1 << 31) indicates how many times + // instruction, if bit 31 of watched_stops_[code].count is unset. + // The value watched_stops_[code].count & ~(1 << 31) indicates how many times // the breakpoint was hit or gone through. struct StopCountAndDesc { uint32_t count; char* desc; }; - StopCountAndDesc watched_stops[kNumOfWatchedStops]; + StopCountAndDesc watched_stops_[kNumOfWatchedStops]; }; diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc index 7f35fb37a0..5eb79eb780 100644 --- a/src/mips/simulator-mips.cc +++ b/src/mips/simulator-mips.cc @@ -132,8 +132,8 @@ void MipsDebugger::Stop(Instruction* instr) { ASSERT(msg != NULL); // Update this stop description. - if (!watched_stops[code].desc) { - watched_stops[code].desc = msg; + if (!watched_stops_[code].desc) { + watched_stops_[code].desc = msg; } if (strlen(msg) > 0) { @@ -163,8 +163,8 @@ void MipsDebugger::Stop(Instruction* instr) { char* msg = *reinterpret_cast(sim_->get_pc() + Instruction::kInstrSize); // Update this stop description. - if (!sim_->watched_stops[code].desc) { - sim_->watched_stops[code].desc = msg; + if (!sim_->watched_stops_[code].desc) { + sim_->watched_stops_[code].desc = msg; } PrintF("Simulator hit %s (%u)\n", msg, code); sim_->set_pc(sim_->get_pc() + 2 * Instruction::kInstrSize); @@ -1636,33 +1636,33 @@ bool Simulator::IsStopInstruction(Instruction* instr) { bool Simulator::IsEnabledStop(uint32_t code) { ASSERT(code <= kMaxStopCode); ASSERT(code > kMaxWatchpointCode); - return !(watched_stops[code].count & kStopDisabledBit); + return !(watched_stops_[code].count & kStopDisabledBit); } void Simulator::EnableStop(uint32_t code) { if (!IsEnabledStop(code)) { - watched_stops[code].count &= ~kStopDisabledBit; + watched_stops_[code].count &= ~kStopDisabledBit; } } void Simulator::DisableStop(uint32_t code) { if (IsEnabledStop(code)) { - watched_stops[code].count |= kStopDisabledBit; + watched_stops_[code].count |= kStopDisabledBit; } } void Simulator::IncreaseStopCounter(uint32_t code) { ASSERT(code <= kMaxStopCode); - if ((watched_stops[code].count & ~(1 << 31)) == 0x7fffffff) { + if ((watched_stops_[code].count & ~(1 << 31)) == 0x7fffffff) { PrintF("Stop counter for code %i has overflowed.\n" "Enabling this code and reseting the counter to 0.\n", code); - watched_stops[code].count = 0; + watched_stops_[code].count = 0; EnableStop(code); } else { - watched_stops[code].count++; + watched_stops_[code].count++; } } @@ -1677,12 +1677,12 @@ void Simulator::PrintStopInfo(uint32_t code) { return; } const char* state = IsEnabledStop(code) ? "Enabled" : "Disabled"; - int32_t count = watched_stops[code].count & ~kStopDisabledBit; + int32_t count = watched_stops_[code].count & ~kStopDisabledBit; // Don't print the state of unused breakpoints. if (count != 0) { - if (watched_stops[code].desc) { + if (watched_stops_[code].desc) { PrintF("stop %i - 0x%x: \t%s, \tcounter = %i, \t%s\n", - code, code, state, count, watched_stops[code].desc); + code, code, state, count, watched_stops_[code].desc); } else { PrintF("stop %i - 0x%x: \t%s, \tcounter = %i\n", code, code, state, count); diff --git a/src/mips/simulator-mips.h b/src/mips/simulator-mips.h index 67f595302b..ed6344342d 100644 --- a/src/mips/simulator-mips.h +++ b/src/mips/simulator-mips.h @@ -391,14 +391,14 @@ class Simulator { static const uint32_t kStopDisabledBit = 1 << 31; // A stop is enabled, meaning the simulator will stop when meeting the - // instruction, if bit 31 of watched_stops[code].count is unset. - // The value watched_stops[code].count & ~(1 << 31) indicates how many times + // instruction, if bit 31 of watched_stops_[code].count is unset. + // The value watched_stops_[code].count & ~(1 << 31) indicates how many times // the breakpoint was hit or gone through. struct StopCountAndDesc { uint32_t count; char* desc; }; - StopCountAndDesc watched_stops[kMaxStopCode + 1]; + StopCountAndDesc watched_stops_[kMaxStopCode + 1]; };