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

Function kcsan_md_unwind

freebsd/arm64/include/csan.h:70–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70static void
71kcsan_md_unwind(void)
72{
73#ifdef DDB
74 c_db_sym_t sym;
75 db_expr_t offset;
76 const char *symname;
77#endif
78 struct unwind_state frame;
79 uintptr_t sp;
80 int nsym;
81
82 __asm __volatile("mov %0, sp" : "=&r" (sp));
83
84 frame.sp = sp;
85 frame.fp = (uintptr_t)__builtin_frame_address(0);
86 frame.pc = (uintptr_t)kcsan_md_unwind;
87 nsym = 0;
88
89 while (1) {
90 if (!unwind_frame(curthread, &frame))
91 break;
92 if (!INKERNEL((vm_offset_t)frame.pc))
93 break;
94
95#ifdef DDB
96 sym = db_search_symbol((vm_offset_t)frame.pc, DB_STGY_PROC,
97 &offset);
98 db_symbol_values(sym, &symname, NULL);
99 printf("#%d %p in %s+%#lx\n", nsym, (void *)frame.pc,
100 symname, offset);
101#else
102 printf("#%d %p\n", nsym, (void *)frame.pc);
103#endif
104 nsym++;
105
106 if (nsym >= 15) {
107 break;
108 }
109 }
110}

Callers

nothing calls this directly

Calls 4

unwind_frameFunction · 0.85
db_search_symbolFunction · 0.85
db_symbol_valuesFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected