mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
Merge pull request #248 from ItzWarty/master
virtual memory block reads/writes properly fail if address is out of bounds
This commit is contained in:
commit
e569de73d6
5 changed files with 73 additions and 44 deletions
|
|
@ -322,20 +322,28 @@ void RSXDebugger::GoToGet(wxCommandEvent& event)
|
|||
{
|
||||
if (!RSXReady()) return;
|
||||
CellGcmControl* ctrl = (CellGcmControl*)&Memory[Emu.GetGSManager().GetRender().m_ctrlAddress];
|
||||
m_addr = Memory.RSXIOMem.getRealAddr(Memory.RSXIOMem.GetStartAddr() + ctrl->get);
|
||||
t_addr->SetValue(wxString::Format("%08x", m_addr));
|
||||
UpdateInformation();
|
||||
event.Skip();
|
||||
u64 realAddr;
|
||||
if (Memory.RSXIOMem.getRealAddr(Memory.RSXIOMem.GetStartAddr() + ctrl->get, realAddr)) {
|
||||
m_addr = realAddr; // WARNING: Potential Truncation? Cast from u64 to u32
|
||||
t_addr->SetValue(wxString::Format("%08x", m_addr));
|
||||
UpdateInformation();
|
||||
event.Skip();
|
||||
}
|
||||
// TODO: We should probably throw something?
|
||||
}
|
||||
|
||||
void RSXDebugger::GoToPut(wxCommandEvent& event)
|
||||
{
|
||||
if (!RSXReady()) return;
|
||||
CellGcmControl* ctrl = (CellGcmControl*)&Memory[Emu.GetGSManager().GetRender().m_ctrlAddress];
|
||||
m_addr = Memory.RSXIOMem.getRealAddr(Memory.RSXIOMem.GetStartAddr() + ctrl->put);
|
||||
t_addr->SetValue(wxString::Format("%08x", m_addr));
|
||||
UpdateInformation();
|
||||
event.Skip();
|
||||
u64 realAddr;
|
||||
if (Memory.RSXIOMem.getRealAddr(Memory.RSXIOMem.GetStartAddr() + ctrl->put, realAddr)) {
|
||||
m_addr = realAddr; // WARNING: Potential Truncation? Cast from u64 to u32
|
||||
t_addr->SetValue(wxString::Format("%08x", m_addr));
|
||||
UpdateInformation();
|
||||
event.Skip();
|
||||
}
|
||||
// TODO: We should probably throw something?
|
||||
}
|
||||
|
||||
void RSXDebugger::UpdateInformation()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue