summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2013-05-10 15:46:25 +0000
committerBryan Cantrill <bryan@joyent.com>2013-05-10 15:46:25 +0000
commit00f060055661e6a089719d017c7d694ff6f2b63a (patch)
tree320165133fdcb7187454374f10a2335e68ec3563
parente083a554cd81f87a93a0b654bcbe3ffa29437ef2 (diff)
downloadillumos-joyent-00f060055661e6a089719d017c7d694ff6f2b63a.tar.gz
OS-2170 want 64-bit v8 mdb dmod
-rw-r--r--manifest1
-rw-r--r--usr/src/cmd/mdb/Makefile.common6
-rw-r--r--usr/src/cmd/mdb/common/modules/v8/mdb_v8.c24
-rw-r--r--usr/src/cmd/mdb/common/modules/v8/mdb_v8_cfg.c7
-rw-r--r--usr/src/cmd/mdb/common/modules/v8/v8dbg.h6
5 files changed, 33 insertions, 11 deletions
diff --git a/manifest b/manifest
index 449d12b53b..0a1884c9f4 100644
--- a/manifest
+++ b/manifest
@@ -9537,6 +9537,7 @@ f usr/lib/mdb/proc/amd64/libuutil.so 0555 root sys
f usr/lib/mdb/proc/amd64/libzpool.so 0555 root sys
f usr/lib/mdb/proc/amd64/mdb_ds.so 0555 root sys
f usr/lib/mdb/proc/amd64/mdb_test.so 0555 root sys
+f usr/lib/mdb/proc/amd64/v8.so 0555 root sys
f usr/lib/mdb/proc/eft.so 0555 root sys
f usr/lib/mdb/proc/fmd.so 0555 root sys
f usr/lib/mdb/proc/ld.so 0555 root sys
diff --git a/usr/src/cmd/mdb/Makefile.common b/usr/src/cmd/mdb/Makefile.common
index 3bbca8d4e0..b78836c741 100644
--- a/usr/src/cmd/mdb/Makefile.common
+++ b/usr/src/cmd/mdb/Makefile.common
@@ -38,15 +38,15 @@ COMMON_MODULES_PROC = \
libuutil \
libzpool \
mdb_ds \
- mdb_test
+ mdb_test \
+ v8
#
# MDB modules used for debugging user processes which are only 32-bit
#
COMMON_MODULES_PROC_32BIT = \
svc.configd \
- svc.startd \
- v8
+ svc.startd
#
# MDB modules used for debugging kernels.
diff --git a/usr/src/cmd/mdb/common/modules/v8/mdb_v8.c b/usr/src/cmd/mdb/common/modules/v8/mdb_v8.c
index c6da9a7230..28ca6db42f 100644
--- a/usr/src/cmd/mdb/common/modules/v8/mdb_v8.c
+++ b/usr/src/cmd/mdb/common/modules/v8/mdb_v8.c
@@ -130,6 +130,7 @@ static intptr_t V8_HeapObjectTagMask;
static intptr_t V8_SmiTag;
static intptr_t V8_SmiTagMask;
static intptr_t V8_SmiValueShift;
+static intptr_t V8_SmiShiftSize;
static intptr_t V8_PointerSizeLog2;
static intptr_t V8_ISSHARED_SHIFT;
@@ -243,6 +244,12 @@ static v8_constant_t v8_constants[] = {
{ &V8_SmiTag, "v8dbg_SmiTag" },
{ &V8_SmiTagMask, "v8dbg_SmiTagMask" },
{ &V8_SmiValueShift, "v8dbg_SmiValueShift" },
+ { &V8_SmiShiftSize, "v8dbg_SmiShiftSize",
+#ifdef _LP64
+ V8_CONSTANT_FALLBACK(0, 0), 31 },
+#else
+ V8_CONSTANT_FALLBACK(0, 0), 0 },
+#endif
{ &V8_PointerSizeLog2, "v8dbg_PointerSizeLog2" },
{ &V8_DICT_SHIFT, "v8dbg_dict_shift",
@@ -1622,7 +1629,7 @@ jsobj_properties(uintptr_t addr,
uintptr_t keyidx, validx, detidx, baseidx;
char buf[1024];
intptr_t val;
- uint_t len = sizeof (buf);
+ size_t len = sizeof (buf);
char *c = buf;
if (V8_PROP_IDX_CONTENT != -1) {
@@ -2276,7 +2283,7 @@ dcmd_v8function(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
uint8_t type;
uintptr_t funcinfop, scriptp, lendsp, tokpos, namep, codep;
char *bufp;
- uint_t len;
+ size_t len;
boolean_t opt_d = B_FALSE;
char buf[512];
@@ -2424,8 +2431,17 @@ load_current_context(uintptr_t *fpp, uintptr_t *raddrp)
{
mdb_reg_t regfp, regip;
+#ifdef __amd64
+ if (mdb_getareg(1, "rbp", &regfp) != 0 ||
+ mdb_getareg(1, "rip", &regip) != 0) {
+#else
+#ifdef __i386
if (mdb_getareg(1, "ebp", &regfp) != 0 ||
mdb_getareg(1, "eip", &regip) != 0) {
+#else
+#error Unrecognized microprocessor
+#endif
+#endif
v8_warn("failed to load current context");
return (-1);
}
@@ -2860,7 +2876,7 @@ static void
findjsobjects_constructor(findjsobjects_obj_t *obj)
{
char *bufp = obj->fjso_constructor;
- unsigned int len = sizeof (obj->fjso_constructor);
+ size_t len = sizeof (obj->fjso_constructor);
uintptr_t map, funcinfop;
uintptr_t addr = obj->fjso_instances.fjsi_addr;
uint8_t type;
@@ -3523,7 +3539,7 @@ dcmd_findjsobjects(uintptr_t addr,
if (references || fjs.fjs_marking)
return (DCMD_OK);
- mdb_printf("%-?s %8s %8s %s\n", "OBJECT",
+ mdb_printf("%?s %8s %8s %s\n", "OBJECT",
"#OBJECTS", "#PROPS", "CONSTRUCTOR: PROPS");
for (obj = fjs.fjs_objects; obj != NULL; obj = obj->fjso_next) {
diff --git a/usr/src/cmd/mdb/common/modules/v8/mdb_v8_cfg.c b/usr/src/cmd/mdb/common/modules/v8/mdb_v8_cfg.c
index 1f0b02689d..d907242435 100644
--- a/usr/src/cmd/mdb/common/modules/v8/mdb_v8_cfg.c
+++ b/usr/src/cmd/mdb/common/modules/v8/mdb_v8_cfg.c
@@ -45,7 +45,12 @@ v8cfg_target_iter(v8_cfg_t *cfgp, int (*func)(mdb_symbol_t *, void *),
static int
v8cfg_target_readsym(v8_cfg_t *cfgp, const char *name, intptr_t *valp)
{
- return (mdb_readsym(valp, sizeof (valp), name));
+ int val, rval;
+
+ if ((rval = mdb_readsym(&val, sizeof (val), name)) != -1)
+ *valp = (intptr_t)val;
+
+ return (rval);
}
/*
diff --git a/usr/src/cmd/mdb/common/modules/v8/v8dbg.h b/usr/src/cmd/mdb/common/modules/v8/v8dbg.h
index 486ac5e255..c675dc56cb 100644
--- a/usr/src/cmd/mdb/common/modules/v8/v8dbg.h
+++ b/usr/src/cmd/mdb/common/modules/v8/v8dbg.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -50,7 +50,7 @@
* Extract the value of a SMI "pointer". Recall that small integers are stored
* using the upper 31 bits.
*/
-#define V8_SMI_VALUE(smi) ((smi) >> V8_SmiValueShift)
+#define V8_SMI_VALUE(smi) ((smi) >> (V8_SmiValueShift + V8_SmiShiftSize))
/*
* Determine the encoding and representation of a V8 string.
@@ -76,6 +76,6 @@
#define V8_DESC_DETIDX(x) (((x) << 1) + 1)
#define V8_DESC_ISFIELD(x) \
- (V8_SMI_VALUE((x) & V8_PROP_TYPE_MASK) == V8_PROP_TYPE_FIELD)
+ ((V8_SMI_VALUE(x) & V8_PROP_TYPE_MASK) == V8_PROP_TYPE_FIELD)
#endif /* _V8DBG_H */