From f8191f94aacee4f7629b897c8cbc6dfdd49b4308 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 28 Sep 2003 06:02:33 +0000 Subject: [PATCH] Reworked rev.1.14. Use the ELF symbol type again to summarily reject some symbols in X_db_search_symbol(). Reject the same symbols that rev.1.13 did (all except STT_OBJECT and STT_FUNC), except don't reject typeless symbols. This keeps the typeless symbols in non-verbosely written assembler code visible, but makes file symbols invisible. ELF file symbols have type STT_FILE and value 0, so this stops small values and offsets sometimes being displayed in terms of the first file symbol in the kernel (usually device_if.c). I think it rejects some other unwanted symbols (small absolute symbols for things like struct offsets). It may reject some wanted symbols (large absolute symbols for addresses like PTmap). --- sys/ddb/db_elf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/ddb/db_elf.c b/sys/ddb/db_elf.c index 3493115a87b..4ebdc8e7c0d 100644 --- a/sys/ddb/db_elf.c +++ b/sys/ddb/db_elf.c @@ -266,6 +266,11 @@ X_db_search_symbol(symtab, off, strategy, diffp) for (symp = symtab_start; symp < symtab_end; symp++) { if (symp->st_name == 0) continue; + if (ELF_ST_TYPE(symp->st_info) != STT_OBJECT && + ELF_ST_TYPE(symp->st_info) != STT_FUNC && + ELF_ST_TYPE(symp->st_info) != STT_NOTYPE) + continue; + if (off >= symp->st_value) { if ((off - symp->st_value) < diff) { diff = off - symp->st_value;