From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29923 invoked by alias); 16 Sep 2015 14:56:37 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 29912 invoked by uid 89); 16 Sep 2015 14:56:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 16 Sep 2015 14:56:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0D904295B1; Wed, 16 Sep 2015 10:56:34 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZszOqE2hp7sy; Wed, 16 Sep 2015 10:56:33 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id CC015295A9; Wed, 16 Sep 2015 10:56:33 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 1E5B040B5C; Wed, 16 Sep 2015 07:56:32 -0700 (PDT) Date: Wed, 16 Sep 2015 14:56:00 -0000 From: Joel Brobecker To: Senthil Kumar Selvaraj Cc: gdb@sourceware.org Subject: Re: sizeof evaluates expression to compute size? Message-ID: <20150916145632.GA19688@adacore.com> References: <20150916144109.GB14658@jaguar.corp.atmel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150916144109.GB14658@jaguar.corp.atmel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-09/txt/msg00011.txt.bz2 > Is it true that gdb evaluates the expression in a "print > sizeof(expression)" to figure out the size? Yes; it actually evaluates the entire expression (including the use of the sizeof operator). > For one expression on the ARM target > > print sizeof((char*)(s->m) The expression is incomplete; but with the expression you gave and assuming we're just missing a closing parenthesis, I don't see why it would need to allocate memory in the inferior. Perhaps you've found a bug. -- Joel