BreakPoints: Rename variables

Drops Hungarian notation where applicable.Drops Hungarian notation where
applicable.
This commit is contained in:
Lioncash 2017-01-11 08:27:45 -05:00
parent 274ab8a262
commit 0f8bcf412d
7 changed files with 190 additions and 186 deletions

View File

@ -140,13 +140,13 @@ void PPCDebugInterface::ToggleMemCheck(unsigned int address, bool read, bool wri
{ {
// Add Memory Check // Add Memory Check
TMemCheck MemCheck; TMemCheck MemCheck;
MemCheck.StartAddress = address; MemCheck.start_address = address;
MemCheck.EndAddress = address; MemCheck.end_address = address;
MemCheck.OnRead = read; MemCheck.is_break_on_read = read;
MemCheck.OnWrite = write; MemCheck.is_break_on_write = write;
MemCheck.Log = log; MemCheck.log_on_hit = log;
MemCheck.Break = true; MemCheck.break_on_hit = true;
PowerPC::memchecks.Add(MemCheck); PowerPC::memchecks.Add(MemCheck);
} }

View File

@ -15,8 +15,8 @@
bool BreakPoints::IsAddressBreakPoint(u32 address) const bool BreakPoints::IsAddressBreakPoint(u32 address) const
{ {
for (const TBreakPoint& bp : m_BreakPoints) for (const TBreakPoint& bp : m_breakpoints)
if (bp.iAddress == address) if (bp.address == address)
return true; return true;
return false; return false;
@ -24,8 +24,8 @@ bool BreakPoints::IsAddressBreakPoint(u32 address) const
bool BreakPoints::IsTempBreakPoint(u32 address) const bool BreakPoints::IsTempBreakPoint(u32 address) const
{ {
for (const TBreakPoint& bp : m_BreakPoints) for (const TBreakPoint& bp : m_breakpoints)
if (bp.iAddress == address && bp.bTemporary) if (bp.address == address && bp.is_temporary)
return true; return true;
return false; return false;
@ -33,69 +33,69 @@ bool BreakPoints::IsTempBreakPoint(u32 address) const
BreakPoints::TBreakPointsStr BreakPoints::GetStrings() const BreakPoints::TBreakPointsStr BreakPoints::GetStrings() const
{ {
TBreakPointsStr bps; TBreakPointsStr bp_strings;
for (const TBreakPoint& bp : m_BreakPoints) for (const TBreakPoint& bp : m_breakpoints)
{ {
if (!bp.bTemporary) if (!bp.is_temporary)
{ {
std::stringstream ss; std::stringstream ss;
ss << std::hex << bp.iAddress << " " << (bp.bOn ? "n" : ""); ss << std::hex << bp.address << " " << (bp.is_enabled ? "n" : "");
bps.push_back(ss.str()); bp_strings.push_back(ss.str());
} }
} }
return bps; return bp_strings;
} }
void BreakPoints::AddFromStrings(const TBreakPointsStr& bpstrs) void BreakPoints::AddFromStrings(const TBreakPointsStr& bp_strings)
{ {
for (const std::string& bpstr : bpstrs) for (const std::string& bp_string : bp_strings)
{ {
TBreakPoint bp; TBreakPoint bp;
std::stringstream ss; std::stringstream ss;
ss << std::hex << bpstr; ss << std::hex << bp_string;
ss >> bp.iAddress; ss >> bp.address;
bp.bOn = bpstr.find("n") != bpstr.npos; bp.is_enabled = bp_string.find("n") != bp_string.npos;
bp.bTemporary = false; bp.is_temporary = false;
Add(bp); Add(bp);
} }
} }
void BreakPoints::Add(const TBreakPoint& bp) void BreakPoints::Add(const TBreakPoint& bp)
{ {
if (!IsAddressBreakPoint(bp.iAddress)) if (!IsAddressBreakPoint(bp.address))
{ {
m_BreakPoints.push_back(bp); m_breakpoints.push_back(bp);
if (g_jit) if (g_jit)
g_jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4, true); g_jit->GetBlockCache()->InvalidateICache(bp.address, 4, true);
} }
} }
void BreakPoints::Add(u32 em_address, bool temp) void BreakPoints::Add(u32 address, bool temp)
{ {
if (!IsAddressBreakPoint(em_address)) // only add new addresses if (!IsAddressBreakPoint(address)) // only add new addresses
{ {
TBreakPoint pt; // breakpoint settings TBreakPoint bp; // breakpoint settings
pt.bOn = true; bp.is_enabled = true;
pt.bTemporary = temp; bp.is_temporary = temp;
pt.iAddress = em_address; bp.address = address;
m_BreakPoints.push_back(pt); m_breakpoints.push_back(bp);
if (g_jit) if (g_jit)
g_jit->GetBlockCache()->InvalidateICache(em_address, 4, true); g_jit->GetBlockCache()->InvalidateICache(address, 4, true);
} }
} }
void BreakPoints::Remove(u32 em_address) void BreakPoints::Remove(u32 address)
{ {
for (auto i = m_BreakPoints.begin(); i != m_BreakPoints.end(); ++i) for (auto i = m_breakpoints.begin(); i != m_breakpoints.end(); ++i)
{ {
if (i->iAddress == em_address) if (i->address == address)
{ {
m_BreakPoints.erase(i); m_breakpoints.erase(i);
if (g_jit) if (g_jit)
g_jit->GetBlockCache()->InvalidateICache(em_address, 4, true); g_jit->GetBlockCache()->InvalidateICache(address, 4, true);
return; return;
} }
} }
@ -105,25 +105,25 @@ void BreakPoints::Clear()
{ {
if (g_jit) if (g_jit)
{ {
for (const TBreakPoint& bp : m_BreakPoints) for (const TBreakPoint& bp : m_breakpoints)
{ {
g_jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4, true); g_jit->GetBlockCache()->InvalidateICache(bp.address, 4, true);
} }
} }
m_BreakPoints.clear(); m_breakpoints.clear();
} }
void BreakPoints::ClearAllTemporary() void BreakPoints::ClearAllTemporary()
{ {
auto bp = m_BreakPoints.begin(); auto bp = m_breakpoints.begin();
while (bp != m_BreakPoints.end()) while (bp != m_breakpoints.end())
{ {
if (bp->bTemporary) if (bp->is_temporary)
{ {
if (g_jit) if (g_jit)
g_jit->GetBlockCache()->InvalidateICache(bp->iAddress, 4, true); g_jit->GetBlockCache()->InvalidateICache(bp->address, 4, true);
bp = m_BreakPoints.erase(bp); bp = m_breakpoints.erase(bp);
} }
else else
{ {
@ -134,59 +134,60 @@ void BreakPoints::ClearAllTemporary()
MemChecks::TMemChecksStr MemChecks::GetStrings() const MemChecks::TMemChecksStr MemChecks::GetStrings() const
{ {
TMemChecksStr mcs; TMemChecksStr mc_strings;
for (const TMemCheck& bp : m_MemChecks) for (const TMemCheck& mc : m_mem_checks)
{ {
std::stringstream mc; std::stringstream ss;
mc << std::hex << bp.StartAddress; ss << std::hex << mc.start_address;
mc << " " << (bp.bRange ? bp.EndAddress : bp.StartAddress) << " " << (bp.bRange ? "n" : "") ss << " " << (mc.is_ranged ? mc.end_address : mc.start_address) << " "
<< (bp.OnRead ? "r" : "") << (bp.OnWrite ? "w" : "") << (bp.Log ? "l" : "") << (mc.is_ranged ? "n" : "") << (mc.is_break_on_read ? "r" : "")
<< (bp.Break ? "p" : ""); << (mc.is_break_on_write ? "w" : "") << (mc.log_on_hit ? "l" : "")
mcs.push_back(mc.str()); << (mc.break_on_hit ? "p" : "");
mc_strings.push_back(ss.str());
} }
return mcs; return mc_strings;
} }
void MemChecks::AddFromStrings(const TMemChecksStr& mcstrs) void MemChecks::AddFromStrings(const TMemChecksStr& mc_strings)
{ {
for (const std::string& mcstr : mcstrs) for (const std::string& mc_string : mc_strings)
{ {
TMemCheck mc; TMemCheck mc;
std::stringstream ss; std::stringstream ss;
ss << std::hex << mcstr; ss << std::hex << mc_string;
ss >> mc.StartAddress; ss >> mc.start_address;
mc.bRange = mcstr.find("n") != mcstr.npos; mc.is_ranged = mc_string.find("n") != mc_string.npos;
mc.OnRead = mcstr.find("r") != mcstr.npos; mc.is_break_on_read = mc_string.find("r") != mc_string.npos;
mc.OnWrite = mcstr.find("w") != mcstr.npos; mc.is_break_on_write = mc_string.find("w") != mc_string.npos;
mc.Log = mcstr.find("l") != mcstr.npos; mc.log_on_hit = mc_string.find("l") != mc_string.npos;
mc.Break = mcstr.find("p") != mcstr.npos; mc.break_on_hit = mc_string.find("p") != mc_string.npos;
if (mc.bRange) if (mc.is_ranged)
ss >> mc.EndAddress; ss >> mc.end_address;
else else
mc.EndAddress = mc.StartAddress; mc.end_address = mc.start_address;
Add(mc); Add(mc);
} }
} }
void MemChecks::Add(const TMemCheck& _rMemoryCheck) void MemChecks::Add(const TMemCheck& memory_check)
{ {
bool had_any = HasAny(); bool had_any = HasAny();
if (GetMemCheck(_rMemoryCheck.StartAddress) == nullptr) if (GetMemCheck(memory_check.start_address) == nullptr)
m_MemChecks.push_back(_rMemoryCheck); m_mem_checks.push_back(memory_check);
// If this is the first one, clear the JIT cache so it can switch to // If this is the first one, clear the JIT cache so it can switch to
// watchpoint-compatible code. // watchpoint-compatible code.
if (!had_any && g_jit) if (!had_any && g_jit)
g_jit->GetBlockCache()->SchedulateClearCacheThreadSafe(); g_jit->GetBlockCache()->SchedulateClearCacheThreadSafe();
} }
void MemChecks::Remove(u32 _Address) void MemChecks::Remove(u32 address)
{ {
for (auto i = m_MemChecks.begin(); i != m_MemChecks.end(); ++i) for (auto i = m_mem_checks.begin(); i != m_mem_checks.end(); ++i)
{ {
if (i->StartAddress == _Address) if (i->start_address == address)
{ {
m_MemChecks.erase(i); m_mem_checks.erase(i);
if (!HasAny() && g_jit) if (!HasAny() && g_jit)
g_jit->GetBlockCache()->SchedulateClearCacheThreadSafe(); g_jit->GetBlockCache()->SchedulateClearCacheThreadSafe();
return; return;
@ -196,16 +197,16 @@ void MemChecks::Remove(u32 _Address)
TMemCheck* MemChecks::GetMemCheck(u32 address) TMemCheck* MemChecks::GetMemCheck(u32 address)
{ {
for (TMemCheck& bp : m_MemChecks) for (TMemCheck& mc : m_mem_checks)
{ {
if (bp.bRange) if (mc.is_ranged)
{ {
if (address >= bp.StartAddress && address <= bp.EndAddress) if (address >= mc.start_address && address <= mc.end_address)
return &(bp); return &mc;
} }
else if (bp.StartAddress == address) else if (mc.start_address == address)
{ {
return &(bp); return &mc;
} }
} }
@ -213,27 +214,27 @@ TMemCheck* MemChecks::GetMemCheck(u32 address)
return nullptr; return nullptr;
} }
bool TMemCheck::Action(DebugInterface* debug_interface, u32 iValue, u32 addr, bool write, int size, bool TMemCheck::Action(DebugInterface* debug_interface, u32 value, u32 addr, bool write, int size,
u32 pc) u32 pc)
{ {
if ((write && OnWrite) || (!write && OnRead)) if ((write && is_break_on_write) || (!write && is_break_on_read))
{ {
if (Log) if (log_on_hit)
{ {
NOTICE_LOG(MEMMAP, "MBP %08x (%s) %s%i %0*x at %08x (%s)", pc, NOTICE_LOG(MEMMAP, "MBP %08x (%s) %s%i %0*x at %08x (%s)", pc,
debug_interface->GetDescription(pc).c_str(), write ? "Write" : "Read", size * 8, debug_interface->GetDescription(pc).c_str(), write ? "Write" : "Read", size * 8,
size * 2, iValue, addr, debug_interface->GetDescription(addr).c_str()); size * 2, value, addr, debug_interface->GetDescription(addr).c_str());
} }
if (Break) if (break_on_hit)
return true; return true;
} }
return false; return false;
} }
bool Watches::IsAddressWatch(u32 _iAddress) const bool Watches::IsAddressWatch(u32 address) const
{ {
for (const TWatch& bp : m_Watches) for (const TWatch& watch : m_watches)
if (bp.iAddress == _iAddress) if (watch.address == address)
return true; return true;
return false; return false;
@ -241,68 +242,68 @@ bool Watches::IsAddressWatch(u32 _iAddress) const
Watches::TWatchesStr Watches::GetStrings() const Watches::TWatchesStr Watches::GetStrings() const
{ {
TWatchesStr bps; TWatchesStr watch_strings;
for (const TWatch& bp : m_Watches) for (const TWatch& watch : m_watches)
{ {
std::stringstream ss; std::stringstream ss;
ss << std::hex << bp.iAddress << " " << bp.name; ss << std::hex << watch.address << " " << watch.name;
bps.push_back(ss.str()); watch_strings.push_back(ss.str());
} }
return bps; return watch_strings;
} }
void Watches::AddFromStrings(const TWatchesStr& bpstrs) void Watches::AddFromStrings(const TWatchesStr& watch_strings)
{ {
for (const std::string& bpstr : bpstrs) for (const std::string& watch_string : watch_strings)
{ {
TWatch bp; TWatch watch;
std::stringstream ss; std::stringstream ss;
ss << std::hex << bpstr; ss << std::hex << watch_string;
ss >> bp.iAddress; ss >> watch.address;
ss >> std::ws; ss >> std::ws;
getline(ss, bp.name); std::getline(ss, watch.name);
Add(bp); Add(watch);
} }
} }
void Watches::Add(const TWatch& bp) void Watches::Add(const TWatch& watch)
{ {
if (!IsAddressWatch(bp.iAddress)) if (!IsAddressWatch(watch.address))
{ {
m_Watches.push_back(bp); m_watches.push_back(watch);
} }
} }
void Watches::Add(u32 em_address) void Watches::Add(u32 address)
{ {
if (!IsAddressWatch(em_address)) // only add new addresses if (!IsAddressWatch(address)) // only add new addresses
{ {
TWatch pt; // breakpoint settings TWatch watch; // watch settings
pt.bOn = true; watch.is_enabled = true;
pt.iAddress = em_address; watch.address = address;
m_Watches.push_back(pt); m_watches.push_back(watch);
} }
} }
void Watches::Update(int count, u32 em_address) void Watches::Update(int count, u32 address)
{ {
m_Watches.at(count).iAddress = em_address; m_watches.at(count).address = address;
} }
void Watches::UpdateName(int count, const std::string name) void Watches::UpdateName(int count, const std::string name)
{ {
m_Watches.at(count).name = name; m_watches.at(count).name = name;
} }
void Watches::Remove(u32 em_address) void Watches::Remove(u32 address)
{ {
for (auto i = m_Watches.begin(); i != m_Watches.end(); ++i) for (auto i = m_watches.begin(); i != m_watches.end(); ++i)
{ {
if (i->iAddress == em_address) if (i->address == address)
{ {
m_Watches.erase(i); m_watches.erase(i);
return; return;
} }
} }
@ -310,5 +311,5 @@ void Watches::Remove(u32 em_address)
void Watches::Clear() void Watches::Clear()
{ {
m_Watches.clear(); m_watches.clear();
} }

View File

@ -13,35 +13,35 @@ class DebugInterface;
struct TBreakPoint struct TBreakPoint
{ {
u32 iAddress = 0; u32 address = 0;
bool bOn = false; bool is_enabled = false;
bool bTemporary = false; bool is_temporary = false;
}; };
struct TMemCheck struct TMemCheck
{ {
u32 StartAddress = 0; u32 start_address = 0;
u32 EndAddress = 0; u32 end_address = 0;
bool bRange = false; bool is_ranged = false;
bool OnRead = false; bool is_break_on_read = false;
bool OnWrite = false; bool is_break_on_write = false;
bool Log = false; bool log_on_hit = false;
bool Break = false; bool break_on_hit = false;
u32 numHits = 0; u32 num_hits = 0;
// returns whether to break // returns whether to break
bool Action(DebugInterface* dbg_interface, u32 _iValue, u32 addr, bool write, int size, u32 pc); bool Action(DebugInterface* dbg_interface, u32 value, u32 addr, bool write, int size, u32 pc);
}; };
struct TWatch struct TWatch
{ {
std::string name; std::string name;
u32 iAddress = 0; u32 address = 0;
bool bOn = false; bool is_enabled = false;
}; };
// Code breakpoints. // Code breakpoints.
@ -51,25 +51,25 @@ public:
using TBreakPoints = std::vector<TBreakPoint>; using TBreakPoints = std::vector<TBreakPoint>;
using TBreakPointsStr = std::vector<std::string>; using TBreakPointsStr = std::vector<std::string>;
const TBreakPoints& GetBreakPoints() { return m_BreakPoints; } const TBreakPoints& GetBreakPoints() { return m_breakpoints; }
TBreakPointsStr GetStrings() const; TBreakPointsStr GetStrings() const;
void AddFromStrings(const TBreakPointsStr& bps); void AddFromStrings(const TBreakPointsStr& bp_strings);
// is address breakpoint // is address breakpoint
bool IsAddressBreakPoint(u32 address) const; bool IsAddressBreakPoint(u32 address) const;
bool IsTempBreakPoint(u32 address) const; bool IsTempBreakPoint(u32 address) const;
// Add BreakPoint // Add BreakPoint
void Add(u32 em_address, bool temp = false); void Add(u32 address, bool temp = false);
void Add(const TBreakPoint& bp); void Add(const TBreakPoint& bp);
// Remove Breakpoint // Remove Breakpoint
void Remove(u32 _iAddress); void Remove(u32 address);
void Clear(); void Clear();
void ClearAllTemporary(); void ClearAllTemporary();
private: private:
TBreakPoints m_BreakPoints; TBreakPoints m_breakpoints;
}; };
// Memory breakpoints // Memory breakpoints
@ -79,20 +79,20 @@ public:
using TMemChecks = std::vector<TMemCheck>; using TMemChecks = std::vector<TMemCheck>;
using TMemChecksStr = std::vector<std::string>; using TMemChecksStr = std::vector<std::string>;
const TMemChecks& GetMemChecks() { return m_MemChecks; } const TMemChecks& GetMemChecks() { return m_mem_checks; }
TMemChecksStr GetStrings() const; TMemChecksStr GetStrings() const;
void AddFromStrings(const TMemChecksStr& mcs); void AddFromStrings(const TMemChecksStr& mc_strings);
void Add(const TMemCheck& _rMemoryCheck); void Add(const TMemCheck& memory_check);
// memory breakpoint // memory breakpoint
TMemCheck* GetMemCheck(u32 address); TMemCheck* GetMemCheck(u32 address);
void Remove(u32 _Address); void Remove(u32 address);
void Clear() { m_MemChecks.clear(); } void Clear() { m_mem_checks.clear(); }
bool HasAny() const { return !m_MemChecks.empty(); } bool HasAny() const { return !m_mem_checks.empty(); }
private: private:
TMemChecks m_MemChecks; TMemChecks m_mem_checks;
}; };
class Watches class Watches
@ -101,23 +101,23 @@ public:
using TWatches = std::vector<TWatch>; using TWatches = std::vector<TWatch>;
using TWatchesStr = std::vector<std::string>; using TWatchesStr = std::vector<std::string>;
const TWatches& GetWatches() { return m_Watches; } const TWatches& GetWatches() { return m_watches; }
TWatchesStr GetStrings() const; TWatchesStr GetStrings() const;
void AddFromStrings(const TWatchesStr& bps); void AddFromStrings(const TWatchesStr& watch_strings);
bool IsAddressWatch(u32 _iAddress) const; bool IsAddressWatch(u32 address) const;
// Add BreakPoint // Add watch
void Add(u32 em_address); void Add(u32 address);
void Add(const TWatch& bp); void Add(const TWatch& watch);
void Update(int count, u32 em_address); void Update(int count, u32 address);
void UpdateName(int count, const std::string name); void UpdateName(int count, const std::string name);
// Remove Breakpoint // Remove watch
void Remove(u32 _iAddress); void Remove(u32 address);
void Clear(); void Clear();
private: private:
TWatches m_Watches; TWatches m_watches;
}; };

View File

@ -424,7 +424,7 @@ static void Memcheck(u32 address, u32 var, bool write, int size)
// Disable when stepping so that resume works. // Disable when stepping so that resume works.
return; return;
} }
mc->numHits++; mc->num_hits++;
bool pause = mc->Action(&PowerPC::debug_interface, var, address, write, size, PC); bool pause = mc->Action(&PowerPC::debug_interface, var, address, write, size, PC);
if (pause) if (pause)
{ {

View File

@ -39,53 +39,54 @@ void CBreakPointView::Repopulate()
const BreakPoints::TBreakPoints& rBreakPoints = PowerPC::breakpoints.GetBreakPoints(); const BreakPoints::TBreakPoints& rBreakPoints = PowerPC::breakpoints.GetBreakPoints();
for (const auto& rBP : rBreakPoints) for (const auto& rBP : rBreakPoints)
{ {
if (!rBP.bTemporary) if (!rBP.is_temporary)
{ {
wxString breakpoint_enabled_str = StrToWxStr(rBP.bOn ? "on" : " "); wxString breakpoint_enabled_str = StrToWxStr(rBP.is_enabled ? "on" : " ");
int item = InsertItem(0, breakpoint_enabled_str); int item = InsertItem(0, breakpoint_enabled_str);
SetItem(item, 1, StrToWxStr("BP")); SetItem(item, 1, StrToWxStr("BP"));
Symbol* symbol = g_symbolDB.GetSymbolFromAddr(rBP.iAddress); Symbol* symbol = g_symbolDB.GetSymbolFromAddr(rBP.address);
if (symbol) if (symbol)
{ {
wxString symbol_description = StrToWxStr(g_symbolDB.GetDescription(rBP.iAddress)); wxString symbol_description = StrToWxStr(g_symbolDB.GetDescription(rBP.address));
SetItem(item, 2, symbol_description); SetItem(item, 2, symbol_description);
} }
std::string address = StringFromFormat("%08x", rBP.iAddress); std::string address = StringFromFormat("%08x", rBP.address);
SetItem(item, 3, StrToWxStr(address)); SetItem(item, 3, StrToWxStr(address));
SetItemData(item, rBP.iAddress); SetItemData(item, rBP.address);
} }
} }
const MemChecks::TMemChecks& rMemChecks = PowerPC::memchecks.GetMemChecks(); const MemChecks::TMemChecks& rMemChecks = PowerPC::memchecks.GetMemChecks();
for (const auto& rMemCheck : rMemChecks) for (const auto& rMemCheck : rMemChecks)
{ {
wxString memcheck_on_str = StrToWxStr((rMemCheck.Break || rMemCheck.Log) ? "on" : " "); const wxString memcheck_on_str =
StrToWxStr((rMemCheck.break_on_hit || rMemCheck.log_on_hit) ? "on" : " ");
int item = InsertItem(0, memcheck_on_str); int item = InsertItem(0, memcheck_on_str);
SetItem(item, 1, StrToWxStr("MBP")); SetItem(item, 1, StrToWxStr("MBP"));
Symbol* symbol = g_symbolDB.GetSymbolFromAddr(rMemCheck.StartAddress); Symbol* symbol = g_symbolDB.GetSymbolFromAddr(rMemCheck.start_address);
if (symbol) if (symbol)
{ {
wxString memcheck_start_addr = StrToWxStr(g_symbolDB.GetDescription(rMemCheck.StartAddress)); wxString memcheck_start_addr = StrToWxStr(g_symbolDB.GetDescription(rMemCheck.start_address));
SetItem(item, 2, memcheck_start_addr); SetItem(item, 2, memcheck_start_addr);
} }
std::string address_range_str = std::string address_range_str =
StringFromFormat("%08x to %08x", rMemCheck.StartAddress, rMemCheck.EndAddress); StringFromFormat("%08x to %08x", rMemCheck.start_address, rMemCheck.end_address);
SetItem(item, 3, StrToWxStr(address_range_str)); SetItem(item, 3, StrToWxStr(address_range_str));
std::string mode; std::string mode;
if (rMemCheck.OnRead) if (rMemCheck.is_break_on_read)
mode += 'r'; mode += 'r';
if (rMemCheck.OnWrite) if (rMemCheck.is_break_on_write)
mode += 'w'; mode += 'w';
SetItem(item, 4, StrToWxStr(mode)); SetItem(item, 4, StrToWxStr(mode));
SetItemData(item, rMemCheck.StartAddress); SetItemData(item, rMemCheck.start_address);
} }
Refresh(); Refresh();

View File

@ -157,13 +157,13 @@ void MemoryCheckDlg::OnOK(wxCommandEvent& event)
if (!EndAddressOK) if (!EndAddressOK)
EndAddress = StartAddress; EndAddress = StartAddress;
MemCheck.StartAddress = StartAddress; MemCheck.start_address = StartAddress;
MemCheck.EndAddress = EndAddress; MemCheck.end_address = EndAddress;
MemCheck.bRange = StartAddress != EndAddress; MemCheck.is_ranged = StartAddress != EndAddress;
MemCheck.OnRead = OnRead; MemCheck.is_break_on_read = OnRead;
MemCheck.OnWrite = OnWrite; MemCheck.is_break_on_write = OnWrite;
MemCheck.Log = Log; MemCheck.log_on_hit = Log;
MemCheck.Break = Break; MemCheck.break_on_hit = Break;
PowerPC::memchecks.Add(MemCheck); PowerPC::memchecks.Add(MemCheck);
EndModal(wxID_OK); EndModal(wxID_OK);

View File

@ -35,7 +35,7 @@ static std::string GetWatchName(int count)
static u32 GetWatchAddr(int count) static u32 GetWatchAddr(int count)
{ {
return PowerPC::watches.GetWatches().at(count - 1).iAddress; return PowerPC::watches.GetWatches().at(count - 1).address;
} }
static u32 GetWatchValue(int count) static u32 GetWatchValue(int count)
@ -282,13 +282,11 @@ void CWatchView::OnPopupMenu(wxCommandEvent& event)
CMemoryWindow* memory_window = code_window->GetPanel<CMemoryWindow>(); CMemoryWindow* memory_window = code_window->GetPanel<CMemoryWindow>();
CBreakPointWindow* breakpoint_window = code_window->GetPanel<CBreakPointWindow>(); CBreakPointWindow* breakpoint_window = code_window->GetPanel<CBreakPointWindow>();
wxString strNewVal;
TMemCheck MemCheck;
switch (event.GetId()) switch (event.GetId())
{ {
case IDM_DELETEWATCH: case IDM_DELETEWATCH:
strNewVal = GetValueByRowCol(m_selectedRow, 1); {
wxString strNewVal = GetValueByRowCol(m_selectedRow, 1);
if (TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress)) if (TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress))
{ {
PowerPC::watches.Remove(m_selectedAddress); PowerPC::watches.Remove(m_selectedAddress);
@ -297,20 +295,24 @@ void CWatchView::OnPopupMenu(wxCommandEvent& event)
Refresh(); Refresh();
} }
break; break;
}
case IDM_ADDMEMCHECK: case IDM_ADDMEMCHECK:
MemCheck.StartAddress = m_selectedAddress; {
MemCheck.EndAddress = m_selectedAddress; TMemCheck MemCheck;
MemCheck.bRange = false; MemCheck.start_address = m_selectedAddress;
MemCheck.OnRead = true; MemCheck.end_address = m_selectedAddress;
MemCheck.OnWrite = true; MemCheck.is_ranged = false;
MemCheck.Log = true; MemCheck.is_break_on_read = true;
MemCheck.Break = true; MemCheck.is_break_on_write = true;
MemCheck.log_on_hit = true;
MemCheck.break_on_hit = true;
PowerPC::memchecks.Add(MemCheck); PowerPC::memchecks.Add(MemCheck);
if (breakpoint_window) if (breakpoint_window)
breakpoint_window->NotifyUpdate(); breakpoint_window->NotifyUpdate();
Refresh(); Refresh();
break; break;
}
case IDM_VIEWMEMORY: case IDM_VIEWMEMORY:
if (memory_window) if (memory_window)
memory_window->JumpToAddress(m_selectedAddress); memory_window->JumpToAddress(m_selectedAddress);