1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-05 09:14:03 +00:00

Remove the warnx() from kgdb_lookup() so that we don't emit a warning about

optional symbols that are missing (e.g. kgdb complains about _stoppcbs and
_stopped_cpus on UP kernels).  Instead, callers that really want their
symbols to be present now do explicitly warnx() about the missing symbol.
This commit is contained in:
John Baldwin 2008-01-28 20:33:19 +00:00
parent 4d6cae0d4d
commit fea3c2c5c7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175771
2 changed files with 10 additions and 6 deletions

View File

@ -60,10 +60,8 @@ kgdb_lookup(const char *sym)
nl[0].n_name = (char *)(uintptr_t)sym;
nl[1].n_name = NULL;
if (kvm_nlist(kvm, nl) != 0) {
warnx("kvm_nlist(%s): %s", sym, kvm_geterr(kvm));
if (kvm_nlist(kvm, nl) != 0)
return (0);
}
return (nl[0].n_value);
}
@ -82,13 +80,17 @@ kgdb_thr_init(void)
uintptr_t addr, paddr;
addr = kgdb_lookup("_allproc");
if (addr == 0)
if (addr == 0) {
warnx("kvm_nlist(_allproc): %s", kvm_geterr(kvm));
return (NULL);
}
kvm_read(kvm, addr, &paddr, sizeof(paddr));
dumppcb = kgdb_lookup("_dumppcb");
if (dumppcb == 0)
if (dumppcb == 0) {
warnx("kvm_nlist(_dumppcb): %s", kvm_geterr(kvm));
return (NULL);
}
addr = kgdb_lookup("_dumptid");
if (addr != 0)

View File

@ -141,8 +141,10 @@ kgdb_trgt_fetch_tss(void)
*/
if (trunc_page(tss) == 0xffc00000) {
addr = kgdb_lookup("_cpu0prvpage");
if (addr == 0)
if (addr == 0) {
warnx("kvm_nlist(_cpu0prvpage): %s", kvm_geterr(kvm));
return (0);
}
if (kvm_read(kvm, addr, &cpu0prvpage, sizeof(cpu0prvpage)) !=
sizeof(cpu0prvpage)) {
warnx("kvm_read: %s", kvm_geterr(kvm));