From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16804 invoked by alias); 12 Jul 2011 18:56:09 -0000 Received: (qmail 16792 invoked by uid 22791); 12 Jul 2011 18:56:08 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iw0-f169.google.com (HELO mail-iw0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jul 2011 18:55:54 +0000 Received: by iwn8 with SMTP id 8so5727502iwn.0 for ; Tue, 12 Jul 2011 11:55:53 -0700 (PDT) Received: by 10.42.28.198 with SMTP id o6mr206516icc.415.1310496945313; Tue, 12 Jul 2011 11:55:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.213.134 with HTTP; Tue, 12 Jul 2011 11:55:25 -0700 (PDT) In-Reply-To: References: <201107120117.42796.vapier@gentoo.org> From: Mike Frysinger Date: Tue, 12 Jul 2011 19:25:00 -0000 Message-ID: Subject: Re: PATCH To: Matt Rice Cc: Abhijit Halder , gdb-patches@sourceware.org, Tom Tromey Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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: 2011-07/txt/msg00309.txt.bz2 On Tue, Jul 12, 2011 at 13:31, Matt Rice wrote: > On Tue, Jul 12, 2011 at 8:59 AM, Mike Frysinger wrote: >> On Tue, Jul 12, 2011 at 03:15, Abhijit Halder wrote: >>> since the pipe (|) symbol is also a c operator, it will confuse gdb. >>> Even if we use |& we may land up into a trouble situation. >>> >>> Breakpoint 1, main (argc=3D1, argv=3D0x7fffb6e506a8) at test.c:15 >>> 15 =A0 =A0 =A0 =A0 =A0return (SUCCESS) ; >>> (gdb) p argc|&*argc >>> $1 =3D 1 >>> (gdb) p argc |& *argc >>> $2 =3D 1 >>> (gdb) >> >> i'm not seeing this. =A0on an unmodified gdb-7.2, i get: >> (gdb) p g >> $1 =3D 0xa >> (gdb) p g |& g >> Argument to arithmetic operation not a number or boolean. >> >> so what am i missing ? > > this one should work. > > p 0 |& argv[argc] - &argv[0] oh, i see now. creative spacing. "...|& FOO" is taking the address of FOO. hrm, this would also mean ">&" wont work as that could be a comparison against the address of a variable. ">|" might work. it's not as intuitive, but it's muscle memory in the end and people will learn soon enough :P. -mike