285
285
static int check_and_rewind_pc(char *put_str, char *arg)
287
287
unsigned long addr = lookup_addr(arg);
290
291
kgdb_hex2mem(&put_str[1], (char *)kgdbts_gdb_regs,
292
293
gdb_regs_to_pt_regs(kgdbts_gdb_regs, &kgdbts_regs);
293
v2printk("Stopped at IP: %lx\n", instruction_pointer(&kgdbts_regs));
295
/* On x86 a breakpoint stop requires it to be decremented */
296
if (addr + 1 == kgdbts_regs.ip)
298
#elif defined(CONFIG_SUPERH)
299
/* On SUPERH a breakpoint stop requires it to be decremented */
300
if (addr + 2 == kgdbts_regs.pc)
294
ip = instruction_pointer(&kgdbts_regs);
295
v2printk("Stopped at IP: %lx\n", ip);
296
#ifdef GDB_ADJUSTS_BREAK_OFFSET
297
/* On some arches, a breakpoint stop requires it to be decremented */
298
if (addr + BREAK_INSTR_SIZE == ip)
299
offset = -BREAK_INSTR_SIZE;
303
if (strcmp(arg, "silent") &&
304
instruction_pointer(&kgdbts_regs) + offset != addr) {
301
if (strcmp(arg, "silent") && ip + offset != addr) {
305
302
eprintk("kgdbts: BP mismatch %lx expected %lx\n",
306
instruction_pointer(&kgdbts_regs) + offset, addr);
310
/* On x86 adjust the instruction pointer if needed */
311
kgdbts_regs.ip += offset;
312
#elif defined(CONFIG_SUPERH)
313
kgdbts_regs.pc += offset;
306
/* Readjust the instruction pointer if needed */
308
#ifdef GDB_ADJUSTS_BREAK_OFFSET
309
instruction_pointer_set(&kgdbts_regs, ip);
646
642
while (*chk_str != '\0' && *put_str != '\0') {
647
643
/* If someone does a * to match the rest of the string, allow
648
* it, or stop if the recieved string is complete.
644
* it, or stop if the received string is complete.
650
646
if (*put_str == '#' || *chk_str == '*')