Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Atul Talesara" <atul.talesara@nevisnetworks.com>
To: <gdb@sources.redhat.com>
Subject: RE: Strange GDB behavior
Date: Mon, 26 Jul 2004 12:09:00 -0000	[thread overview]
Message-ID: <36993D449C7FA647BF43568E0793AB3E8C7A9E@nevis_pune_xchg.pune.nevisnetworks.com> (raw)

From your following command it is evident that "bnp" is a pointer to a
>structure. 
>
>>(gdb) p *bnp
>>$1 = {egp_next = 0x0, egp_sort_next = 0x0, egp_group = 0x82a45ef0,
>>  egp_flags = 138412032, egp_hisrcvdcaps = 0, egp_hiscaps = 0,
egp_conf
>= {
>>      action = 0 '\000'}, egpc_peer_as = 0, egpc_description = 0x0,
>>as_count
>>= 0,
>>    ---Type <return> to continue, or q <return> to quit---q
>>Quit
>
>
> Hence I think this statement is incorrect 
>> (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 
>
>(gdb) p bnp->as_count
Or equivalently:
p (*bnp).as_count

Regards,
Atul P Talesara 
---------------------------------------------------------- 
Be not afraid of life. Believe that life is worth living,
and your belief will help create the fact."
                                            - Henry James
----------------------------------------------------------


             reply	other threads:[~2004-07-26 11:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-26 12:09 Atul Talesara [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-07-26 11:58 Arun Vishwanathan
2004-07-26 13:00 ` Monika Chaddha
2004-07-26 11:34 True Sylvia
2004-07-26 11:48 ` Monika Chaddha
2004-07-26 13:15 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36993D449C7FA647BF43568E0793AB3E8C7A9E@nevis_pune_xchg.pune.nevisnetworks.com \
    --to=atul.talesara@nevisnetworks.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox