From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11173 invoked by alias); 6 Mar 2008 17:48:01 -0000 Received: (qmail 11151 invoked by uid 71); 6 Mar 2008 17:48:01 -0000 Resent-Date: 6 Mar 2008 17:48:01 -0000 Resent-Message-ID: <20080306174801.11149.qmail@sourceware.org> Resent-From: gdb-gnats@sources.redhat.com (GNATS Filer) Resent-To: nobody@sources.redhat.com Resent-Cc: gdb-prs@sources.redhat.com Resent-Reply-To: gdb-gnats@sources.redhat.com, tom.fowler@hotmail.co.uk Received: (qmail 10430 invoked by uid 48); 6 Mar 2008 17:45:16 -0000 Message-Id: <20080306174516.10429.qmail@sourceware.org> Date: Thu, 06 Mar 2008 17:48:00 -0000 From: tom.fowler@hotmail.co.uk Reply-To: tom.fowler@hotmail.co.uk To: gdb-gnats@sources.redhat.com X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: gdb/2426: Temporary breakpoint for "finish" command not cleaned up in MI mode Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2008-q1/txt/msg00070.txt.bz2 >Number: 2426 >Category: gdb >Synopsis: Temporary breakpoint for "finish" command not cleaned up in MI mode >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Mar 06 17:48:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: tom.fowler@hotmail.co.uk >Release: 6.7.1 >Organization: >Environment: Linux host, arm-elf remote target >Description: The "finish" command appears to work by setting a temporary breakpoint which is deleted immediately after it is triggered. Using my version of GDB in normal console mode this works as expected, but using the same executable in "--interpreter=mi" mode, the "finish" command leaves its breakpoint around to fire spuriously later on. Having looked into this a little, it seems to be a regression, in that the problem does not occur for an earlier version of GDB (v 6.0.x). >How-To-Repeat: In MI mode, debug a simple test case like: ---------- int x=0; void f2(void) { x=3; } void f1(void) { x=1; f2(); x=2; } int main() { for(;;) f1(); } ---------- Run into f2(), e.g.: > advance f2 Use "finish" to run until out of f2() > finish Now continue > cont In the error case execution will stop in f1 again (after the call to f2), next time the loop in main is executed. >Fix: Not clear to me. Comparing the source of mi-main.c for v6.0.x (working) against v6.7.1 (broken), the call to mi_execute_cli_command() has been replaced by a similar call to mi_cmd_interpreter_exec(), but unfortunately somehow the required call to do_cleanups() has been lost. >Release-Note: >Audit-Trail: >Unformatted: