Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252051
b: refs/heads/master
c: 63ab25e
h: refs/heads/master
i:
  252049: fe29872
  252047: 004e0b4
v: v3
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed May 27, 2011
1 parent a73a7af commit 0172e5c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3cea45c6ef459b776123a4855eba6dafd506f3ce
refs/heads/master: 63ab25ebbc50f74550bd8d164a34724b498f6fb9
1 change: 1 addition & 0 deletions trunk/arch/blackfin/include/asm/kgdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static inline void arch_kgdb_breakpoint(void)
#else
# define CACHE_FLUSH_IS_SAFE 1
#endif
#define GDB_ADJUSTS_BREAK_OFFSET
#define HW_INST_WATCHPOINT_NUM 6
#define HW_WATCHPOINT_NUM 8
#define TYPE_INST_WATCHPOINT 0
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/sh/include/asm/kgdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ static inline void arch_kgdb_breakpoint(void)

#define CACHE_FLUSH_IS_SAFE 1
#define BREAK_INSTR_SIZE 2
#define GDB_ADJUSTS_BREAK_OFFSET

#endif /* __ASM_SH_KGDB_H */
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/kgdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static inline void arch_kgdb_breakpoint(void)
}
#define BREAK_INSTR_SIZE 1
#define CACHE_FLUSH_IS_SAFE 1
#define GDB_ADJUSTS_BREAK_OFFSET

extern int kgdb_ll_trap(int cmd, const char *str,
struct pt_regs *regs, long err, int trap, int sig);
Expand Down
29 changes: 11 additions & 18 deletions trunk/drivers/misc/kgdbts.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,33 +285,26 @@ static void hw_break_val_write(void)
static int check_and_rewind_pc(char *put_str, char *arg)
{
unsigned long addr = lookup_addr(arg);
unsigned long ip;
int offset = 0;

kgdb_hex2mem(&put_str[1], (char *)kgdbts_gdb_regs,
NUMREGBYTES);
gdb_regs_to_pt_regs(kgdbts_gdb_regs, &kgdbts_regs);
v2printk("Stopped at IP: %lx\n", instruction_pointer(&kgdbts_regs));
#ifdef CONFIG_X86
/* On x86 a breakpoint stop requires it to be decremented */
if (addr + 1 == kgdbts_regs.ip)
offset = -1;
#elif defined(CONFIG_SUPERH)
/* On SUPERH a breakpoint stop requires it to be decremented */
if (addr + 2 == kgdbts_regs.pc)
offset = -2;
ip = instruction_pointer(&kgdbts_regs);
v2printk("Stopped at IP: %lx\n", ip);
#ifdef GDB_ADJUSTS_BREAK_OFFSET
/* On some arches, a breakpoint stop requires it to be decremented */
if (addr + BREAK_INSTR_SIZE == ip)
offset = -BREAK_INSTR_SIZE;
#endif
if (strcmp(arg, "silent") &&
instruction_pointer(&kgdbts_regs) + offset != addr) {
if (strcmp(arg, "silent") && ip + offset != addr) {
eprintk("kgdbts: BP mismatch %lx expected %lx\n",
instruction_pointer(&kgdbts_regs) + offset, addr);
ip + offset, addr);
return 1;
}
#ifdef CONFIG_X86
/* On x86 adjust the instruction pointer if needed */
kgdbts_regs.ip += offset;
#elif defined(CONFIG_SUPERH)
kgdbts_regs.pc += offset;
#endif
/* Readjust the instruction pointer if needed */
instruction_pointer_set(&kgdbts_regs, ip + offset);
return 0;
}

Expand Down

0 comments on commit 0172e5c

Please sign in to comment.