Previous 199869 Revisions Next

r35103 Tuesday 17th February, 2015 at 10:52:48 UTC by Vasantha Crabb
Allow breakpoint toggle and run-to-cursor on non-current CPUs in Qt debugger
[src/osd/modules/debugger/qt]dasmwindow.c

trunk/src/osd/modules/debugger/qt/dasmwindow.c
r243614r243615
128128{
129129   if (m_dasmView->view()->cursor_visible())
130130   {
131      if (debug_cpu_get_visible_cpu(*m_machine) == m_dasmView->view()->source()->device())
131      offs_t address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address();
132      device_t *device = m_dasmView->view()->source()->device();
133      device_debug *cpuinfo = device->debug();
134
135      // Find an existing breakpoint at this address
136      INT32 bpindex = -1;
137      for (device_debug::breakpoint* bp = cpuinfo->breakpoint_first();
138            bp != NULL;
139            bp = bp->next())
132140      {
133         offs_t address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address();
134         device_debug *cpuinfo = m_dasmView->view()->source()->device()->debug();
135
136         // Find an existing breakpoint at this address
137         INT32 bpindex = -1;
138         for (device_debug::breakpoint* bp = cpuinfo->breakpoint_first();
139               bp != NULL;
140               bp = bp->next())
141         if (address == bp->address())
141142         {
142            if (address == bp->address())
143            {
144               bpindex = bp->index();
145               break;
146            }
143            bpindex = bp->index();
144            break;
147145         }
146      }
148147
149         // If none exists, add a new one
148      // If none exists, add a new one
149      if (debug_cpu_get_visible_cpu(*m_machine) == device)
150      {
150151         astring command;
151152         if (bpindex == -1)
152153         {
r243614r243615
158159         }
159160         debug_console_execute_command(*m_machine, command, 1);
160161      }
162      else
163      {
164         if (bpindex == -1)
165         {
166            bpindex = cpuinfo->breakpoint_set(address, NULL, NULL);
167            debug_console_printf(*m_machine, "Breakpoint %X set\n", bpindex);
168         }
169         else
170         {
171            cpuinfo->breakpoint_clear(bpindex);
172            debug_console_printf(*m_machine, "Breakpoint %X cleared\n", bpindex);
173         }
174         m_machine->debug_view().update_all();
175         debugger_refresh_display(*m_machine);
176      }
161177   }
162178
163179   refreshAll();
r243614r243615
168184{
169185   if (m_dasmView->view()->cursor_visible())
170186   {
171      if (debug_cpu_get_visible_cpu(*m_machine) == m_dasmView->view()->source()->device())
187      offs_t address = downcast<debug_view_disasm*>(m_dasmView->view())->selected_address();
188      device_t *device = m_dasmView->view()->source()->device();
189
190      if (debug_cpu_get_visible_cpu(*m_machine) == device)
172191      {
173         offs_t address = downcast<debug_view_disasm*>(m_dasmView->view())->selected_address();
174192         astring command;
175193         command.printf("go 0x%X", address);
176194         debug_console_execute_command(*m_machine, command, 1);
177195      }
196      else
197      {
198         device->debug()->go(address);
199      }
178200   }
179201}
180202


Previous 199869 Revisions Next


© 1997-2024 The MAME Team