diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-03-15 17:10:23 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-03-15 17:10:23 +0000 |
commit | 620a4f2c78fdbd33bf9b1e40f2b0ac81e84abeda (patch) | |
tree | 6b5dfb9e1f26017884d16e2ad711dcda3ddbb1d0 /sys/ddb | |
parent | b550624e3aaf045504c970f073b30a2660690a6a (diff) |
Disable x/q functionnality on 32bit platforms, because the examination code
is not supposed to work on values larger than db_expr_t.
Diffstat (limited to 'sys/ddb')
-rw-r--r-- | sys/ddb/db_access.c | 12 | ||||
-rw-r--r-- | sys/ddb/db_examine.c | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/sys/ddb/db_access.c b/sys/ddb/db_access.c index 3a7c487438a..ade4914f48c 100644 --- a/sys/ddb/db_access.c +++ b/sys/ddb/db_access.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_access.c,v 1.9 2006/03/13 06:23:20 jsg Exp $ */ +/* $OpenBSD: db_access.c,v 1.10 2007/03/15 17:10:22 miod Exp $ */ /* $NetBSD: db_access.c,v 1.8 1994/10/09 08:37:35 mycroft Exp $ */ /* @@ -51,6 +51,11 @@ db_get_value(db_addr_t addr, size_t size, boolean_t is_signed) db_expr_t value, extend; int i; +#ifdef DIAGNOSTIC + if (size > sizeof data) + size = sizeof data; +#endif + db_read_bytes(addr, size, data); value = 0; @@ -73,6 +78,11 @@ db_put_value(db_addr_t addr, size_t size, db_expr_t value) char data[sizeof(db_expr_t)]; int i; +#ifdef DIAGNOSTIC + if (size > sizeof data) + size = sizeof data; +#endif + #if BYTE_ORDER == LITTLE_ENDIAN for (i = 0; i < size; i++) #else /* BYTE_ORDER == BIG_ENDIAN */ diff --git a/sys/ddb/db_examine.c b/sys/ddb/db_examine.c index eab8e64adbb..10f8913ccfc 100644 --- a/sys/ddb/db_examine.c +++ b/sys/ddb/db_examine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_examine.c,v 1.12 2006/03/13 06:23:20 jsg Exp $ */ +/* $OpenBSD: db_examine.c,v 1.13 2007/03/15 17:10:22 miod Exp $ */ /* $NetBSD: db_examine.c,v 1.11 1996/03/30 22:30:07 christos Exp $ */ /* @@ -101,10 +101,12 @@ db_examine(db_addr_t addr, char *fmt, int count) size = 4; width = 12; break; +#ifdef __LP64__ case 'q': /* quad-word */ size = 8; width = 20; break; +#endif case 'a': /* address */ db_printf("= 0x%lx\n", (long)addr); break; |