| 65 | } |
| 66 | |
| 67 | static void |
| 68 | db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) |
| 69 | { |
| 70 | c_db_sym_t sym; |
| 71 | const char *name; |
| 72 | db_expr_t value; |
| 73 | db_expr_t offset; |
| 74 | |
| 75 | while (1) { |
| 76 | uintptr_t pc = frame->pc; |
| 77 | |
| 78 | if (!unwind_frame(td, frame)) |
| 79 | break; |
| 80 | |
| 81 | sym = db_search_symbol(pc, DB_STGY_ANY, &offset); |
| 82 | if (sym == C_DB_SYM_NULL) { |
| 83 | value = 0; |
| 84 | name = "(null)"; |
| 85 | } else |
| 86 | db_symbol_values(sym, &name, &value); |
| 87 | |
| 88 | db_printf("%s() at ", name); |
| 89 | db_printsym(frame->pc, DB_STGY_PROC); |
| 90 | db_printf("\n"); |
| 91 | |
| 92 | db_printf("\t pc = 0x%016lx lr = 0x%016lx\n", pc, |
| 93 | frame->pc); |
| 94 | db_printf("\t sp = 0x%016lx fp = 0x%016lx\n", frame->sp, |
| 95 | frame->fp); |
| 96 | /* TODO: Show some more registers */ |
| 97 | db_printf("\n"); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | int |
| 102 | db_trace_thread(struct thread *thr, int count) |
no test coverage detected