* 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.
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;
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);
}