From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16796 invoked by alias); 30 Nov 2009 20:31:21 -0000 Received: (qmail 16788 invoked by uid 22791); 30 Nov 2009 20:31:20 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from az33egw02.freescale.net (HELO az33egw02.freescale.net) (192.88.158.103) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Nov 2009 20:31:13 +0000 Received: from de01smr01.freescale.net (de01smr01.freescale.net [10.208.0.31]) by az33egw02.freescale.net (8.14.3/az33egw02) with ESMTP id nAUKVAlm014611; Mon, 30 Nov 2009 13:31:11 -0700 (MST) Received: from lds03-tx32 (lds03-tx32.am.freescale.net [10.83.20.63]) by de01smr01.freescale.net (8.13.1/8.13.0) with ESMTP id nAUKZaCi015119; Mon, 30 Nov 2009 14:35:37 -0600 (CST) Date: Mon, 30 Nov 2009 23:18:00 -0000 From: "Anmol P. Paralkar" To: ranjith kumar cc: gdb@sourceware.org Subject: Re: size of non local variables In-Reply-To: <31cff80d0911301216j36328837k673a2e1936f00eb1@mail.gmail.com> Message-ID: References: <31cff80d0911301216j36328837k673a2e1936f00eb1@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-IsSubscribed: yes 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 X-SW-Source: 2009-11/txt/msg00229.txt.bz2 On Tue, 1 Dec 2009, ranjith kumar wrote: > Hi, > I know that gdb will print non local variable names and file name in > which they are defined , > when we run 'info variables' command. > > Is it possible to print the size of the non local varibles also? > like the size of 'int global[100]' is 400bytes ...like that???? > > thanks in advance. Hello Ranjith Kumar, You could do: (gdb) print sizeof(global) $1 = 400 -- - that's an instance of GDB's functionality to evaluate expressions in the source language with the 'print' command. See 'Examining Data' in the User Manual: http://sourceware.org/gdb/current/onlinedocs/gdb/Data.html#Data Best Regards, Anmol.