From patchwork Sun Nov 23 19:27:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 3863 Received: (qmail 15385 invoked by alias); 23 Nov 2014 19:27:47 -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 15319 invoked by uid 89); 23 Nov 2014 19:27:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 23 Nov 2014 19:27:44 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sANJRhcN014163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sun, 23 Nov 2014 14:27:43 -0500 Received: from host1.jankratochvil.net (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sANJRgPU016415 for ; Sun, 23 Nov 2014 14:27:42 -0500 Subject: [PATCH v4 03/14] add some missing ops to DWARF assembler From: Jan Kratochvil To: gdb-patches@sourceware.org Date: Sun, 23 Nov 2014 20:27:41 +0100 Message-ID: <20141123192741.32193.22976.stgit@host1.jankratochvil.net> In-Reply-To: <20141123192713.32193.57150.stgit@host1.jankratochvil.net> References: <20141123192713.32193.57150.stgit@host1.jankratochvil.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-IsSubscribed: yes From: Tom Tromey This changes the DWARF assembler to allow comments in a location expression, and also adds support for a few new opcodes I needed. 2014-10-07 Tom Tromey * lib/dwarf.exp (_location): Ignore blank lines. Allow comments. Handle DW_OP_pick, DW_OP_skip, DW_OP_bra. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/lib/dwarf.exp | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6bbd72b..7567785 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-10-07 Tom Tromey + + * lib/dwarf.exp (_location): Ignore blank lines. Allow comments. + Handle DW_OP_pick, DW_OP_skip, DW_OP_bra. + 2014-11-22 Yao Qi * gdb.trace/entry-values.c: Remove asms. diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 778ad1c..72153ec 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -803,7 +803,8 @@ namespace eval Dwarf { variable _cu_offset_size foreach line [split $body \n] { - if {[lindex $line 0] == ""} { + # Ignore blank lines, and allow embedded comments. + if {[lindex $line 0] == "" || [regexp -- {^[ \t]*#} $line]} { continue } set opcode [_map_name [lindex $line 0] _OP] @@ -814,6 +815,7 @@ namespace eval Dwarf { _op .${_cu_addr_size}byte [lindex $line 1] } + DW_OP_pick - DW_OP_const1u - DW_OP_const1s { _op .byte [lindex $line 1] @@ -854,6 +856,11 @@ namespace eval Dwarf { _op .uleb128 [lindex $line 2] } + DW_OP_skip - + DW_OP_bra { + _op .2byte [lindex $line 1] + } + DW_OP_GNU_implicit_pointer { if {[llength $line] != 3} { error "usage: DW_OP_GNU_implicit_pointer LABEL OFFSET"