summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authoredp <none@none>2008-04-20 08:26:44 -0700
committeredp <none@none>2008-04-20 08:26:44 -0700
commit7b9b3bf3fd4f7bfad91fce91e3e9fba62ac85c77 (patch)
tree83164fd287bcebef078d12983a32984c16c72bfa /usr/src/cmd
parent8e50dcc9f00b393d43e6aa42b820bcbf1d3e1ce4 (diff)
downloadillumos-joyent-7b9b3bf3fd4f7bfad91fce91e3e9fba62ac85c77.tar.gz
6485906 ::context broken when debugging live kernel
6600192 lx_librtld_db doesn't seem to work
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c7
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_kproc.c18
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_pservice.c35
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_rawfile.c8
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_value.c10
-rw-r--r--usr/src/cmd/mdb/intel/mdb/kvm_amd64dep.c3
-rw-r--r--usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c3
-rw-r--r--usr/src/cmd/mdb/sparc/mdb/kvm_v7dep.c3
-rw-r--r--usr/src/cmd/mdb/sparc/mdb/kvm_v9dep.c3
9 files changed, 68 insertions, 22 deletions
diff --git a/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c b/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c
index a79d455af1..170479474a 100644
--- a/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c
+++ b/usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -2220,7 +2220,7 @@ kmt_add_sbrkpt(mdb_tgt_t *t, const char *fullname,
ka->ka_defbp = dbp;
return (mdb_tgt_vespec_insert(t, &kmt_brkpt_ops, spec_flags,
- func, data, ka, kmt_bparg_dtor));
+ func, data, ka, kmt_bparg_dtor));
}
static int
@@ -2435,7 +2435,8 @@ static const mdb_tgt_ops_t kmt_ops = {
kmt_add_trap, /* t_add_fault */
kmt_getareg, /* t_getareg */
kmt_putareg, /* t_putareg */
- (int (*)()) mdb_tgt_nop /* XXX t_stack_iter */
+ (int (*)()) mdb_tgt_nop, /* XXX t_stack_iter */
+ (int (*)()) mdb_tgt_notsup /* t_auxv */
};
/*
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_kproc.c b/usr/src/cmd/mdb/common/mdb/mdb_kproc.c
index 0fabf81753..6adda9dbc6 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_kproc.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_kproc.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -870,6 +869,14 @@ kp_status(mdb_tgt_t *t, mdb_tgt_status_t *tsp)
return (0);
}
+static int
+kp_auxv(mdb_tgt_t *t, const auxv_t **auxvp)
+{
+ kp_data_t *kp = t->t_data;
+ *auxvp = kp->kp_auxv;
+ return (0);
+}
+
static const mdb_tgt_ops_t kproc_ops = {
(int (*)()) mdb_tgt_notsup, /* t_setflags */
kp_setcontext, /* t_setcontext */
@@ -921,7 +928,8 @@ static const mdb_tgt_ops_t kproc_ops = {
(int (*)()) mdb_tgt_null, /* t_add_fault */
(int (*)()) mdb_tgt_notsup, /* t_getareg XXX */
(int (*)()) mdb_tgt_notsup, /* t_putareg XXX */
- (int (*)()) mdb_tgt_notsup /* t_stack_iter XXX */
+ (int (*)()) mdb_tgt_notsup, /* t_stack_iter XXX */
+ kp_auxv /* t_auxv */
};
int
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_pservice.c b/usr/src/cmd/mdb/common/mdb/mdb_pservice.c
index dca6ccdffa..ae3d12fa40 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_pservice.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_pservice.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -96,6 +96,8 @@ static struct {
const char *, const char *, ps_sym_t *);
ps_err_e (*ps_pauxv)(struct ps_prochandle *,
const auxv_t **);
+ ps_err_e (*ps_pbrandname)(struct ps_prochandle *,
+ char *, size_t);
ps_err_e (*ps_pdmodel)(struct ps_prochandle *,
int *);
} ps_ops;
@@ -239,6 +241,33 @@ ps_pauxv(struct ps_prochandle *P, const auxv_t **auxvp)
return (PS_OK);
}
+ps_err_e
+ps_pbrandname(struct ps_prochandle *P, char *buf, size_t len)
+{
+ mdb_tgt_t *t = mdb_tgt_from_pshandle(P);
+ const auxv_t *auxv;
+
+ if (t == NULL)
+ return (ps_ops.ps_pbrandname(P, buf, len));
+
+ if (mdb_tgt_auxv(t, &auxv) != 0)
+ return (PS_ERR);
+
+ while (auxv->a_type != AT_NULL) {
+ if (auxv->a_type == AT_SUN_BRANDNAME)
+ break;
+ auxv++;
+ }
+ if (auxv->a_type == AT_NULL)
+ return (PS_ERR);
+
+ if (mdb_tgt_readstr(t, MDB_TGT_AS_VIRT,
+ buf, len, auxv->a_un.a_val) <= 0)
+ return (PS_ERR);
+
+ return (PS_OK);
+}
+
/*
* Return the data model of the target.
*/
@@ -299,6 +328,10 @@ mdb_pservice_init(void)
dlsym(RTLD_NEXT, "ps_pauxv")) == NULL)
ps_ops.ps_pauxv = (ps_err_e (*)())ps_fail;
+ if ((ps_ops.ps_pbrandname = (ps_err_e (*)())
+ dlsym(RTLD_NEXT, "ps_pbrandname")) == NULL)
+ ps_ops.ps_pbrandname = (ps_err_e (*)())ps_fail;
+
if ((ps_ops.ps_pdmodel = (ps_err_e (*)())
dlsym(RTLD_NEXT, "ps_pdmodel")) == NULL)
ps_ops.ps_pdmodel = (ps_err_e (*)())ps_fail;
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_rawfile.c b/usr/src/cmd/mdb/common/mdb/mdb_rawfile.c
index db322cdf6f..affd518083 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_rawfile.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_rawfile.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -408,6 +407,7 @@ static const mdb_tgt_ops_t rawfile_ops = {
(int (*)()) mdb_tgt_notsup, /* t_getareg */
(int (*)()) mdb_tgt_notsup, /* t_putareg */
(int (*)()) mdb_tgt_notsup, /* t_stack_iter */
+ (int (*)()) mdb_tgt_notsup /* t_auxv */
};
int
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_value.c b/usr/src/cmd/mdb/common/mdb/mdb_value.c
index 70a80b7e7d..2292b0cf03 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_value.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_value.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -158,7 +157,8 @@ static const mdb_tgt_ops_t value_ops = {
(int (*)()) mdb_tgt_null, /* t_add_fault */
(int (*)()) mdb_tgt_notsup, /* t_getareg */
(int (*)()) mdb_tgt_notsup, /* t_putareg */
- (int (*)()) mdb_tgt_nop /* t_stack_iter */
+ (int (*)()) mdb_tgt_nop, /* t_stack_iter */
+ (int (*)()) mdb_tgt_notsup /* t_auxv */
};
int
diff --git a/usr/src/cmd/mdb/intel/mdb/kvm_amd64dep.c b/usr/src/cmd/mdb/intel/mdb/kvm_amd64dep.c
index d1c9d94672..b3ecd9caed 100644
--- a/usr/src/cmd/mdb/intel/mdb/kvm_amd64dep.c
+++ b/usr/src/cmd/mdb/intel/mdb/kvm_amd64dep.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -154,6 +154,7 @@ const mdb_tgt_ops_t kt_amd64_ops = {
kt_getareg, /* t_getareg */
kt_putareg, /* t_putareg */
mdb_amd64_kvm_stack_iter, /* t_stack_iter */
+ (int (*)()) mdb_tgt_notsup /* t_auxv */
};
void
diff --git a/usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c b/usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c
index b8a559843d..3850fddd89 100644
--- a/usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c
+++ b/usr/src/cmd/mdb/intel/mdb/kvm_ia32dep.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -154,6 +154,7 @@ const mdb_tgt_ops_t kt_ia32_ops = {
kt_getareg, /* t_getareg */
kt_putareg, /* t_putareg */
mdb_ia32_kvm_stack_iter, /* t_stack_iter */
+ (int (*)()) mdb_tgt_notsup /* t_auxv */
};
void
diff --git a/usr/src/cmd/mdb/sparc/mdb/kvm_v7dep.c b/usr/src/cmd/mdb/sparc/mdb/kvm_v7dep.c
index 9ceffca0de..dcf9dd7ae3 100644
--- a/usr/src/cmd/mdb/sparc/mdb/kvm_v7dep.c
+++ b/usr/src/cmd/mdb/sparc/mdb/kvm_v7dep.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -420,6 +420,7 @@ const mdb_tgt_ops_t kt_sparcv7_ops = {
kt_getareg, /* t_getareg */
kt_putareg, /* t_putareg */
kt_stack_iter, /* t_stack_iter */
+ (int (*)()) mdb_tgt_notsup /* t_auxv */
};
void
diff --git a/usr/src/cmd/mdb/sparc/mdb/kvm_v9dep.c b/usr/src/cmd/mdb/sparc/mdb/kvm_v9dep.c
index 3df01da703..68a3b8fb1e 100644
--- a/usr/src/cmd/mdb/sparc/mdb/kvm_v9dep.c
+++ b/usr/src/cmd/mdb/sparc/mdb/kvm_v9dep.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -233,6 +233,7 @@ const mdb_tgt_ops_t kt_sparcv9_ops = {
kt_getareg, /* t_getareg */
kt_putareg, /* t_putareg */
mdb_kvm_v9stack_iter, /* t_stack_iter */
+ (int (*)()) mdb_tgt_notsup /* t_auxv */
};
void