From patchwork Sun Jan 18 23:38:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 4728 Received: (qmail 8006 invoked by alias); 18 Jan 2015 23:39:19 -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 7988 invoked by uid 89); 18 Jan 2015 23:39:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f42.google.com Received: from mail-pa0-f42.google.com (HELO mail-pa0-f42.google.com) (209.85.220.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 18 Jan 2015 23:39:17 +0000 Received: by mail-pa0-f42.google.com with SMTP id et14so35048623pad.1 for ; Sun, 18 Jan 2015 15:39:15 -0800 (PST) X-Received: by 10.68.138.161 with SMTP id qr1mr15993091pbb.90.1421624355330; Sun, 18 Jan 2015 15:39:15 -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 iv1sm9840540pbc.87.2015.01.18.15.39.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Jan 2015 15:39:14 -0800 (PST) From: Doug Evans To: brobecker@adacore.com, gdb-patches@sourceware.org Subject: [PATCH][PR symtab/17855] Testcase for ada Date: Sun, 18 Jan 2015 15:38:26 -0800 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hi. 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. diff --git a/gdb/testsuite/gdb.ada/exec_changed.exp b/gdb/testsuite/gdb.ada/exec_changed.exp index 5708558..8cac443 100644 --- a/gdb/testsuite/gdb.ada/exec_changed.exp +++ b/gdb/testsuite/gdb.ada/exec_changed.exp @@ -81,3 +81,27 @@ 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" + +# 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;