Rev 2923 | Rev 2935 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2923 | Rev 2924 | ||
---|---|---|---|
Line 85... | Line 85... | ||
85 | int bi; |
85 | int bi; |
86 | for (bi = 0; bi < MAX_BRKPTS; bi++) { |
86 | for (bi = 0; bi < MAX_BRKPTS; bi++) { |
87 | if (brk_list[bi].set && brk_list[bi].addr == brk_addr) |
87 | if (brk_list[bi].set && brk_list[bi].addr == brk_addr) |
88 | break; |
88 | break; |
89 | } |
89 | } |
- | 90 | ||
90 | if (bi < MAX_BRKPTS) { |
91 | if (bi < MAX_BRKPTS) { |
- | 92 | printf("breakpoint %d hit\n", bi); |
|
- | 93 | ||
91 | buffer[ISTATE_OFF_EIP] = brk_addr; |
94 | buffer[ISTATE_OFF_EIP] = brk_addr; |
92 | buffer[ISTATE_OFF_EFLAGS] |= 0x0100; /* trap flag */ |
95 | buffer[ISTATE_OFF_EFLAGS] |= 0x0100; /* trap flag */ |
93 | printf("setting EIP to 0x%08x\n", buffer[ISTATE_OFF_EIP]); |
96 | printf("setting EIP to 0x%08x\n", buffer[ISTATE_OFF_EIP]); |
94 | rc = udebug_regs_write(app_phone, thread_hash, buffer); |
97 | rc = udebug_regs_write(app_phone, thread_hash, buffer); |
95 | rc = udebug_mem_write(app_phone, &brk_list[bi].arch.back, brk_addr, 1); |
98 | rc = udebug_mem_write(app_phone, &brk_list[bi].arch.back, brk_addr, 1); |
Line 103... | Line 106... | ||
103 | void arch_event_trap(thash_t thread_hash) |
106 | void arch_event_trap(thash_t thread_hash) |
104 | { |
107 | { |
105 | unsigned char brkinstr[1]; |
108 | unsigned char brkinstr[1]; |
106 | int rc; |
109 | int rc; |
107 | 110 | ||
- | 111 | printf("trap event\n"); |
|
- | 112 | ||
108 | breakpoint_t *lb = lifted_brkpt; |
113 | breakpoint_t *lb = lifted_brkpt; |
109 | brkinstr[0] = OPCODE_INT3; |
114 | brkinstr[0] = OPCODE_INT3; |
110 | rc = udebug_mem_write(app_phone, brkinstr, lb->addr, 1); |
115 | rc = udebug_mem_write(app_phone, brkinstr, lb->addr, 1); |
111 | printf("restore breakpoint -> %d\n", rc); |
116 | printf("restore breakpoint -> %d\n", rc); |
112 | 117 |