From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29236 invoked by alias); 26 Jul 2010 20:24:54 -0000 Received: (qmail 29227 invoked by uid 22791); 26 Jul 2010 20:24:53 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_SV,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Jul 2010 20:24:48 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6QKOlHr032099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 26 Jul 2010 16:24:47 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6QKOk73029619; Mon, 26 Jul 2010 16:24:46 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o6QKOkwI008616; Mon, 26 Jul 2010 16:24:46 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id B8F003792BB; Mon, 26 Jul 2010 14:24:45 -0600 (MDT) From: Tom Tromey To: gdb-patches@sourceware.org Subject: FYI: fix small regression with gcc trunk Date: Mon, 26 Jul 2010 20:24:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00400.txt.bz2 I'm checking this in. I recently ran the gdb test suite against GCC svn trunk. This revealed a number of regressions, mostly little test case bugs. This patch fixes one regression that appears in gdb itself. GCC changed how it emits TLS references, to fix a bug. This caused "info address" output to change, causing a gdb test suite regression. Built and regtested on x86-64 (compile farm). I also tested the appropriate test case locally with both the new and old GCC. Tom 2010-07-26 Tom Tromey * dwarf2loc.c (locexpr_describe_location_piece): Also recognize TLS with DW_OP_const4u or DW_OP_const8u. Index: dwarf2loc.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2loc.c,v retrieving revision 1.95 diff -u -r1.95 dwarf2loc.c --- dwarf2loc.c 13 Jul 2010 15:09:03 -0000 1.95 +++ dwarf2loc.c 26 Jul 2010 20:22:24 -0000 @@ -2016,15 +2016,19 @@ DW_AT_location : 10 byte block: 3 4 0 0 0 0 0 0 0 e0 (DW_OP_addr: 4; DW_OP_GNU_push_tls_address) - + 0x3 is the encoding for DW_OP_addr, which has an operand as long as the size of an address on the target machine (here is 8 - bytes). 0xe0 is the encoding for DW_OP_GNU_push_tls_address. - The operand represents the offset at which the variable is within - the thread local storage. */ + bytes). Note that more recent version of GCC emit DW_OP_const4u + or DW_OP_const8u, depending on address size, rather than + DW_OP_addr. 0xe0 is the encoding for + DW_OP_GNU_push_tls_address. The operand represents the offset at + which the variable is within the thread local storage. */ else if (data + 1 + addr_size < end - && data[0] == DW_OP_addr + && (data[0] == DW_OP_addr + || (addr_size == 4 && data[0] == DW_OP_const4u) + || (addr_size == 8 && data[0] == DW_OP_const8u)) && data[1 + addr_size] == DW_OP_GNU_push_tls_address && piece_end_p (data + 2 + addr_size, end)) {