trunk/src/osd/modules/debugger/qt/dasmwindow.c
| r243614 | r243615 | |
| 128 | 128 | { |
| 129 | 129 | if (m_dasmView->view()->cursor_visible()) |
| 130 | 130 | { |
| 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()) |
| 132 | 140 | { |
| 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()) |
| 141 | 142 | { |
| 142 | | if (address == bp->address()) |
| 143 | | { |
| 144 | | bpindex = bp->index(); |
| 145 | | break; |
| 146 | | } |
| 143 | bpindex = bp->index(); |
| 144 | break; |
| 147 | 145 | } |
| 146 | } |
| 148 | 147 | |
| 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 | { |
| 150 | 151 | astring command; |
| 151 | 152 | if (bpindex == -1) |
| 152 | 153 | { |
| r243614 | r243615 | |
| 158 | 159 | } |
| 159 | 160 | debug_console_execute_command(*m_machine, command, 1); |
| 160 | 161 | } |
| 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 | } |
| 161 | 177 | } |
| 162 | 178 | |
| 163 | 179 | refreshAll(); |
| r243614 | r243615 | |
| 168 | 184 | { |
| 169 | 185 | if (m_dasmView->view()->cursor_visible()) |
| 170 | 186 | { |
| 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) |
| 172 | 191 | { |
| 173 | | offs_t address = downcast<debug_view_disasm*>(m_dasmView->view())->selected_address(); |
| 174 | 192 | astring command; |
| 175 | 193 | command.printf("go 0x%X", address); |
| 176 | 194 | debug_console_execute_command(*m_machine, command, 1); |
| 177 | 195 | } |
| 196 | else |
| 197 | { |
| 198 | device->debug()->go(address); |
| 199 | } |
| 178 | 200 | } |
| 179 | 201 | } |
| 180 | 202 | |