From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29022 invoked by alias); 3 May 2011 08:47:02 -0000 Received: (qmail 28998 invoked by uid 22791); 3 May 2011 08:47:01 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 May 2011 08:46:47 +0000 Received: from sunsite.mff.cuni.cz (localhost [127.0.0.1]) by sunsite.mff.cuni.cz (8.14.4/8.14.4) with ESMTP id p438kjHL027368 for ; Tue, 3 May 2011 10:46:45 +0200 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.14.4/8.14.4/Submit) id p438kjbH027366 for binutils@sources.redhat.com; Tue, 3 May 2011 10:46:45 +0200 Date: Tue, 03 May 2011 08:47:00 -0000 From: Jakub Jelinek To: binutils@sources.redhat.com Subject: [PATCH] readelf/objdump DW_OP_GNU_{{const,regval,deref}_type,convert,reinterpret} support Message-ID: <20110503084644.GP11563@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00029.txt.bz2 Hi! This patch adds support for typed DWARF stack ops that I've committed recently to GCC trunk. Tested on the http://gcc.gnu.org/ml/gcc-patches/2011-03/txt00136.txt testcase built by current trunk GCC, committed to binutils HEAD. 2011-05-03 Jakub Jelinek * dwarf.c (decode_location_expression): Handle DW_OP_GNU_const_type, DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert and DW_OP_GNU_reinterpret. --- binutils/dwarf.c.jj 2011-04-05 11:04:23.000000000 +0200 +++ binutils/dwarf.c 2011-04-05 11:52:27.000000000 +0200 @@ -1034,17 +1034,6 @@ decode_location_expression (unsigned cha display_block (data, uvalue); data += uvalue; break; - case DW_OP_GNU_entry_value: - uvalue = read_leb128 (data, &bytes_read, 0); - data += bytes_read; - printf ("DW_OP_GNU_entry_value: ("); - if (decode_location_expression (data, pointer_size, offset_size, - dwarf_version, uvalue, - cu_offset, section)) - need_frame_base = 1; - putchar (')'); - data += uvalue; - break; /* GNU extensions. */ case DW_OP_GNU_push_tls_address: @@ -1093,6 +1082,53 @@ decode_location_expression (unsigned cha data += offset_size + bytes_read; } break; + case DW_OP_GNU_entry_value: + uvalue = read_leb128 (data, &bytes_read, 0); + data += bytes_read; + printf ("DW_OP_GNU_entry_value: ("); + if (decode_location_expression (data, pointer_size, offset_size, + dwarf_version, uvalue, + cu_offset, section)) + need_frame_base = 1; + putchar (')'); + data += uvalue; + break; + case DW_OP_GNU_const_type: + uvalue = read_leb128 (data, &bytes_read, 0); + data += bytes_read; + printf ("DW_OP_GNU_const_type: <0x%s> ", + dwarf_vmatoa ("x", cu_offset + uvalue)); + uvalue = byte_get (data++, 1); + display_block (data, uvalue); + data += uvalue; + break; + case DW_OP_GNU_regval_type: + uvalue = read_leb128 (data, &bytes_read, 0); + data += bytes_read; + printf ("DW_OP_GNU_regval_type: %s (%s)", + dwarf_vmatoa ("u", uvalue), regname (uvalue, 1)); + uvalue = read_leb128 (data, &bytes_read, 0); + data += bytes_read; + printf (" <0x%s>", dwarf_vmatoa ("x", cu_offset + uvalue)); + break; + case DW_OP_GNU_deref_type: + printf ("DW_OP_GNU_deref_type: %ld", (long) byte_get (data++, 1)); + uvalue = read_leb128 (data, &bytes_read, 0); + data += bytes_read; + printf (" <0x%s>", dwarf_vmatoa ("x", cu_offset + uvalue)); + break; + case DW_OP_GNU_convert: + uvalue = read_leb128 (data, &bytes_read, 0); + data += bytes_read; + printf ("DW_OP_GNU_convert <0x%s>", + dwarf_vmatoa ("x", cu_offset + uvalue)); + break; + case DW_OP_GNU_reinterpret: + uvalue = read_leb128 (data, &bytes_read, 0); + data += bytes_read; + printf ("DW_OP_GNU_reinterpret <0x%s>", + dwarf_vmatoa ("x", cu_offset + uvalue)); + break; /* HP extensions. */ case DW_OP_HP_is_value: Jakub