summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-07-21 13:03:44 +1000
committer Vas Crabb <vas@vastheman.com>2017-07-21 13:03:44 +1000
commitd7984c7d0ce594ecb34275fdabb817bdbe261647 (patch)
treeb8a771b129db3ca6105111e202b0d1deab813999 /src/osd/modules/debugger
parent05e84dccc04849857ebc4460084bdafc872d5815 (diff)
Add a method for copying part of an XML tree into another tree and use it to fix Cocoa debugger fatal error
Diffstat (limited to 'src/osd/modules/debugger')
-rw-r--r--src/osd/modules/debugger/debugosx.mm26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/osd/modules/debugger/debugosx.mm b/src/osd/modules/debugger/debugosx.mm
index 0c0cbb60337..adb32fea199 100644
--- a/src/osd/modules/debugger/debugosx.mm
+++ b/src/osd/modules/debugger/debugosx.mm
@@ -30,6 +30,8 @@
#import "osx/debugconsole.h"
#import "osx/debugwindowhandler.h"
+#include "util/xmlfile.h"
+
#include <atomic>
@@ -44,7 +46,8 @@ public:
osd_module(OSD_DEBUG_PROVIDER, "osx"),
debug_module(),
m_machine(nullptr),
- m_console(nil)
+ m_console(nil),
+ m_config()
{
}
@@ -69,6 +72,7 @@ private:
running_machine *m_machine;
MAMEDebugConsole *m_console;
+ util::xml::file::ptr m_config;
static std::atomic_bool s_added_menus;
};
@@ -141,6 +145,11 @@ void debugger_osx::wait_for_debugger(device_t &device, bool firststop)
// make sure the debug windows are visible
if (firststop)
{
+ if (m_config)
+ {
+ [m_console loadConfiguration:m_config->get_first_child()];
+ m_config.reset();
+ }
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithPointer:&device],
@"MAMEDebugDevice",
[NSValue valueWithPointer:m_machine],
@@ -296,10 +305,17 @@ void debugger_osx::config_load(config_type cfgtype, util::xml::data_node const *
{
if ((config_type::GAME == cfgtype) && parentnode)
{
- NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
- create_console();
- [m_console loadConfiguration:parentnode];
- [pool release];
+ if (m_console)
+ {
+ NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
+ [m_console loadConfiguration:parentnode];
+ [pool release];
+ }
+ else
+ {
+ m_config = util::xml::file::create();
+ parentnode->copy_into(*m_config);
+ }
}
}