From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27620 invoked by alias); 22 Mar 2002 01:11:22 -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 27612 invoked from network); 22 Mar 2002 01:11:21 -0000 Received: from unknown (HELO hotmail.com) (216.33.149.7) by sources.redhat.com with SMTP; 22 Mar 2002 01:11:21 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 21 Mar 2002 17:11:21 -0800 Received: from 65.32.208.115 by lw4fd.law4.hotmail.msn.com with HTTP; Fri, 22 Mar 2002 01:11:21 GMT X-Originating-IP: [65.32.208.115] From: "Salman Khilji" To: gdb@sources.redhat.com Bcc: Subject: Re: Static variables incorrect address Date: Thu, 21 Mar 2002 17:11:00 -0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 22 Mar 2002 01:11:21.0248 (UTC) FILETIME=[7A431A00:01C1D13E] X-SW-Source: 2002-03/txt/msg00186.txt.bz2 I would tend to agree with Mike. I have used this feature with lots of different cases. It works very nicely with both C and C++. plus, you dont' even have to issue the run command. You can lookup the address right after the startup. There was once a problem with static member variables like these inside C++ namepsaces. But that was fixed in 5.1 Salman >From: Michael Snyder >To: Kiranmaye Gannabathula >CC: "'gdb@sources.redhat.com'" >Subject: Re: Static variables incorrect address >Date: Thu, 21 Mar 2002 16:12:53 -0800 > >Kiranmaye Gannabathula wrote: > > > > Hello, > > I have a problem with the global static variables in gdb. > > > > For a C program as below > > > > static int Data = 9; > > > > int Func1(void) > > { > > return Data; > > } > > > > if i compile this with debug info and run it under gdb, when i >breakpoint on > > the variable Data and try to print its value i get some value and > > if i look at the address > > p /x Data > > i get some invalid address. > >I believe you want to say "p /x &Data". >Otherwise you will be looking at memory at an address >determined by the value of the variable "Data". _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com