diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2010-07-04 12:27:18 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2010-07-04 12:27:18 +0000 |
| commit | d59517691bccd54a514ce63602c35a5ed6f6b6ce (patch) | |
| tree | 090f480e5c5ca35c10159e15b0534898d8d60eaa /sys/ddb/db_thread.c | |
| parent | 0cf161c648e4ceaf5a8489f0a905b77508e642c4 (diff) | |
Notes
Diffstat (limited to 'sys/ddb/db_thread.c')
| -rw-r--r-- | sys/ddb/db_thread.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/sys/ddb/db_thread.c b/sys/ddb/db_thread.c index e127eeae1b07..18884454b429 100644 --- a/sys/ddb/db_thread.c +++ b/sys/ddb/db_thread.c @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include <ddb/db_command.h> #include <ddb/db_sym.h> -static db_expr_t hex2dec(db_expr_t expr); - void db_print_thread(void) { @@ -108,31 +106,6 @@ db_show_threads(db_expr_t addr, boolean_t hasaddr, db_expr_t cnt, char *mod) } /* - * Take the parsed expression value from the command line that was parsed - * as a hexadecimal value and convert it as if the expression was parsed - * as a decimal value. Returns -1 if the expression was not a valid - * decimal value. - */ -static db_expr_t -hex2dec(db_expr_t expr) -{ - uintptr_t x, y; - db_expr_t val; - - y = 1; - val = 0; - x = expr; - while (x != 0) { - if (x % 16 > 9) - return (-1); - val += (x % 16) * (y); - x >>= 4; - y *= 10; - } - return (val); -} - -/* * Lookup a thread based on a db expression address. We assume that the * address was parsed in hexadecimal. We reparse the address in decimal * first and try to treat it as a thread ID to find an associated thread. @@ -151,7 +124,7 @@ db_lookup_thread(db_expr_t addr, boolean_t check_pid) * If the parsed address was not a valid decimal expression, * assume it is a thread pointer. */ - decaddr = hex2dec(addr); + decaddr = db_hex2dec(addr); if (decaddr == -1) return ((struct thread *)addr); @@ -183,7 +156,7 @@ db_lookup_proc(db_expr_t addr) db_expr_t decaddr; struct proc *p; - decaddr = hex2dec(addr); + decaddr = db_hex2dec(addr); if (decaddr != -1) { FOREACH_PROC_IN_SYSTEM(p) { if (p->p_pid == decaddr) |
