diff options
author | jhb <jhb@FreeBSD.org> | 2008-01-28 20:33:19 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-01-28 20:33:19 +0000 |
commit | d3871c9ec16a02271112e072ff1471dbea642803 (patch) | |
tree | ba1a81990942259d70f6f5940b81abf9a975a597 /gnu/usr.bin | |
parent | df803c74ff3f06c640c3ebdea30a11fe64840c84 (diff) | |
download | FreeBSD-src-d3871c9ec16a02271112e072ff1471dbea642803.zip FreeBSD-src-d3871c9ec16a02271112e072ff1471dbea642803.tar.gz |
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.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/gdb/kgdb/kthr.c | 12 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/kgdb/trgt_i386.c | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/gnu/usr.bin/gdb/kgdb/kthr.c b/gnu/usr.bin/gdb/kgdb/kthr.c index c114515..4c51c0e 100644 --- a/gnu/usr.bin/gdb/kgdb/kthr.c +++ b/gnu/usr.bin/gdb/kgdb/kthr.c @@ -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) diff --git a/gnu/usr.bin/gdb/kgdb/trgt_i386.c b/gnu/usr.bin/gdb/kgdb/trgt_i386.c index c3581b5..de15a63 100644 --- a/gnu/usr.bin/gdb/kgdb/trgt_i386.c +++ b/gnu/usr.bin/gdb/kgdb/trgt_i386.c @@ -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)); |