summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/debuggdbstub.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/debugger/debuggdbstub.cpp')
-rw-r--r--src/osd/modules/debugger/debuggdbstub.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/osd/modules/debugger/debuggdbstub.cpp b/src/osd/modules/debugger/debuggdbstub.cpp
index cd21a4c5b1b..eaeb1df4cca 100644
--- a/src/osd/modules/debugger/debuggdbstub.cpp
+++ b/src/osd/modules/debugger/debuggdbstub.cpp
@@ -643,16 +643,8 @@ void debug_gdbstub::wait_for_debugger(device_t &device, bool firststop)
if ( firststop && !m_initialized )
{
- // find the "main" CPU, which is the first CPU (gdbstub doesn't seem to have any notion of switching CPUs)
- for (device_t &device : device_enumerator(m_machine->root_device()))
- {
- auto *cpu = dynamic_cast<cpu_device *>(&device);
- if (cpu)
- {
- m_maincpu = cpu;
- break;
- }
- }
+ // find the "main" CPU, which is the first CPU (gdbstub doesn't have any notion of switching CPUs)
+ m_maincpu = device_type_enumerator<cpu_device>(m_machine->root_device()).first();
if (!m_maincpu)
fatalerror("gdbstub: cannot find any CPUs\n");