From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13436 invoked by alias); 2 Mar 2012 17:39:22 -0000 Received: (qmail 13426 invoked by uid 22791); 2 Mar 2012 17:39:21 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Mar 2012 17:39:08 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q22Hd7Cg024361 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Mar 2012 12:39:07 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q22Hd660024065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 2 Mar 2012 12:39:07 -0500 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: RFA: fix PR breakpoints/13776 References: <878vjmswbr.fsf@fleche.redhat.com> <4F4E835A.5070102@redhat.com> Date: Fri, 02 Mar 2012 17:39:00 -0000 In-Reply-To: <4F4E835A.5070102@redhat.com> (Pedro Alves's message of "Wed, 29 Feb 2012 19:58:18 +0000") Message-ID: <87sjhqc37p.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg00091.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> If you do this before exit_inferior, then the Pedro> breakpoint_init_inferior change is wrong, because the Pedro> clear_thread_inferior_resources will touch already released memory. Ugh, thanks for noticing. I should have tried this. Pedro> WDTY? I think the patch is fine. Pedro> 2012-02-29 Tom Tromey Pedro> Pedro Alves ... but it is silly to put my name on it since I think I wrote one line in the result :) Here is a test case for the bug. I can commit it first if you'd prefer. Tom 2012-03-02 Tom Tromey * gdb.base/nextoverexit.c: New file. * gdb.base/nextoverexit.exp: New file. diff --git a/gdb/testsuite/gdb.base/nextoverexit.c b/gdb/testsuite/gdb.base/nextoverexit.c new file mode 100644 index 0000000..125d68f --- /dev/null +++ b/gdb/testsuite/gdb.base/nextoverexit.c @@ -0,0 +1,23 @@ +/* Copyright 2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include + +int +main (void) +{ + exit (0); +} diff --git a/gdb/testsuite/gdb.base/nextoverexit.exp b/gdb/testsuite/gdb.base/nextoverexit.exp new file mode 100644 index 0000000..fecbd58 --- /dev/null +++ b/gdb/testsuite/gdb.base/nextoverexit.exp @@ -0,0 +1,33 @@ +# Copyright 2012 Free Software Foundation, Inc. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set testfile "nextoverexit" +set executable $testfile +set srcfile $testfile.c +set binfile $objdir/$subdir/$testfile + +if {[prepare_for_testing $testfile.exp $testfile $testfile.c]} { + return -1 +} + +if {![runto_main]} { + return -1 +} + +# Make sure we do not see any warnings. +gdb_test_multiple "next" "next over exit" { + -re "$inferior_exited_re normally.\[\r\n\]+$gdb_prompt $" { + pass "next over exit" + } +}