Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'arguments': 0.05; 'raised.': 0.09; 'subject:Function': 0.09; 'pm,': 0.10; 'exception': 0.12; 'debugging': 0.14; 'wrote:': 0.14; 'exceptions.': 0.16; 'extracting': 0.16; 'frames': 0.16; 'trace.': 0.16; 'unhandled': 0.16; 'stack': 0.16; 'cc:addr:python-list': 0.17; 'tue,': 0.17; 'simpler': 0.19; 'trace': 0.19; 'header:In- Reply-To:1': 0.21; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; "they've": 0.23; 'received:209.85.161.46': 0.23; 'received:mail- fx0-f46.google.com': 0.23; "doesn't": 0.25; 'received:209.85.161': 0.26; 'message-id:@mail.gmail.com': 0.28; 'thanks': 0.28; 'subject:?': 0.29; 'cc:addr:python.org': 0.30; 'tool.': 0.30; 'received:google.com': 0.37; 'received:209.85': 0.37; 'could': 0.38; 'but': 0.38; 'subject:: ': 0.38; 'received:209': 0.39; 'getting': 0.40; 'custom': 0.60; 'generate': 0.60; 'your': 0.60; 'locals': 0.84; 'traceback,': 0.84; 'subject:call': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=IraYWrRqMVrXDpN4cq5JqD+tBw0W5ML1dKCooaZ3id0=; b=DIgo7eYuePh+7PkIJq+z0sFYjJjvVwBPf7MdMB74jub3f8mLgknvd/Wz9Ywr/yPJrD p52Di5O7N6CKLWz/O89Yxwv1ExE4hyITmoD2+f82KT1uESy/lfk7alZxbBS4ezy1hdql /kMiiNqXJ2NC+Oe+f4h9W7Rv0MsB+OJZoLGMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=TqkEXr0HpV9RcJNiIf3RKK+IXtcQ1o9EC8rIlvperAeX+23G5ez2pw2yDUNDrYYfY8 lUdq1Jw0fUtjWqbgBLH1bvj0qjTed0NvNxQRV/2XNJtCh57OhPBuaKfxSq/xoCxeGL4m 2PdelBzAL36pHqjWbq3E1/kau3e2/MElhEvqU= MIME-Version: 1.0 In-Reply-To: <6c3c9ab9-7880-4988-8258-8f8b2d4d7f72@m21g2000yqc.googlegroups.com> References: <9d344c45-8017-4c80-9a17-bc7accd81047@l26g2000yqm.googlegroups.com> <9578lmFl76U1@mid.individual.net> <6c3c9ab9-7880-4988-8258-8f8b2d4d7f72@m21g2000yqc.googlegroups.com> From: Ian Kelly Date: Tue, 7 Jun 2011 13:52:30 -0600 Subject: Re: Function call arguments in stack trace? To: Dun Peal Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307476383 news.xs4all.nl 49179 [::ffff:82.94.164.166]:43126 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7178 On Tue, Jun 7, 2011 at 1:31 PM, Dun Peal wrote: > On Jun 7, 1:23=A0pm, Neil Cerutti wrote: >> Use pdb. > > Neil, thanks for the tip; `pdb` is indeed a great debugging tool. > > Still, it doesn't obviate the need for arguments in the stack trace. Your program could use sys.excepthook to generate a custom stack trace for unhandled exceptions. All the stack frames are available from the traceback, but extracting the arguments would be tricky, and getting the original arguments would be impossible if they've been reassigned prior to the exception being raised. It would be simpler just to dump all the locals in the frame.