This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Clear variable "coredump_var_addr" before using it on gdb.base/coredump-filter.exp
- From: Sergio Durigan Junior <sergiodj at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 26 Apr 2015 19:39:00 -0000
- Subject: [binutils-gdb] Clear variable "coredump_var_addr" before using it on gdb.base/coredump-filter.exp
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2d369d8e973f1507689a7f200c16e154ec5d6c79
commit 2d369d8e973f1507689a7f200c16e154ec5d6c79
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Sun Apr 26 15:34:29 2015 -0400
Clear variable "coredump_var_addr" before using it on gdb.base/coredump-filter.exp
This commit is a continuation of the fix committed on:
commit 8cd8f2f8ac49276437b7da37f275706ea1c1c925
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Mon Apr 13 02:40:08 2015 -0400
Rename variable "addr" to "coredump_var_addr" in gdb.base/coredump-filter.exp
Pedro pointed out that this fix was not complete, because the
testsuite could be run several times in a row (for example), which
means that it is not enough to just make the variable name unique: it
also needs to be cleared out if it is global.
This commit does that. It is actually just a commit made to make
things totally correct; this specific test does not fail if you run it
several times in a row.
gdb/testsuite/ChangeLog:
2015-04-26 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.base/coredump-filter.exp: Clear variable "coredump_var_addr"
before using it.
Diff:
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.base/coredump-filter.exp | 1 +
2 files changed, 6 insertions(+)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c37d84a..c620043 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-26 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * gdb.base/coredump-filter.exp: Clear variable "coredump_var_addr"
+ before using it.
+
2015-04-24 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.base/dump.exp: Add *.verilog files to all_files list. Add
diff --git a/gdb/testsuite/gdb.base/coredump-filter.exp b/gdb/testsuite/gdb.base/coredump-filter.exp
index f872de0..72f756a 100644
--- a/gdb/testsuite/gdb.base/coredump-filter.exp
+++ b/gdb/testsuite/gdb.base/coredump-filter.exp
@@ -170,6 +170,7 @@ gdb_test_multiple "print/x &main" "getting main's address" {
# Obtain the address of each variable that will be checked on each
# case.
+set coredump_var_addr ""
foreach item $all_anon_corefiles {
foreach name [list [lindex $item 3] [lindex $item 4]] {
set test "print/x $name"