Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ddb When looking for the next element of cpu_queue compa...



details:   https://anonhg.NetBSD.org/src/rev/809a945ccae7
branches:  trunk
changeset: 762386:809a945ccae7
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sun Feb 20 10:24:45 2011 +0000

description:
When looking for the next element of cpu_queue compare the pointer to the
address of the head, not to the head itself.  Not sure if the cast of the
arg to db_value_name() is right, but works on i386 and compiles on sparc64.

Stack traces from ddb work again on i386.

diffstat:

 sys/ddb/db_cpu.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (42 lines):

diff -r 8fcddd5c0024 -r 809a945ccae7 sys/ddb/db_cpu.c
--- a/sys/ddb/db_cpu.c  Sun Feb 20 10:02:01 2011 +0000
+++ b/sys/ddb/db_cpu.c  Sun Feb 20 10:24:45 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_cpu.c,v 1.3 2009/03/09 06:07:05 mrg Exp $   */
+/*     $NetBSD: db_cpu.c,v 1.4 2011/02/20 10:24:45 hannken Exp $       */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.3 2009/03/09 06:07:05 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_cpu.c,v 1.4 2011/02/20 10:24:45 hannken Exp $");
 
 #ifndef _KERNEL
 #include <stdbool.h>
@@ -43,12 +43,14 @@
 #include <ddb/ddb.h>
 
 static struct cpu_info *head;
+static void *head_addr;
 
 struct cpu_info *
 db_cpu_first(void)
 {
 
        head = db_read_ptr("cpu_queue");
+       (void) db_value_of_name("cpu_queue", (db_expr_t *)&head_addr);
        return head;
 }
 
@@ -58,7 +60,7 @@
 
        db_read_bytes((db_addr_t)&ci->ci_data.cpu_qchain.cqe_next,
            sizeof(ci), (char *)&ci);
-       if (ci == head) {
+       if (ci == head_addr) {
                ci = NULL;
        }
        return ci;



Home | Main Index | Thread Index | Old Index