Rev 4132 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4132 | Rev 4137 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | #include <print.h> |
40 | #include <print.h> |
41 | #include <panic.h> |
41 | #include <panic.h> |
42 | #include <arch.h> |
42 | #include <arch.h> |
43 | #include <arch/cp0.h> |
43 | #include <arch/cp0.h> |
44 | #include <func.h> |
44 | #include <func.h> |
45 | - | ||
46 | #ifdef CONFIG_SYMTAB |
- | |
47 | #include <symtab.h> |
45 | #include <symtab.h> |
48 | #endif |
- | |
49 | 46 | ||
50 | bpinfo_t breakpoints[BKPOINTS_MAX]; |
47 | bpinfo_t breakpoints[BKPOINTS_MAX]; |
51 | SPINLOCK_INITIALIZE(bkpoint_lock); |
48 | SPINLOCK_INITIALIZE(bkpoint_lock); |
52 | 49 | ||
53 | #ifdef CONFIG_KCONSOLE |
50 | #ifdef CONFIG_KCONSOLE |
Line 260... | Line 257... | ||
260 | printf("# Count Address INPROG ONESHOT FUNCCALL In symbol\n"); |
257 | printf("# Count Address INPROG ONESHOT FUNCCALL In symbol\n"); |
261 | printf("-- ----- ---------- ------ ------- -------- ---------\n"); |
258 | printf("-- ----- ---------- ------ ------- -------- ---------\n"); |
262 | 259 | ||
263 | for (i = 0; i < BKPOINTS_MAX; i++) |
260 | for (i = 0; i < BKPOINTS_MAX; i++) |
264 | if (breakpoints[i].address) { |
261 | if (breakpoints[i].address) { |
265 | #ifdef CONFIG_SYMTAB |
- | |
266 | symbol = get_symtab_entry(breakpoints[i].address); |
262 | symbol = symtab_fmt_name_lookup( |
267 | #else |
- | |
268 | symbol = "n/a"; |
263 | breakpoints[i].address); |
269 | #endif |
- | |
270 | 264 | ||
271 | printf("%-2u %-5d %#10zx %-6s %-7s %-8s %s\n", i, |
265 | printf("%-2u %-5d %#10zx %-6s %-7s %-8s %s\n", i, |
272 | breakpoints[i].counter, breakpoints[i].address, |
266 | breakpoints[i].counter, breakpoints[i].address, |
273 | ((breakpoints[i].flags & BKPOINT_INPROG) ? "true" : |
267 | ((breakpoints[i].flags & BKPOINT_INPROG) ? "true" : |
274 | "false"), ((breakpoints[i].flags & BKPOINT_ONESHOT) |
268 | "false"), ((breakpoints[i].flags & BKPOINT_ONESHOT) |
275 | ? "true" : "false"), ((breakpoints[i].flags & |
269 | ? "true" : "false"), ((breakpoints[i].flags & |
Line 354... | Line 348... | ||
354 | } |
348 | } |
355 | if (cur->flags & BKPOINT_INPROG) |
349 | if (cur->flags & BKPOINT_INPROG) |
356 | printf("Warning: breakpoint recursion\n"); |
350 | printf("Warning: breakpoint recursion\n"); |
357 | 351 | ||
358 | if (!(cur->flags & BKPOINT_FUNCCALL)) { |
352 | if (!(cur->flags & BKPOINT_FUNCCALL)) { |
359 | #ifdef CONFIG_SYMTAB |
- | |
360 | printf("***Breakpoint %d: %p in %s.\n", i, fireaddr, |
353 | printf("***Breakpoint %d: %p in %s.\n", i, fireaddr, |
361 | get_symtab_entry(istate->epc)); |
354 | symtab_fmt_name_lookup(istate->epc)); |
362 | #else |
- | |
363 | printf("***Breakpoint %d: %p.\n", i, fireaddr); |
- | |
364 | #endif |
- | |
365 | } |
355 | } |
366 | 356 | ||
367 | /* Return first instruction back */ |
357 | /* Return first instruction back */ |
368 | ((uint32_t *)cur->address)[0] = cur->instruction; |
358 | ((uint32_t *)cur->address)[0] = cur->instruction; |
369 | smc_coherence(cur->address); |
359 | smc_coherence(cur->address); |
Line 373... | Line 363... | ||
373 | ((uint32_t *)cur->address)[1] = 0x0d; |
363 | ((uint32_t *)cur->address)[1] = 0x0d; |
374 | cur->flags |= BKPOINT_REINST; |
364 | cur->flags |= BKPOINT_REINST; |
375 | } |
365 | } |
376 | cur->flags |= BKPOINT_INPROG; |
366 | cur->flags |= BKPOINT_INPROG; |
377 | } else { |
367 | } else { |
378 | #ifdef CONFIG_SYMTAB |
- | |
379 | printf("***Breakpoint %p in %s.\n", fireaddr, |
368 | printf("***Breakpoint %d: %p in %s.\n", i, fireaddr, |
380 | get_symtab_entry(fireaddr)); |
369 | symtab_fmt_name_lookup(fireaddr)); |
381 | #else |
370 | |
382 | printf("***Breakpoint %p.\n", fireaddr); |
- | |
383 | #endif |
- | |
384 | /* Move on to next instruction */ |
371 | /* Move on to next instruction */ |
385 | istate->epc += 4; |
372 | istate->epc += 4; |
386 | } |
373 | } |
387 | if (cur) |
374 | if (cur) |
388 | cur->counter++; |
375 | cur->counter++; |