NetBSD Problem Report #38969
From simonb@thistledown.com.au Tue Jun 17 06:24:13 2008
Return-Path: <simonb@thistledown.com.au>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id ACEAD63B842
for <gnats-bugs@gnats.NetBSD.org>; Tue, 17 Jun 2008 06:24:13 +0000 (UTC)
Message-Id: <20080617062412.5FE9DAFD04@thoreau.thistledown.com.au>
Date: Tue, 17 Jun 2008 16:24:12 +1000 (EST)
From: Simon Burge <simonb@NetBSD.org>
Reply-To: Simon Burge <simonb@NetBSD.org>
To: gnats-bugs@gnats.NetBSD.org
Subject: ddb backtrace on amd64 doesn't show function arguments
X-Send-Pr-Version: 3.95
>Number: 38969
>Category: port-amd64
>Synopsis: ddb backtrace on amd64 doesn't show function arguments
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: port-amd64-maintainer
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Jun 17 06:25:00 +0000 2008
>Closed-Date: Fri Nov 06 22:47:15 +0000 2009
>Last-Modified: Fri Nov 06 22:47:15 +0000 2009
>Originator: Simon Burge
>Release: Any?
>Organization:
>Environment:
Architecture: amd64
Machine: amd64
>Description:
ddb's "backtrace" command doesn't show any function arguments
on an amd64 machine. One example is:
db{5}> bt
breakpoint() at netbsd:breakpoint+0x5
panic() at netbsd:panic+0x260
__kernassert() at netbsd:__kernassert+0x2d
uipc_usrreq() at netbsd:uipc_usrreq+0x850
sosend() at netbsd:sosend+0x506
soo_write() at netbsd:soo_write+0x2d
dofilewrite() at netbsd:dofilewrite+0x81
sys_write() at netbsd:sys_write+0x72
syscall() at netbsd:syscall+0x9a
>How-To-Repeat:
Type "bt" at a ddb prompt on an amd64 machine.
>Fix:
Not sure. Just changing amd64/md64/db_trace.c:db_numargs()
to return "6" instead of "0" didn't look to provide realistic
function args at a glance - I think this is similar to
sparc/mips/<other-register-args-archs> do? Maybe tempt the
compiler somehow to save function arguments on the stack?
>Release-Note:
>Audit-Trail:
From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: port-amd64/38969: ddb backtrace on amd64 doesn't show function arguments
Date: Wed, 18 Jun 2008 22:32:37 +0100
On Tue, Jun 17, 2008 at 06:25:00AM +0000, Simon Burge wrote:
> >Number: 38969
> >Category: port-amd64
> >Synopsis: ddb backtrace on amd64 doesn't show function arguments
>
> >Fix:
> Not sure. Just changing amd64/md64/db_trace.c:db_numargs()
> to return "6" instead of "0" didn't look to provide realistic
> function args at a glance - I think this is similar to
> sparc/mips/<other-register-args-archs> do? Maybe tempt the
> compiler somehow to save function arguments on the stack?
The problem is that the first 6? arguments are passed in registers
so are very hard to locate.
David
--
David Laight: david@l8s.co.uk
From: Simon Burge <simonb@NetBSD.org>
To: David Laight <david@l8s.co.uk>
Cc: gnats-bugs@NetBSD.org, port-amd64-maintainer@netbsd.org,
gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/38969: ddb backtrace on amd64 doesn't show function arguments
Date: Thu, 19 Jun 2008 15:09:54 +1000
David Laight wrote:
> On Tue, Jun 17, 2008 at 06:25:00AM +0000, Simon Burge wrote:
> > >Number: 38969
> > >Category: port-amd64
> > >Synopsis: ddb backtrace on amd64 doesn't show function arguments
> >
> > >Fix:
> > Not sure. Just changing amd64/md64/db_trace.c:db_numargs()
> > to return "6" instead of "0" didn't look to provide realistic
> > function args at a glance - I think this is similar to
> > sparc/mips/<other-register-args-archs> do? Maybe tempt the
> > compiler somehow to save function arguments on the stack?
>
> The problem is that the first 6? arguments are passed in registers
> so are very hard to locate.
That's what I meant by "tempt the compiler ...". Sure it'd be a
performance hit, but if there was some flag to say "save every arg on
the stack on each function entry" that'd make backtraces much more
useful.
Cheers,
Simon.
State-Changed-From-To: open->closed
State-Changed-By: dsl@NetBSD.org
State-Changed-When: Fri, 06 Nov 2009 22:47:15 +0000
State-Changed-Why:
This isn't going to change....
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.