* GDB crashes when call member function having same name as a local pointer variable
@ 2007-02-02 19:14 Neo
2007-02-02 19:43 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Neo @ 2007-02-02 19:14 UTC (permalink / raw)
To: gdb
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!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-02 19:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-02 19:14 GDB crashes when call member function having same name as a local pointer variable Neo
2007-02-02 19:43 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox