This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
GDB crashes when call member function having same name as a local pointer variable
- From: Neo <cjia at cse dot unl dot edu>
- To: gdb <gdb at sourceware dot org>
- Date: Fri, 02 Feb 2007 13:13:46 -0600
- Subject: GDB crashes when call member function having same name as a local pointer variable
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!