From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4057 invoked by alias); 23 Feb 2006 18:20:25 -0000 Received: (qmail 4008 invoked by uid 22791); 23 Feb 2006 18:20:24 -0000 X-Spam-Check-By: sourceware.org Received: from mail.cae.wisc.edu (HELO mail.cae.wisc.edu) (144.92.13.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 23 Feb 2006 18:20:23 +0000 Received: from [128.104.187.108] (rincewind.neep.wisc.edu [128.104.187.108]) by mail.cae.wisc.edu (8.13.4/8.13.4) with ESMTP id k1NIKEhK011200 for ; Thu, 23 Feb 2006 12:20:14 -0600 (CST) Message-ID: <43FDFCDE.9090603@cae.wisc.edu> Date: Thu, 23 Feb 2006 18:21:00 -0000 From: Jason Kraftcheck User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: fix list/edit command in hook-stop Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-CAE-MailScanner-Information: Please contact security@engr.wisc.edu if this message contains a virus or has been corrupted in delivery. X-CAE-MailScanner: Found to be clean (benji) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00428.txt.bz2 An 'edit' or 'list' command in hook-stop doesn't work because the current sal isn't updated until after hook-stop is run. The following trivial change moves the invocation of hook-stop later in normal_stop. This won't fix the problem in all cases, as the sal is apparently only updated if print_stack_frame is called. But it doesn't hurt anything and works more often than without the change. 2006-02-23 Jason Kraftcheck * infrun.c (normal_stop): call hook-stop handler later, after current sal has been set. diff -upr gdb-6.4/gdb/infrun.c mod/gdb/infrun.c --- gdb-6.4/gdb/infrun.c 2005-11-14 09:35:16.000000000 -0600 +++ mod/gdb/infrun.c 2006-02-23 11:55:12.469293121 -0600 @@ -3038,12 +3038,6 @@ Further execution is probably impossible target_terminal_ours (); - /* Look up the hook_stop and run it (CLI internally handles problem - of stop_command's pre-hook not existing). */ - if (stop_command) - catch_errors (hook_stop_stub, stop_command, - "Error while running hook_stop:\n", RETURN_MASK_ALL); - if (!target_has_stack) { @@ -3140,6 +3134,12 @@ Further execution is probably impossible select_frame (get_current_frame ()); } + /* Look up the hook_stop and run it (CLI internally handles problem + of stop_command's pre-hook not existing). */ + if (stop_command) + catch_errors (hook_stop_stub, stop_command, + "Error while running hook_stop:\n", RETURN_MASK_ALL); + done: annotate_stopped (); observer_notify_normal_stop (stop_bpstat);