diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2002-03-19 23:10:58 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2002-03-19 23:10:58 +0000 |
commit | c748d4061c0eb058733592f4ee76bba9eec1706d (patch) | |
tree | 6533f6ddb9bdbb6f3f5b83f1324376abd9bb85f3 | |
parent | 841af9ccbae1ba8b80cc7ab134999ab874e95080 (diff) |
Do not print offset if no symbol found for address. ok art@
-rw-r--r-- | usr.bin/pmdb/pmdb.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/pmdb/pmdb.c b/usr.bin/pmdb/pmdb.c index cecfff29b3c..9f6e7b47a71 100644 --- a/usr.bin/pmdb/pmdb.c +++ b/usr.bin/pmdb/pmdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmdb.c,v 1.4 2002/03/15 18:21:20 art Exp $ */ +/* $OpenBSD: pmdb.c,v 1.5 2002/03/19 23:10:57 drahn Exp $ */ /* * Copyright (c) 2002 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -253,6 +253,7 @@ cmd_show_backtrace(int argc, char **argv, void *arg) if (name == NULL) { snprintf(namebuf, sizeof(namebuf), "0x%lx", mfr.pc); name = namebuf; + offs = 0; } printf("%s(", name); @@ -261,7 +262,11 @@ cmd_show_backtrace(int argc, char **argv, void *arg) if (j < mfr.nargs - 1) printf(", "); } - printf(")+0x%lx\n", offs); + if (offs == 0) { + printf(")\n", offs); + } else { + printf(")+0x%lx\n", offs); + } } return 0; } |