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

Function db_printsym

freebsd/ddb/db_sym.c:441–471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439db_expr_t db_maxoff = 0x10000;
440
441void
442db_printsym(db_expr_t off, db_strategy_t strategy)
443{
444 db_expr_t d;
445 char *filename;
446 const char *name;
447 int linenum;
448 c_db_sym_t cursym;
449
450 if (off < 0 && off >= -db_maxoff) {
451 db_printf("%+#lr", (long)off);
452 return;
453 }
454 cursym = db_search_symbol(off, strategy, &d);
455 db_symbol_values(cursym, &name, NULL);
456 if (name == NULL || d >= (db_addr_t)db_maxoff) {
457 db_printf("%#lr", (unsigned long)off);
458 return;
459 }
460#ifdef DDB_NUMSYM
461 db_printf("%#lr = %s", (unsigned long)off, name);
462#else
463 db_printf("%s", name);
464#endif
465 if (d)
466 db_printf("+%+#lr", (long)d);
467 if (strategy == DB_STGY_PROC) {
468 if (db_line_at_pc(cursym, &filename, &linenum, off))
469 db_printf(" [%s:%d]", filename, linenum);
470 }
471}
472
473static bool
474db_line_at_pc(c_db_sym_t sym, char **filename, int *linenum, db_expr_t pc)

Callers 15

db_print_stack_entryFunction · 0.85
db_md_list_watchpointsFunction · 0.85
machdep.cFile · 0.85
db_print_addressFunction · 0.85
db_disasmFunction · 0.85
stacktrace_subrFunction · 0.85
db_print_stack_entryFunction · 0.85
db_md_list_watchpointsFunction · 0.85
machdep.cFile · 0.85
db_print_addressFunction · 0.85
db_disasmFunction · 0.85
db_stack_trace_cmdFunction · 0.85

Calls 4

db_printfFunction · 0.85
db_search_symbolFunction · 0.85
db_symbol_valuesFunction · 0.85
db_line_at_pcFunction · 0.85

Tested by

no test coverage detected