AMD64 - Fix minor issues.
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 26 Aug 2009 07:02:05 +0000 (00:02 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 26 Aug 2009 07:02:05 +0000 (00:02 -0700)
* Stop kgdb from looping forever if it comes across a bad address
  during the thread scan.

* livkvm prints the correct address for the invalid address message
  instead of truncating it to 32 bits.

gnu/usr.bin/gdb/kgdb/kthr.c
lib/libkvm/kvm_amd64.c

index f1f2520..e0db928 100644 (file)
@@ -119,8 +119,11 @@ kgdb_thr_init(void)
 
                addr = (uintptr_t)TAILQ_FIRST(&gd.mi.gd_tdallq);
                while (addr != 0) {
-                       if (kvm_read(kvm, addr, &td, sizeof(td)) != sizeof(td))
-                               warnx("kvm_read: %s", kvm_geterr(kvm));
+                       if (kvm_read(kvm, addr, &td, sizeof(td)) != sizeof(td)) {
+                               warnx("kvm_read: %s, while accessing thread",
+                                     kvm_geterr(kvm));
+                               break;
+                       }
                        kt = malloc(sizeof(*kt));
                        kt->next = first;
                        kt->kaddr = addr;
index 33e73f1..be28db1 100644 (file)
@@ -226,7 +226,7 @@ _kvm_vatop(kvm_t *kd, u_long va, u_long *pa)
        return (PAGE_SIZE - offset);
 
 invalid:
-       _kvm_err(kd, 0, "invalid address (%x)", va);
+       _kvm_err(kd, 0, "invalid address (%jx)", (intmax_t)va);
        return (0);
 }