From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18049 invoked by alias); 11 Mar 2002 11:04:21 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 17793 invoked from network); 11 Mar 2002 11:04:14 -0000 Received: from unknown (HELO is.elta.co.il) (199.203.121.2) by sources.redhat.com with SMTP; 11 Mar 2002 11:04:14 -0000 Received: from is (is [199.203.121.2]) by is.elta.co.il (8.9.3/8.8.8) with SMTP id NAA17516; Mon, 11 Mar 2002 13:02:42 +0200 (IST) Date: Mon, 11 Mar 2002 03:04:00 -0000 From: Eli Zaretskii X-Sender: eliz@is To: Andrew Morton cc: gdb@sources.redhat.com Subject: Re: bitwise operations on registers In-Reply-To: <3C8C615E.5D4F0A6B@zip.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-03/txt/msg00095.txt.bz2 On Sun, 10 Mar 2002, Andrew Morton wrote: > (gdb) p $esp & 4 > Argument to arithmetic operation not a number or boolean. > (gdb) > > I don't seem to be able to perform the `&' and `|' arithmetic > operators against machine registers. "p $eax & 4" works for me. Doesn't it work for you? As for $esp, I think GDB knows that it's not a number, so try (gdb) p (int)$esp & 4 (I don't know whether the built-in knowledge GDB has about $esp should prevent it from working without the cast, though.)