Source-Changes-HG archive

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

[src/trunk]: src/sys/ddb Don't use an unset value as an address



details:   https://anonhg.NetBSD.org/src/rev/5c72b45dfcbc
branches:  trunk
changeset: 336357:5c72b45dfcbc
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Fri Feb 27 00:47:30 2015 +0000

description:
Don't use an unset value as an address

Instead, show usage if no address is passed.

diffstat:

 sys/ddb/db_xxx.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 96a725040def -r 5c72b45dfcbc sys/ddb/db_xxx.c
--- a/sys/ddb/db_xxx.c  Thu Feb 26 23:32:40 2015 +0000
+++ b/sys/ddb/db_xxx.c  Fri Feb 27 00:47:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_xxx.c,v 1.70 2014/09/05 09:27:24 matt Exp $ */
+/*     $NetBSD: db_xxx.c,v 1.71 2015/02/27 00:47:30 ozaki-r Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_xxx.c,v 1.70 2014/09/05 09:27:24 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_xxx.c,v 1.71 2015/02/27 00:47:30 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kgdb.h"
@@ -161,6 +161,12 @@
        bool full = false;
        fdtab_t *dt;
 
+       if (!haddr) {
+               db_printf("usage: show files address\n");
+               db_printf("\taddress == an address of a proc structure\n");
+               return;
+       }
+
        if (modif[0] == 'f')
                full = true;
 



Home | Main Index | Thread Index | Old Index