Rev 614 | Rev 623 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 614 | Rev 615 | ||
|---|---|---|---|
| Line 229... | Line 229... | ||
| 229 | if (cur) { |
229 | if (cur) { |
| 230 | if ((cur->executing && pstate->epc==cur->address) || |
230 | if ((cur->executing && pstate->epc==cur->address) || |
| 231 | (!cur->executing && pstate->epc==cur->address+sizeof(__native))) |
231 | (!cur->executing && pstate->epc==cur->address+sizeof(__native))) |
| 232 | panic("Weird breakpoint state.\n"); |
232 | panic("Weird breakpoint state.\n"); |
| 233 | if (!cur->executing) { |
233 | if (!cur->executing) { |
| 234 | printf("***Breakpoint %d: %p in %s.\n", i, |
234 | printf("***Breakpoint %d: 0x%p in %s.\n", i, |
| 235 | pstate->epc,symbol); |
235 | pstate->epc,symbol); |
| 236 | /* Return first instruction back */ |
236 | /* Return first instruction back */ |
| 237 | ((__u32 *)cur->address)[0] = cur->instruction; |
237 | ((__u32 *)cur->address)[0] = cur->instruction; |
| 238 | /* Set Breakpoint on second */ |
238 | /* Set Breakpoint on second */ |
| 239 | ((__u32 *)cur->address)[1] = 0x0d; |
239 | ((__u32 *)cur->address)[1] = 0x0d; |
| Line 246... | Line 246... | ||
| 246 | cur->executing = false; |
246 | cur->executing = false; |
| 247 | spinlock_unlock(&bkpoint_lock); |
247 | spinlock_unlock(&bkpoint_lock); |
| 248 | return; |
248 | return; |
| 249 | } |
249 | } |
| 250 | } else { |
250 | } else { |
| 251 | printf("***Breakpoint %p in %s.\n", pstate->epc, symbol); |
251 | printf("***Breakpoint 0x%p in %s.\n", pstate->epc, symbol); |
| 252 | /* Move on to next instruction */ |
252 | /* Move on to next instruction */ |
| 253 | pstate->epc += 4; |
253 | pstate->epc += 4; |
| 254 | } |
254 | } |
| 255 | spinlock_unlock(&bkpoint_lock); |
255 | spinlock_unlock(&bkpoint_lock); |
| 256 | 256 | ||