From patchwork Sun Feb 22 17:17:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 5225 Received: (qmail 17547 invoked by alias); 22 Feb 2015 17:18:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 17535 invoked by uid 89); 22 Feb 2015 17:18:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KAM_FROM_URIBL_PCCC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pa0-f54.google.com Received: from mail-pa0-f54.google.com (HELO mail-pa0-f54.google.com) (209.85.220.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 22 Feb 2015 17:18:09 +0000 Received: by pabkx10 with SMTP id kx10so21553572pab.0 for ; Sun, 22 Feb 2015 09:18:08 -0800 (PST) X-Received: by 10.66.141.109 with SMTP id rn13mr12637326pab.113.1424625487847; Sun, 22 Feb 2015 09:18:07 -0800 (PST) Received: from seba.sebabeach.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id hu12sm20043730pdb.41.2015.02.22.09.18.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Feb 2015 09:18:07 -0800 (PST) From: Doug Evans To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [PATCH][PR symtab/17855] Testcase for ada References: <20150119112147.GB4041@adacore.com> <20150202034320.GG4525@adacore.com> Date: Sun, 22 Feb 2015 09:17:19 -0800 In-Reply-To: <20150202034320.GG4525@adacore.com> (Joel Brobecker's message of "Mon, 2 Feb 2015 07:43:20 +0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Joel Brobecker writes: > Hi Doug, > >> > This patch extends gdb.ada/exec_changed.exp to exercise PR 17855. >> > >> > 2015-01-18 Doug Evans >> > >> > PR symtab/17855 >> > * gdb.ada/exec_changed.exp: Add second test where symbol lookup cache >> > is read after symbols have been re-read. >> > * gdb.ada/exec_changed/first.adb (First): New procedure Break_Me. >> > * gdb.ada/exec_changed/second.adb (Second): Ditto. > > Would you pushing this patch? > > Thank you! Hi. I reverified this exercises and catches the bug. Here's what I committed. [modified from previous version to disable the main symbol cache] 2015-02-22 Doug Evans PR symtab/17855 * gdb.ada/exec_changed.exp: Add second test where symbol lookup cache is read after symbols have been re-read. * gdb.ada/exec_changed/first.adb (First): New procedure Break_Me. * gdb.ada/exec_changed/second.adb (Second): Ditto. diff --git a/gdb/testsuite/gdb.ada/exec_changed.exp b/gdb/testsuite/gdb.ada/exec_changed.exp index 5708558..3f439eb 100644 --- a/gdb/testsuite/gdb.ada/exec_changed.exp +++ b/gdb/testsuite/gdb.ada/exec_changed.exp @@ -81,3 +81,30 @@ if { [gdb_start_cmd] < 0 } { "second \\(\\) at .*second.adb.*" \ "start second" } + +# Try again, this time with just changing the file time of first. + +clean_restart "${binfile}$EXEEXT" + +# Ensure we don't accidently use the main symbol cache. +gdb_test_no_output "mt set symbol-cache-size 0" + +# Put something in the symbol lookup cache that will get looked up when +# starting after having re-read symbols. PR 17855. +gdb_breakpoint break_me + +gdb_test "shell touch ${binfile}$EXEEXT" ".*" "" +gdb_test "shell sleep 1" ".*" "" + +if { [gdb_start_cmd] < 0 } { + # PR 17855: At this point gdb may have crashed or gotten an internal + # error, but we still need to detect this. Just issue any simple command + # to verify gdb is still running. This will establish in gdb.log whether + # gdb is still running. + gdb_test_no_output "set \$check_gdb_running = 0" "check gdb running" + fail "start just first" +} else { + gdb_test "" \ + "first \\(\\) at .*first.adb.*" \ + "start just first" +} diff --git a/gdb/testsuite/gdb.ada/exec_changed/first.adb b/gdb/testsuite/gdb.ada/exec_changed/first.adb index 459a65e..184ef61 100644 --- a/gdb/testsuite/gdb.ada/exec_changed/first.adb +++ b/gdb/testsuite/gdb.ada/exec_changed/first.adb @@ -14,6 +14,12 @@ -- along with this program. If not, see . procedure First is + + procedure Break_Me is + begin + null; + end Break_Me; + begin - null; + Break_Me; end First; diff --git a/gdb/testsuite/gdb.ada/exec_changed/second.adb b/gdb/testsuite/gdb.ada/exec_changed/second.adb index 73fa342..36f9471 100644 --- a/gdb/testsuite/gdb.ada/exec_changed/second.adb +++ b/gdb/testsuite/gdb.ada/exec_changed/second.adb @@ -14,6 +14,12 @@ -- along with this program. If not, see . procedure Second is + + procedure Break_Me is + begin + null; + end Break_Me; + begin - null; + Break_Me; end Second;