MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_stack_trace_cmd

Function db_stack_trace_cmd

freebsd/arm64/arm64/db_trace.c:67–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67static void
68db_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
101int
102db_trace_thread(struct thread *thr, int count)

Callers 2

db_trace_threadFunction · 0.70
db_trace_selfFunction · 0.70

Calls 5

unwind_frameFunction · 0.85
db_search_symbolFunction · 0.85
db_symbol_valuesFunction · 0.85
db_printfFunction · 0.85
db_printsymFunction · 0.85

Tested by

no test coverage detected