From patchwork Tue Nov 18 16:53:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Taylor X-Patchwork-Id: 3791 Received: (qmail 5138 invoked by alias); 18 Nov 2014 16:53:21 -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 5098 invoked by uid 89); 18 Nov 2014 16:53:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mailuogwdur.emc.com Received: from mailuogwdur.emc.com (HELO mailuogwdur.emc.com) (128.221.224.79) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 18 Nov 2014 16:53:19 +0000 Received: from maildlpprd53.lss.emc.com (maildlpprd53.lss.emc.com [10.106.48.157]) by mailuogwprd54.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id sAIGrHBs015603 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 18 Nov 2014 11:53:17 -0500 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd54.lss.emc.com sAIGrHBs015603 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd54.lss.emc.com sAIGrHBs015603 Received: from mailsyshubprd51.lss.emc.com (mailsyshubprd51.lss.emc.com [10.106.48.26]) by maildlpprd53.lss.emc.com (RSA Interceptor) for ; Tue, 18 Nov 2014 11:52:29 -0500 Received: from usendtaylorx2l.lss.emc.com (usendtaylorx2l.lss.emc.com [10.243.10.188]) by mailsyshubprd51.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id sAIGr1NI011189 for ; Tue, 18 Nov 2014 11:53:01 -0500 Received: by usendtaylorx2l.lss.emc.com (Postfix, from userid 26043) id 575765DA7D6; Tue, 18 Nov 2014 11:53:01 -0500 (EST) Received: from usendtaylorx2l (localhost [127.0.0.1]) by usendtaylorx2l.lss.emc.com (Postfix) with ESMTP id 550095D778C for ; Tue, 18 Nov 2014 11:53:01 -0500 (EST) From: David Taylor To: gdb-patches@sourceware.org Subject: RFA 2/2 fix for bug with large structure offsets Date: Tue, 18 Nov 2014 11:53:01 -0500 Message-ID: <18845.1416329581@usendtaylorx2l> X-RSA-Classifications: DLM_1, public X-Sentrion-Hostname: mailuogwprd54.lss.emc.com X-IsSubscribed: yes Here is the testsuite part of the patch. 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 . 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 ======== 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 \