From: Doug Evans <xdje42@gmail.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH][PR symtab/17855] Testcase for ada
Date: Sun, 22 Feb 2015 17:18:00 -0000 [thread overview]
Message-ID: <m3a905n9wg.fsf@sspiff.org> (raw)
In-Reply-To: <20150202034320.GG4525@adacore.com> (Joel Brobecker's message of "Mon, 2 Feb 2015 07:43:20 +0400")
Joel Brobecker <brobecker@adacore.com> writes:
> Hi Doug,
>
>> > This patch extends gdb.ada/exec_changed.exp to exercise PR 17855.
>> >
>> > 2015-01-18 Doug Evans <xdje42@gmail.com>
>> >
>> > 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 <xdje42@gmail.com>
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 <http://www.gnu.org/licenses/>.
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 <http://www.gnu.org/licenses/>.
procedure Second is
+
+ procedure Break_Me is
+ begin
+ null;
+ end Break_Me;
+
begin
- null;
+ Break_Me;
end Second;
prev parent reply other threads:[~2015-02-22 17:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-18 23:39 Doug Evans
2015-01-19 11:22 ` Joel Brobecker
2015-02-02 3:43 ` Joel Brobecker
2015-02-22 17:18 ` Doug Evans [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3a905n9wg.fsf@sspiff.org \
--to=xdje42@gmail.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).