From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28509 invoked by alias); 29 Nov 2007 09:54:26 -0000 Received: (qmail 28499 invoked by uid 22791); 29 Nov 2007 09:54:25 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 29 Nov 2007 09:54:21 +0000 Received: (qmail 23823 invoked from network); 29 Nov 2007 09:54:19 -0000 Received: from unknown (HELO wind.local) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 29 Nov 2007 09:54:19 -0000 From: Vladimir Prus To: gdb-patches@sources.redhat.com Subject: Support constants for DW_AT_data_member_location Date: Thu, 29 Nov 2007 09:54:00 -0000 User-Agent: KMail/1.9.6 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_GxoTHDrpaO800Uv" Message-Id: <200711291254.14423.vladimir@codesourcery.com> 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: 2007-11/txt/msg00540.txt.bz2 --Boundary-00=_GxoTHDrpaO800Uv Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 237 DWARF standard allows DW_AT_data_member_location value to be a plain constant, but GDB does not. Is the following OK? - Volodya * dwarf2read.c (dwarf2_add_field): Allow the DW_AT_data_member_location to be of DW_FORM_udata form. --Boundary-00=_GxoTHDrpaO800Uv Content-Type: text/x-diff; charset="utf-8"; name="constant_data_member_location.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="constant_data_member_location.diff" Content-length: 517 --- dwarf2read.c (revision 123) +++ dwarf2read.c (local) @@ -3500,8 +3500,11 @@ dwarf2_add_field (struct field_info *fip attr = dwarf2_attr (die, DW_AT_data_member_location, cu); if (attr) { - FIELD_BITPOS (*fp) = - decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte; + if (attr->form == DW_FORM_udata) + FIELD_BITPOS (*fp) = 8 * DW_UNSND (attr); + else + FIELD_BITPOS (*fp) = + decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte; } else FIELD_BITPOS (*fp) = 0; --Boundary-00=_GxoTHDrpaO800Uv--