Mercurial > repos > blastem
comparison gdb_remote.c @ 1111:2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 19 Dec 2016 13:28:18 -0800 |
parents | 22e87b739ad6 |
children | 73e36dac5be7 |
comparison
equal
deleted
inserted
replaced
1110:d1eed3b1121c | 1111:2eb54e24914e |
---|---|
214 after = (read_dma_value((context->aregs[7]+2)/2) << 16) | read_dma_value((context->aregs[7]+2)/2 + 1); | 214 after = (read_dma_value((context->aregs[7]+2)/2) << 16) | read_dma_value((context->aregs[7]+2)/2 + 1); |
215 } else if(m68k_is_branch(&inst)) { | 215 } else if(m68k_is_branch(&inst)) { |
216 if (inst.op == M68K_BCC && inst.extra.cond != COND_TRUE) { | 216 if (inst.op == M68K_BCC && inst.extra.cond != COND_TRUE) { |
217 branch_f = after; | 217 branch_f = after; |
218 branch_t = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; | 218 branch_t = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; |
219 insert_breakpoint(context, branch_t, (uint8_t *)gdb_debug_enter); | 219 insert_breakpoint(context, branch_t, gdb_debug_enter); |
220 } else if(inst.op == M68K_DBCC && inst.extra.cond != COND_FALSE) { | 220 } else if(inst.op == M68K_DBCC && inst.extra.cond != COND_FALSE) { |
221 branch_t = after; | 221 branch_t = after; |
222 branch_f = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; | 222 branch_f = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; |
223 insert_breakpoint(context, branch_f, (uint8_t *)gdb_debug_enter); | 223 insert_breakpoint(context, branch_f, gdb_debug_enter); |
224 } else { | 224 } else { |
225 after = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; | 225 after = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; |
226 } | 226 } |
227 } | 227 } |
228 insert_breakpoint(context, after, (uint8_t *)gdb_debug_enter); | 228 insert_breakpoint(context, after, gdb_debug_enter); |
229 | 229 |
230 cont = 1; | 230 cont = 1; |
231 expect_break_response = 1; | 231 expect_break_response = 1; |
232 break; | 232 break; |
233 } | 233 } |
241 break; | 241 break; |
242 case 'Z': { | 242 case 'Z': { |
243 uint8_t type = command[1]; | 243 uint8_t type = command[1]; |
244 if (type < '2') { | 244 if (type < '2') { |
245 uint32_t address = strtoul(command+3, NULL, 16); | 245 uint32_t address = strtoul(command+3, NULL, 16); |
246 insert_breakpoint(context, address, (uint8_t *)gdb_debug_enter); | 246 insert_breakpoint(context, address, gdb_debug_enter); |
247 bp_def *new_bp = malloc(sizeof(bp_def)); | 247 bp_def *new_bp = malloc(sizeof(bp_def)); |
248 new_bp->next = breakpoints; | 248 new_bp->next = breakpoints; |
249 new_bp->address = address; | 249 new_bp->address = address; |
250 new_bp->index = bp_index++; | 250 new_bp->index = bp_index++; |
251 breakpoints = new_bp; | 251 breakpoints = new_bp; |
431 after = (read_dma_value((context->aregs[7]+2)/2) << 16) | read_dma_value((context->aregs[7]+2)/2 + 1); | 431 after = (read_dma_value((context->aregs[7]+2)/2) << 16) | read_dma_value((context->aregs[7]+2)/2 + 1); |
432 } else if(m68k_is_branch(&inst)) { | 432 } else if(m68k_is_branch(&inst)) { |
433 if (inst.op == M68K_BCC && inst.extra.cond != COND_TRUE) { | 433 if (inst.op == M68K_BCC && inst.extra.cond != COND_TRUE) { |
434 branch_f = after; | 434 branch_f = after; |
435 branch_t = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; | 435 branch_t = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; |
436 insert_breakpoint(context, branch_t, (uint8_t *)gdb_debug_enter); | 436 insert_breakpoint(context, branch_t, gdb_debug_enter); |
437 } else if(inst.op == M68K_DBCC && inst.extra.cond != COND_FALSE) { | 437 } else if(inst.op == M68K_DBCC && inst.extra.cond != COND_FALSE) { |
438 branch_t = after; | 438 branch_t = after; |
439 branch_f = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; | 439 branch_f = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; |
440 insert_breakpoint(context, branch_f, (uint8_t *)gdb_debug_enter); | 440 insert_breakpoint(context, branch_f, gdb_debug_enter); |
441 } else { | 441 } else { |
442 after = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; | 442 after = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; |
443 } | 443 } |
444 } | 444 } |
445 insert_breakpoint(context, after, (uint8_t *)gdb_debug_enter); | 445 insert_breakpoint(context, after, gdb_debug_enter); |
446 | 446 |
447 cont = 1; | 447 cont = 1; |
448 expect_break_response = 1; | 448 expect_break_response = 1; |
449 break; | 449 break; |
450 } | 450 } |