diff options
author | bde <bde@FreeBSD.org> | 2003-09-28 06:02:33 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2003-09-28 06:02:33 +0000 |
commit | f245587e6d5928d2ccd12c3ef36695723a9a7df1 (patch) | |
tree | 4b2f26318e1316f5e499cdd4f15de958e52240f9 /sys/ddb | |
parent | eae77f1521b3144d5191821283b440e297c74321 (diff) | |
download | FreeBSD-src-f245587e6d5928d2ccd12c3ef36695723a9a7df1.zip FreeBSD-src-f245587e6d5928d2ccd12c3ef36695723a9a7df1.tar.gz |
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).
Diffstat (limited to 'sys/ddb')
-rw-r--r-- | sys/ddb/db_elf.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/ddb/db_elf.c b/sys/ddb/db_elf.c index 3493115..4ebdc8e 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; |