Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: jtc@redback.com (J.T. Conklin)
To: shaunj@gray-interfaces.com
Cc: gdb@sources.redhat.com
Subject: Re: printing enumerated values
Date: Fri, 06 Oct 2000 11:04:00 -0000	[thread overview]
Message-ID: <5m7l7lhmmr.fsf@jtc.redback.com> (raw)
In-Reply-To: <00100611524000.07740@ed>

>>>>> "Shaun" == Shaun Jackman <shaunj@gray-interfaces.com> writes:
Shaun> In GDB I get this...
Shaun> (gdb) p A
Shaun> $1 = 0
Shaun> (gdb) p B
Shaun> $2 = 1
Shaun> (gdb)

You need to let us know more about your environment.  From current
sources, on a NetBSD/i386 1.3 machine (ie i386 aout stabs) I get:

        (gdb) p A
        $1 = A
        (gdb) p B
        $2 = B
        (gdb) p (int) A
        $3 = 512
        (gdb) p (int) B
        $4 = 513

        --jtc

-- 
J.T. Conklin
RedBack Networks
From bje@redhat.com Sat Oct 07 08:02:00 2000
From: Ben Elliston <bje@redhat.com>
To: gdb@sources.redhat.com
Subject: Displaying structs
Date: Sat, 07 Oct 2000 08:02:00 -0000
Message-id: <Pine.LNX.4.21.0010080200430.19316-100000@moshpit.cygnus.com>
X-SW-Source: 2000-10/msg00024.html
Content-length: 523

Often, when debugging, I like to examine pointers to structures.  When
examining the struct instance that the pointer is addressing, I might use:

(gdb) print/x *ptr
 
If the struct has fields which are further pointers to structs, I have to
manually follow these pointers:
 
(gdb) print/x *ptr->next
or
(gdb) print/x *ptr->prev
 
Is there a way that GDB can recursively follow these (to some level)?  I am
guessing that there is enough debugging information for it to know that the
pointers are to meaningful types.

Ben


      reply	other threads:[~2000-10-06 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-06 10:52 Shaun Jackman
2000-10-06 11:04 ` J.T. Conklin [this message]

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=5m7l7lhmmr.fsf@jtc.redback.com \
    --to=jtc@redback.com \
    --cc=gdb@sources.redhat.com \
    --cc=shaunj@gray-interfaces.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