summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2015-02-17 18:09:50 +1100
committer Vas Crabb <vas@vastheman.com>2015-02-17 18:09:50 +1100
commit33965546d71815b675ee917a2b62c2076e340ee0 (patch)
tree2b5ee7644f225af46c25d2db3d17b8e54c6ed0d9 /src/osd/modules/debugger
parent145ad17fa232f22c188c76d11fd4df75260868b7 (diff)
Try not to crash on hard reset
Diffstat (limited to 'src/osd/modules/debugger')
-rw-r--r--src/osd/modules/debugger/debugosx.m43
1 files changed, 33 insertions, 10 deletions
diff --git a/src/osd/modules/debugger/debugosx.m b/src/osd/modules/debugger/debugosx.m
index 3b9c971483b..491aefbedda 100644
--- a/src/osd/modules/debugger/debugosx.m
+++ b/src/osd/modules/debugger/debugosx.m
@@ -54,14 +54,8 @@ public:
[m_console release];
}
- virtual int init()
- {
- return 0;
- }
-
- virtual void exit()
- {
- }
+ virtual int init();
+ virtual void exit();
virtual void init_debugger(running_machine &machine);
virtual void wait_for_debugger(device_t &device, bool firststop);
@@ -75,12 +69,40 @@ private:
MODULE_DEFINITION(DEBUG_OSX, debugger_osx)
//============================================================
+// debugger_osx::init
+//============================================================
+
+int debugger_osx::init()
+{
+ return 0;
+}
+
+//============================================================
+// debugger_osx::exit
+//============================================================
+
+void debugger_osx::exit()
+{
+ if (m_console)
+ {
+ NSDictionary *info = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:m_machine]
+ forKey:@"MAMEDebugMachine"];
+ [[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification
+ object:m_console
+ userInfo:info];
+ [m_console release];
+ m_console = nil;
+ m_machine = NULL;
+ }
+}
+
+//============================================================
// debugger_osx::init_debugger
//============================================================
void debugger_osx::init_debugger(running_machine &machine)
{
- m_machine = &machine;
+ m_machine = &machine;
}
//============================================================
@@ -94,7 +116,8 @@ void debugger_osx::wait_for_debugger(device_t &device, bool firststop)
m_console = [[MAMEDebugConsole alloc] initWithMachine:*m_machine];
// make sure the debug windows are visible
- if (firststop) {
+ if (firststop)
+ {
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithPointer:&device],
@"MAMEDebugDevice",
[NSValue valueWithPointer:m_machine],