From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26928 invoked by alias); 26 Jul 2004 11:58:32 -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 26919 invoked from network); 26 Jul 2004 11:58:27 -0000 Received: from unknown (HELO mail.pune.nevisnetworks.com) (203.124.166.179) by sourceware.org with SMTP; 26 Jul 2004 11:58:27 -0000 Received: from nevis_pune_xchg.pune.nevisnetworks.com (nevis_pune_xchg.pune.nevisnetworks.com [192.168.2.7]) by mail.pune.nevisnetworks.com (8.12.8/8.12.8) with ESMTP id i6QBwM0V031496 for ; Mon, 26 Jul 2004 17:28:22 +0530 content-class: urn:content-classes:message Subject: RE: Strange GDB behavior MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 26 Jul 2004 12:09:00 -0000 Message-ID: <36993D449C7FA647BF43568E0793AB3E8C7A9E@nevis_pune_xchg.pune.nevisnetworks.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Atul Talesara" To: X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) X-SW-Source: 2004-07/txt/msg00321.txt.bz2 >From your following command it is evident that "bnp" is a pointer to a >structure.=20 > >>(gdb) p *bnp >>$1 =3D {egp_next =3D 0x0, egp_sort_next =3D 0x0, egp_group =3D 0x82a45ef0, >> egp_flags =3D 138412032, egp_hisrcvdcaps =3D 0, egp_hiscaps =3D 0, egp_conf >=3D { >> action =3D 0 '\000'}, egpc_peer_as =3D 0, egpc_description =3D 0x0, >>as_count >>=3D 0, >> ---Type to continue, or q to quit---q >>Quit > > > Hence I think this statement is incorrect=20 >> (gdb) p *bnp->as_count *bnp->as_count is equivalent to *(bnp->as_count). This will take the value of as_count and try to dereference it, and you should typically get an error something like "Cannot access memory at address 0x..." and not "There is no member named ..." Nonetheless *bnp->as_count won't give you desired value. > >It should be=20 > >(gdb) p bnp->as_count Or equivalently: p (*bnp).as_count Regards, Atul P Talesara=20 ----------------------------------------------------------=20 Be not afraid of life. Believe that life is worth living, and your belief will help create the fact." - Henry James ----------------------------------------------------------