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

Function decode_syscall

freebsd/i386/i386/db_trace.c:270–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270static void
271decode_syscall(int number, struct thread *td)
272{
273 struct proc *p;
274 c_db_sym_t sym;
275 db_expr_t diff;
276 sy_call_t *f;
277 const char *symname;
278
279 db_printf(" (%d", number);
280 p = (td != NULL) ? td->td_proc : NULL;
281 if (p != NULL && 0 <= number && number < p->p_sysent->sv_size) {
282 f = p->p_sysent->sv_table[number].sy_call;
283 sym = db_search_symbol((db_addr_t)f, DB_STGY_ANY, &diff);
284 if (sym != DB_SYM_NULL && diff == 0) {
285 db_symbol_values(sym, &symname, NULL);
286 db_printf(", %s, %s", p->p_sysent->sv_name, symname);
287 }
288 }
289 db_printf(")");
290}
291
292/*
293 * Figure out the next frame up in the call stack.

Callers 1

db_nextframeFunction · 0.70

Calls 3

db_printfFunction · 0.85
db_search_symbolFunction · 0.85
db_symbol_valuesFunction · 0.85

Tested by

no test coverage detected