Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Neo <cjia@cse.unl.edu>
To: gdb <gdb@sourceware.org>
Subject: GDB crashes when call member function having same name as a local  pointer variable
Date: Fri, 02 Feb 2007 19:14:00 -0000	[thread overview]
Message-ID: <45C38D6A.40204@cse.unl.edu> (raw)

hi,

I am wondering if it would be a bug. The following is the tiny program I 
am using to test. This test failed on both gdb 6.5 and 6.6

=========================
#include <stdio.h>

class foo {
  private:
    int _data;
  public:
    int data() { return _data; }
    void bar();
};

void
foo::bar()
{
  char * data = NULL;
  printf("Can you do p data()?\n");   // When let gdb breaks on this 
statement, "p data()" will cause segmentation fault.
}

int main(int argc, char ** argv)
{
  foo obj;
  obj.bar();
  return 0;
}
===================
Do we need to provide some hints to the user such as popping up 
"this->data()" ?

Thanks,
Neo

-- 
I would remember that if researchers were not ambitious
probably today we haven't the technology we are using!


             reply	other threads:[~2007-02-02 19:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02 19:14 Neo [this message]
2007-02-02 19:43 ` 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=45C38D6A.40204@cse.unl.edu \
    --to=cjia@cse.unl.edu \
    --cc=gdb@sourceware.org \
    /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