From: David Taylor <dtaylor@emc.com>
To: gdb-patches@sourceware.org
Subject: RFA 2/2 fix for bug with large structure offsets
Date: Tue, 18 Nov 2014 16:53:00 -0000 [thread overview]
Message-ID: <18845.1416329581@usendtaylorx2l> (raw)
Here is the testsuite part of the patch.
diff --git a/gdb/testsuite/gdb.base/Makefile.in b/gdb/testsuite/gdb.base/Makefile.in
index dda3169..d828d35 100644
--- a/gdb/testsuite/gdb.base/Makefile.in
+++ b/gdb/testsuite/gdb.base/Makefile.in
@@ -43,7 +43,7 @@ EXECUTABLES = a2-run advance all-types annota1 annota1-watch_thread_num \
watch-vfork watch_thread_num watchpoint watchpoint-cond-gone \
watchpoint-hw watchpoint-hw-hit-once watchpoint-solib watchpoints \
wchar whatis whatis-exp catch-syscall \
- pr10179 gnu_vector
+ pr10179 gnu_vector offsets
MISCELLANEOUS = coremmap.data dprintf-pendshr.sl ../foobar.baz fixsectshr.sl \
pendshr.sl shreloc1.sl shreloc2.sl twice-tmp.c \
There are also two small new files; they did not show up in the diff.
Here they are:
====== start of gdb/testsuite/gdb.base/offsets.c ========
struct big_struct
{
char first[0x10000000 + 16];
long second;
} big_struct;
int
main (int argc, char *argv[])
{
return (0);
}
====== end of gdb/testsuite/gdb.base/offsets.c ========
and
====== start of gdb/testsuite/gdb.base/offsets.exp ========
# Test big offsets
# Copyright (c) 2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
standard_testfile offsets.c
if { [prepare_for_testing ${testfile}.exp $testfile $srcfile] } {
untested offsets.exp
return -1
}
set test "print &big_struct test"
gdb_test_multiple "print &big_struct" "$test" {
-re "\\$\[0-9\]* = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" {
set addr1 $expect_out(1,string)
pass "$test ($addr1)"
}
timeout {
fail "$test (timeout)"
}
}
set test "print &big_struct.second test"
gdb_test_multiple "print &big_struct.second" "$test" {
-re "\\$\[0-9\]* = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" {
set addr2 $expect_out(1,string)
pass "$test ($addr2)"
}
timeout {
fail "$test (timeout)"
}
}
if {[expr $addr2 - $addr1] == [expr 0x10000000 + 16]} {
pass "big offsets"
} else {
fail "big offsets"
}
====== end of gdb/testsuite/gdb.base/offsets.exp ========
reply other threads:[~2014-11-18 16:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=18845.1416329581@usendtaylorx2l \
--to=dtaylor@emc.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