mdb_amd64util.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/privregs.h>
#include <mdb/mdb_target_impl.h>
#include <mdb/mdb_kreg_impl.h>
#include <mdb/mdb_debug.h>
#include <mdb/mdb_modapi.h>
#include <mdb/mdb_amd64util.h>
/*
* This array is used by the getareg and putareg entry points, and also by our
* register variable discipline.
*/
const mdb_tgt_regdesc_t mdb_amd64_kregs[] = {
{ NULL, 0, 0 }
};
void
{
mdb_printf("%%rax = 0x%0?p %15A %%r9 = 0x%0?p %A\n",
mdb_printf("%%rbx = 0x%0?p %15A %%r10 = 0x%0?p %A\n",
mdb_printf("%%rcx = 0x%0?p %15A %%r11 = 0x%0?p %A\n",
mdb_printf("%%rdx = 0x%0?p %15A %%r12 = 0x%0?p %A\n",
mdb_printf("%%rsi = 0x%0?p %15A %%r13 = 0x%0?p %A\n",
mdb_printf("%%rdi = 0x%0?p %15A %%r14 = 0x%0?p %A\n",
mdb_printf("%%r8 = 0x%0?p %15A %%r15 = 0x%0?p %A\n\n",
mdb_printf(" id=%u vip=%u vif=%u ac=%u vm=%u rf=%u nt=%u iopl=0x%x\n",
mdb_printf(" status=<%s,%s,%s,%s,%s,%s,%s,%s,%s>\n\n",
mdb_printf("%24s%%cs = 0x%04x\t%%ds = 0x%04x\t%%es = 0x%04x\n",
mdb_printf("%%trapno = 0x%x\t\t%%fs = 0x%04x\tfsbase = 0x%0?p\n",
mdb_printf(" %%err = 0x%x\t\t%%gs = 0x%04x\tgsbase = 0x%0?p\n",
}
int
{
struct {
} fr;
while (fp != 0) {
return (set_errno(EMDB_STKALIGN));
break;
}
return (0);
}
/*
* Determine the return address for the current frame. Typically this is the
* fr_savpc value from the current frame, but we also perform some special
* handling to see if we are stopped on one of the first two instructions of
* a typical function prologue, in which case %rbp will not be set up yet.
*/
int
{
GElf_Sym s;
char buf[1];
enum {
};
}
}
return (0);
}
return (-1); /* errno is set for us */
}
/*ARGSUSED*/
int
{
enum {
M_REX_LO = 0x40,
M_REX_HI = 0x4f
};
/*
* If the opcode is a near call with relative displacement, assume the
* displacement is a rel32 from the next instruction.
*/
if (curinstr == M_CALL_REL) {
return (0);
}
/* Skip the rex prefix, if any */
sizeof (curinstr))
return (-1); /* errno is set for us */
if (curinstr != M_CALL_REG) {
/* It's not a call */
}
return (-1); /* errno is set for us */
*p = npc;
return (0);
}
/*ARGSUSED*/
int
const mdb_tgt_gregset_t *gregs)
{
if (argc != 0) {
}
mdb_printf(")\n");
return (0);
}
int
const mdb_tgt_gregset_t *gregs)
{
if (argc != 0) {
}
mdb_printf(")\n");
return (0);
}