public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
To: Vladimir Prus <ghost@cs.msu.su>
Cc: gdb@sources.redhat.com
Subject: Re: "info locals" -- is variable initialized
Date: Fri, 02 Sep 2005 09:28:00 -0000	[thread overview]
Message-ID: <1125653235.9801.18.camel@localhost.localdomain> (raw)
In-Reply-To: <df90k9$tm7$1@sea.gmane.org>


> 
> When entering this function, KDevelop asks gdb via "info locals" what locals
> vars are there. But, gdb reports all variables, even though at the function
> entry 'i2' is not initialized (or, from C++ point of view, not even visible
> yet). For pretty priting 'i2', I have to evaluate 'i2.prettyURL(0)', which
> will just crash. I can use "set unwindonsignal on", but generally, calling
> methods on uninitialized object can damage random memory.

GDB puts a breakpoint after the prologue of a function. Which means that
all locals in scope have been created / allocated space for . Hence you
would see i2 , right ?

cheers
Ramana


  reply	other threads:[~2005-09-02  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-02  7:58 Vladimir Prus
2005-09-02  9:28 ` Ramana Radhakrishnan [this message]
2005-09-02  9:57   ` Vladimir Prus
2005-09-02 13:13     ` Daniel Jacobowitz
2005-09-02 13:19       ` Vladimir Prus
2005-09-02 13:21         ` Daniel Jacobowitz
2005-09-02 13:28           ` Vladimir Prus

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=1125653235.9801.18.camel@localhost.localdomain \
    --to=ramana.radhakrishnan@codito.com \
    --cc=gdb@sources.redhat.com \
    --cc=ghost@cs.msu.su \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).