Rev 1072 | Rev 1077 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1072 | Rev 1074 | ||
|---|---|---|---|
| Line 189... | Line 189... | ||
| 189 | interrupts_restore(ipl); |
189 | interrupts_restore(ipl); |
| 190 | 190 | ||
| 191 | return curidx; |
191 | return curidx; |
| 192 | } |
192 | } |
| 193 | 193 | ||
| - | 194 | #ifdef amd64 |
|
| - | 195 | # define getip(x) ((x)->rip) |
|
| - | 196 | #else |
|
| - | 197 | # define getip(x) ((x)->eip) |
|
| - | 198 | #endif |
|
| - | 199 | ||
| 194 | static void handle_exception(int slot, istate_t *istate) |
200 | static void handle_exception(int slot, istate_t *istate) |
| 195 | { |
201 | { |
| 196 | ASSERT(breakpoints[slot].address); |
202 | ASSERT(breakpoints[slot].address); |
| 197 | 203 | ||
| 198 | /* Handle zero checker */ |
204 | /* Handle zero checker */ |
| Line 205... | Line 211... | ||
| 205 | } else { |
211 | } else { |
| 206 | printf("Data watchpoint - new data: %P\n", |
212 | printf("Data watchpoint - new data: %P\n", |
| 207 | *((__native *) breakpoints[slot].address)); |
213 | *((__native *) breakpoints[slot].address)); |
| 208 | } |
214 | } |
| 209 | } |
215 | } |
| 210 | printf("Reached breakpoint %d:%P(%s)\n", slot, istate->rip, |
216 | printf("Reached breakpoint %d:%P(%s)\n", slot, getip(istate), |
| 211 | get_symtab_entry(istate->rip)); |
217 | get_symtab_entry(getip(istate))); |
| 212 | printf("***Type 'exit' to exit kconsole.\n"); |
218 | printf("***Type 'exit' to exit kconsole.\n"); |
| 213 | atomic_set(&haltstate,1); |
219 | atomic_set(&haltstate,1); |
| 214 | kconsole("debug"); |
220 | kconsole("debug"); |
| 215 | atomic_set(&haltstate,0); |
221 | atomic_set(&haltstate,0); |
| 216 | } |
222 | } |
| Line 219... | Line 225... | ||
| 219 | { |
225 | { |
| 220 | __native dr6; |
226 | __native dr6; |
| 221 | int i; |
227 | int i; |
| 222 | 228 | ||
| 223 | /* Set RF to restart the instruction */ |
229 | /* Set RF to restart the instruction */ |
| - | 230 | #ifdef amd64 |
|
| 224 | istate->rflags |= RFLAGS_RF; |
231 | istate->rflags |= RFLAGS_RF; |
| - | 232 | #else |
|
| - | 233 | istate->eflags |= EFLAGS_RF; |
|
| - | 234 | #endif |
|
| 225 | 235 | ||
| 226 | dr6 = read_dr6(); |
236 | dr6 = read_dr6(); |
| 227 | for (i=0; i < BKPOINTS_MAX; i++) { |
237 | for (i=0; i < BKPOINTS_MAX; i++) { |
| 228 | if (dr6 & (1 << i)) { |
238 | if (dr6 & (1 << i)) { |
| 229 | dr6 &= ~ (1 << i); |
239 | dr6 &= ~ (1 << i); |