From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: jan Newsgroups: gmane.emacs.help Subject: Re: edebug question - context of calling function Date: 17 Oct 2003 11:35:57 -0700 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1066354130 28780 80.91.224.253 (17 Oct 2003 01:28:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Oct 2003 01:28:50 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 17 03:28:48 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AAJQ8-0006Xg-00 for ; Fri, 17 Oct 2003 03:28:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AAJNe-0000if-S7 for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Oct 2003 21:26:14 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AAJNT-0000iE-2A for help-gnu-emacs@gnu.org; Thu, 16 Oct 2003 21:26:03 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AAJMx-0000gs-7U for help-gnu-emacs@gnu.org; Thu, 16 Oct 2003 21:26:02 -0400 Original-Received: from [210.50.76.52] (helo=smtp02.syd.iprimus.net.au) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AAJMw-0000g4-Nx for help-gnu-emacs@gnu.org; Thu, 16 Oct 2003 21:25:30 -0400 Original-Received: from ABE (210.50.172.182) by smtp02.syd.iprimus.net.au (7.0.020) id 3F89B4D800189986; Fri, 17 Oct 2003 11:25:26 +1000 Original-To: "David Vanderschel" In-Reply-To: Original-Lines: 42 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13276 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13276 "David Vanderschel" writes: > I sometimes put a source breakpoint in my code to catch a particular > error condition. When such a conditional breakpoint fires, the > actual problem, though recognized in the called function, is often > attributable to the calling function. What I want to do then is to > look around at the state of the calling function at the time it > called the function which invoked edebug. I can instrument the > calling function; but, when in the debugger, I cannot see how to pop > the context stack so that I can look around at the variables in the > calling program. What am I missing? If I understand you correctly, you want to walk up the stack and look at the local variable in the functions along the way. I had a quick look and both edebug and the standard emacs debugger seem to be missing this feature. However, it may not be necessary because elisp is a dynamically scoped language, for example: (defun function1 () (let ((a 1) (b 2)) (list a b (function2) a b))) (defun function2 () (let ((b 3) (c 4)) (edebug) (setq a 5 b 6) (+ b c))) (function1) when you hit the (edebug) breakpoint in function2 you can just eval `a' because it is still in scope. You probably already knew this and want to inspect variables like `b' which have been shadowed by the let in function2. In this case, I would just move the breakpoint up to the calling function and make the condition on it more clever so it only fires under the circumstances you want. -- jan