From owner-svn-src-stable-7@FreeBSD.ORG Sat Aug 13 12:50:39 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF631106566B; Sat, 13 Aug 2011 12:50:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A43488FC19; Sat, 13 Aug 2011 12:50:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DCodQj016717; Sat, 13 Aug 2011 12:50:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCodFi016715; Sat, 13 Aug 2011 12:50:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131250.p7DCodFi016715@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224829 - stable/7/lib/libthread_db/arch/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:50:39 -0000 Author: marius Date: Sat Aug 13 12:50:39 2011 New Revision: 224829 URL: http://svn.freebsd.org/changeset/base/224829 Log: MFC: r224685 Implement Reviewed by: marcel Modified: stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c Directory Properties: stable/7/lib/libthread_db/ (props changed) Modified: stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c ============================================================================== --- stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c Sat Aug 13 12:50:38 2011 (r224828) +++ stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c Sat Aug 13 12:50:39 2011 (r224829) @@ -1,5 +1,6 @@ /* * Copyright (c) 2004 Marcel Moolenaar + * Copyright (c) 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,39 +28,63 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include #include #include +#include #include "libpthread_db.h" void -pt_reg_to_ucontext(const struct reg *r __unused, ucontext_t *uc __unused) +pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc) { + + memcpy(&uc->uc_mcontext, r, MIN(sizeof(uc->uc_mcontext), sizeof(*r))); } void -pt_ucontext_to_reg(const ucontext_t *uc __unused, struct reg *r __unused) +pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r) { + + memcpy(r, &uc->uc_mcontext, MIN(sizeof(uc->uc_mcontext), sizeof(*r))); } void -pt_fpreg_to_ucontext(const struct fpreg* r __unused, ucontext_t *uc __unused) +pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc) { + mcontext_t *mc = &uc->uc_mcontext; + + memcpy(mc->mc_fp, r->fr_regs, MIN(sizeof(mc->mc_fp), + sizeof(r->fr_regs))); + mc->mc_fsr = r->fr_fsr; + mc->mc_gsr = r->fr_gsr; + mc->mc_fprs |= FPRS_FEF; } void -pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused) +pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r) { + const mcontext_t *mc = &uc->uc_mcontext; + + if ((mc->mc_fprs & FPRS_FEF) != 0) { + memcpy(r->fr_regs, mc->mc_fp, MIN(sizeof(mc->mc_fp), + sizeof(r->fr_regs))); + r->fr_fsr = mc->mc_fsr; + r->fr_gsr = mc->mc_gsr; + } else + memset(r, 0, sizeof(*r)); } void pt_md_init(void) { + } int pt_reg_sstep(struct reg *reg __unused, int step __unused) { + return (0); }