This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Rename variable "addr" to "coredump_var_addr" in gdb.base/coredump-filter.exp
- From: Sergio Durigan Junior <sergiodj at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 13 Apr 2015 06:45:32 -0000
- Subject: [binutils-gdb] Rename variable "addr" to "coredump_var_addr" in gdb.base/coredump-filter.exp
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8cd8f2f8ac49276437b7da37f275706ea1c1c925
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
This commit renames the global array variable "addr" to an unique name
"coredump_var_addr" in the test gdb.base/coredump-filter.exp. This is
needed because global arrays can have name conflicts between tests.
For example, this specific test was conflicting with dmsym.exp,
causing errors like:
ERROR: tcl error sourcing ../../../../../binutils-gdb/gdb/testsuite/gdb.base/dmsym.exp.
ERROR: can't set "addr": variable is array
while executing
"set addr "0x\[0-9a-zA-Z\]+""
(file "../../../../../binutils-gdb/gdb/testsuite/gdb.base/dmsym.exp" line 45)
invoked from within
"source ../../../../../binutils-gdb/gdb/testsuite/gdb.base/dmsym.exp"
("uplevel" body line 1)
invoked from within
"uplevel #0 source ../../../../../binutils-gdb/gdb/testsuite/gdb.base/dmsym.exp"
invoked from within
"catch "uplevel #0 source $test_file_name""
This problem was reported by Yao Qi at:
<https://sourceware.org/ml/gdb-patches/2015-04/msg00373.html>
Message-Id: <1428666671-12926-1-git-send-email-qiyaoltc@gmail.com>
gdb/testsuite/ChangeLog:
2015-04-13 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.base/coredump-filter.exp: Rename variable "addr" to
"coredump_var_addr" to avoid naming conflict with other testcases.
Diff:
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.base/coredump-filter.exp | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 775e6f9..fbb8bc8 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-13 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * gdb.base/coredump-filter.exp: Rename variable "addr" to
+ "coredump_var_addr" to avoid naming conflict with other testcases.
+
2015-04-10 Pedro Alves <palves@redhat.com>
* gdb.threads/signal-while-stepping-over-bp-other-thread.exp: Use
diff --git a/gdb/testsuite/gdb.base/coredump-filter.exp b/gdb/testsuite/gdb.base/coredump-filter.exp
index f3203be..8c94e94 100644
--- a/gdb/testsuite/gdb.base/coredump-filter.exp
+++ b/gdb/testsuite/gdb.base/coredump-filter.exp
@@ -38,7 +38,7 @@ proc do_save_core { filter_flag core ipid } {
}
proc do_load_and_test_core { core var working_var working_value } {
- global hex decimal addr
+ global hex decimal coredump_var_addr
set core_loaded [gdb_core_cmd "$core" "load core"]
if { $core_loaded == -1 } {
@@ -47,9 +47,9 @@ proc do_load_and_test_core { core var working_var working_value } {
}
# Access the memory the addresses point to.
- gdb_test "print/x *(char *) $addr($var)" "\(\\\$$decimal = <error: \)?Cannot access memory at address $hex\(>\)?" \
+ gdb_test "print/x *(char *) $coredump_var_addr($var)" "\(\\\$$decimal = <error: \)?Cannot access memory at address $hex\(>\)?" \
"printing $var when core is loaded (should not work)"
- gdb_test "print/x *(char *) $addr($working_var)" " = $working_value.*" \
+ gdb_test "print/x *(char *) $coredump_var_addr($working_var)" " = $working_value.*" \
"print/x *$working_var ( = $working_value)"
}
@@ -163,7 +163,7 @@ foreach item $all_anon_corefiles {
set test "print/x $name"
gdb_test_multiple $test $test {
-re " = \($hex\)\r\n$gdb_prompt $" {
- set addr($name) $expect_out(1,string)
+ set coredump_var_addr($name) $expect_out(1,string)
}
}
}