Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two possible crashes related to the debugger. #655

Merged
merged 2 commits into from Jul 23, 2014

Conversation

lioncash
Copy link
Member

  • CPU_POWERDOWN should be the default initial state of the CPU upon starting the emulator, not CPU_STEPPING, since it implies the CPU is running but is (obviously) stepping. This also prevents crashes in regards to using stepping debugging tools, since the main condition these debugging features check against is CCPU::IsStepping(), which will return true, even without the emulator running, since it is the default state.
  • When setting memory values with SetMemoryValue, there were no sanitizing checks for a valid state, it would just directly call Memory::Write_U32. Now it checks if memory has been properly initialized first.

This isn't a correct state for the CPU to begin in when starting the application.

Also CPU_STEPPING as an initial state causes the emulator to crash if you use any of the debugger stepping buttons, since it checks if the CPU is in the CPU_STEPPING state before performing their functions.
@@ -160,6 +160,12 @@ void CMemoryWindow::JumpToAddress(u32 _Address)

void CMemoryWindow::SetMemoryValue(wxCommandEvent& event)
{
if (!Memory::IsInitialized())
{
PanicAlertT("Cannot set uninitialized memory.");

This comment was marked as off-topic.

This comment was marked as off-topic.

@Sonicadvance1
Copy link
Contributor

LGTM

1 similar comment
@Parlane
Copy link
Member

Parlane commented Jul 23, 2014

LGTM

Parlane added a commit that referenced this pull request Jul 23, 2014
Fix two possible crashes related to the debugger.
@Parlane Parlane merged commit 008b907 into dolphin-emu:master Jul 23, 2014
@lioncash lioncash deleted the crashes branch July 23, 2014 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants