From patchwork Fri Jun 20 15:57:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 1598 Received: (qmail 8385 invoked by alias); 20 Jun 2014 15:58:11 -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 8309 invoked by uid 89); 20 Jun 2014 15:58:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 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; Fri, 20 Jun 2014 15:58:09 +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 s5KFw7eB003406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 20 Jun 2014 11:58:07 -0400 Received: from barimba.redhat.com (ovpn-113-103.phx2.redhat.com [10.3.113.103]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5KFw53H015561; Fri, 20 Jun 2014 11:58:07 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 03/14] add some missing ops to DWARF assembler Date: Fri, 20 Jun 2014 09:57:43 -0600 Message-Id: <1403279874-23781-4-git-send-email-tromey@redhat.com> In-Reply-To: <1403279874-23781-1-git-send-email-tromey@redhat.com> References: <1403279874-23781-1-git-send-email-tromey@redhat.com> This changes the DWARF assembler to allow comments in a location expression, and also adds support for a few new opcodes I needed. 2014-06-20 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/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 1483271..eac2c80 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -678,7 +678,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] @@ -689,6 +690,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] @@ -729,6 +731,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"