From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17488 invoked by alias); 12 Feb 2013 14:38:49 -0000 Received: (qmail 17410 invoked by uid 22791); 12 Feb 2013 14:38:48 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Feb 2013 14:38:40 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1U5H0J-0000CN-7b from Hafiz_Abid@mentor.com ; Tue, 12 Feb 2013 06:38:39 -0800 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 12 Feb 2013 06:38:38 -0800 Received: from abidh-ubunto1104 (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server (TLS) id 14.1.289.1; Tue, 12 Feb 2013 14:38:37 +0000 Date: Tue, 12 Feb 2013 14:38:00 -0000 From: Hafiz Abid Qadeer Subject: [patch] Missing UNOP_PLUS handler in c-lang.c To: , Message-ID: <1360679916.8583.0@abidh-ubunto1104> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-zLtpd7JRjRsagppx+IFG" 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: 2013-02/txt/msg00269.txt.bz2 --=-zLtpd7JRjRsagppx+IFG Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 945 Hi All, This patch fixes the problem shown in the session below. The fix was=20=20 originally created by Pedro a few years ago. I have updated it with the=20= =20 current code and regtested it. Is it OK? (gdb) set debug expression 1 (gdb) p +1 Dump of expression @ 0x8840908, before conversion to prefix form: Language c, 5 elements, 16 bytes each. Index Opcode Hex Value String Value 0 OP_LONG 40 (............... 1 142879800 8,.............. 2 BINOP_ADD 1 ................ 3 OP_LONG 40 (............... 4 UNOP_PLUS 70 F............... Dump of expression @ 0x8840908, after conversion to prefix form: Expression: `Invalid expression Regards, Abid gdb: 2013-02-12 Pedro Alves Hafiz Abid Qadeer * c-lang.c (c_op_print_tab): Add entry for UNOP_PLUS.= --=-zLtpd7JRjRsagppx+IFG Content-Type: text/x-patch; charset="us-ascii"; name="c-lang.patch" Content-Disposition: attachment; filename="c-lang.patch" Content-length: 438 diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 3a7d6f1..91cb21e 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -732,6 +732,7 @@ const struct op_print c_op_print_tab[] = {"/", BINOP_DIV, PREC_MUL, 0}, {"%", BINOP_REM, PREC_MUL, 0}, {"@", BINOP_REPEAT, PREC_REPEAT, 0}, + {"+", UNOP_PLUS, PREC_PREFIX, 0}, {"-", UNOP_NEG, PREC_PREFIX, 0}, {"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0}, {"~", UNOP_COMPLEMENT, PREC_PREFIX, 0}, --=-zLtpd7JRjRsagppx+IFG--