diff options
Diffstat (limited to 'usr/src/cmd/mdb/common')
| -rw-r--r-- | usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c | 7 | ||||
| -rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_kproc.c | 18 | ||||
| -rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_pservice.c | 35 | ||||
| -rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_rawfile.c | 8 | ||||
| -rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_value.c | 10 |
5 files changed, 60 insertions, 18 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 |
