From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29894 invoked by alias); 11 Mar 2002 15:35:17 -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 29821 invoked from network); 11 Mar 2002 15:35:16 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.135.44) by sources.redhat.com with SMTP; 11 Mar 2002 15:35:16 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 99B553E0D; Mon, 11 Mar 2002 10:35:11 -0500 (EST) Message-ID: <3C8CCEAF.2030803@cygnus.com> Date: Mon, 11 Mar 2002 07:35:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.8) Gecko/20020210 X-Accept-Language: en-us MIME-Version: 1.0 To: Eli Zaretskii Cc: Andrew Morton , gdb@sources.redhat.com Subject: Re: bitwise operations on registers References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-03/txt/msg00096.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.) Yes, try: (gdb) p (void*)0 & 4 So, this a bug? Andrew