summaryrefslogtreecommitdiff
path: root/sys/ddb/db_struct.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-10-19 21:02:51 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-10-19 21:02:51 +0000
commit345dfbd3013f0ebce5a0c2510b22ae5b673c3feb (patch)
tree63d0048fdf15d80a0865db7fc87b9f0a9039cd70 /sys/ddb/db_struct.c
parent31ce1e86973d10982411ca19e3872ad7308b0f4d (diff)
LP64 non-PMAP_DIRECT archs like sparc64 have a structure larger
than 65536 bytes, so make parse_structinfo.pl detect that and switch to u_int for sizes and offsets when that happens. ok miod@
Diffstat (limited to 'sys/ddb/db_struct.c')
-rw-r--r--sys/ddb/db_struct.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/ddb/db_struct.c b/sys/ddb/db_struct.c
index e575d2923f2..98ecbfe9fe4 100644
--- a/sys/ddb/db_struct.c
+++ b/sys/ddb/db_struct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_struct.c,v 1.2 2013/10/15 19:23:24 guenther Exp $ */
+/* $OpenBSD: db_struct.c,v 1.3 2013/10/19 21:02:50 guenther Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -100,7 +100,7 @@ db_struct_print_field(uint fidx, int flags, db_expr_t baseaddr)
db_printf("bitfield");
/* basecol irrelevant from there on */
} else {
- snprintf(tmpfmt, sizeof tmpfmt, "%hu", field->size);
+ snprintf(tmpfmt, sizeof tmpfmt, "%u", (u_int)field->size);
basecol += strlen(tmpfmt) + 1;
db_printf("%s ", tmpfmt);
}
@@ -179,7 +179,7 @@ db_struct_offset_cmd(db_expr_t addr, int have_addr, db_expr_t count,
{
db_expr_t offset = 0;
const struct ddb_field_offsets *field;
- const u_short *fidx;
+ const ddb_field_off *fidx;
uint oidx;
int width;
char tmpfmt[28];
@@ -268,8 +268,9 @@ db_struct_layout_cmd(db_expr_t addr, int have_addr, db_expr_t count,
* Display the structure contents.
*/
- db_printf("struct %s at %p (%hu bytes)\n",
- ddb_structfield_strings + struc->name, (void *)addr, struc->size);
+ db_printf("struct %s at %p (%u bytes)\n",
+ ddb_structfield_strings + struc->name, (void *)addr,
+ (u_int)struc->size);
for (fidx = struc->fmin; fidx <= struc->fmax; fidx++)
db_struct_print_field(fidx, DBSP_VALUE, addr);
}