Article View: gnu.gdb.bug
Article #551gdb bug or g++ bug
From: Xiannong Meng
Date: Fri, 11 Dec 1992 21:19
Date: Fri, 11 Dec 1992 21:19
173 lines
5856 bytes
5856 bytes
I cannot set up break point in gdb using method names. I read all the
documents, I've asked a few people, I've posted a note in gdb.bug. No clue was
found. So I turn to you. Hope this is a bug, or is not.
However, I did it successfully on earlier versions of gdb/g++. All the script
files are attached.
Thank you very much,
Xiannong Meng
Assistant Professor
Computer Science Department
Bucknell University
Lewisburg, PA 17837
meng@bucknell.edu
trial one:
**************************************************************************
SPARC, gdb 4.4, gcc 2.2.2
Script started on Fri Dec 11 15:44:33 1992
antares % cat simple.cc
#include <stream.h>
#include <stdlib.h>
class test_t
{
public:
test_t(int initial = 0); // constructor
void testset(int v) {member = v;}
int testget(void);
private:
int member;
};
test_t::test_t(int initial)
{
member = initial;
}
int test_t::testget(void)
{
return member;
}
main(void)
{
test_t value(3);
int i;
cout << value.testget();
value.testset(10);
i = value.testget();
cout << value.testget();
}
antares % gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sunos4.1/2.2.2/specs
gcc version 2.2.2
antares % g++ -g -fno-inline -fno-default-inline simple.cc
antares % gdb a.out
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.4, Copyright 1991 Free Software Foundation, Inc...
(gdb) break test_t::testset
The class test_t does not have any method named testset
(gdb) break test_t::testget
The class test_t does not have any method named testget
(gdb) q
antares % exit
exit
script done on Fri Dec 11 15:46:20 1992
script done on Fri Dec 11 15:46:20 1992
trial two:
***************************************************************************
SPARC, gdb 4.6, gcc 2.2.2
Script started on Fri Dec 11 15:53:20 1992
pleiades % gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sunos4.1/2.2.2/specs
gcc version 2.2.2
pleiades % g++ -g -fno-inline -fno-default-inline simple.cc
pleiades % gdb a.out
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
(gdb) b test_t::testset
(Cannot find method test_t::testset(test_t, int) - possibly inlined.)
warning: the class test_t does not have any method named testset
Hint: try 'test_t::testset<TAB> or 'test_t::testset<ESC-?>
(Note leading single quote.)
(gdb) b test_t::testget
(Cannot find method test_t::testget(test_t) - possibly inlined.)
warning: the class test_t does not have any method named testget
Hint: try 'test_t::testget<TAB> or 'test_t::testget<ESC-?>
(Note leading single quote.)
(gdb) q
pleiades % exit
exit
script done on Fri Dec 11 15:54:15 1992
trial three:
**************************************************************************
Sun 3, gdb 4.4, gcc 1.40 (yes, 1.40 :-))
Script started on Fri Dec 11 15:57:14 1992
gemini % gcc -v
gcc version 1.40
gemini % g++ -g -fno-inline -fno-default-inline simple.cc
gemini % gdb a.out
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.4, Copyright 1991 Free Software Foundation, Inc...
(gdb) break test_t::testset
Breakpoint 1 at 0x244c: file simple.cc, line 8.
(gdb) break test_t::testget
Breakpoint 2 at 0x247a: file simple.cc, line 21.
(gdb) q
gemini % g++ -g simple.cc
gemini % gdb a.out
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.4, Copyright 1991 Free Software Foundation, Inc...
(gdb) b test_t::testset
The class test_t does not have any method named testset
(gdb) b test_t::testget
Breakpoint 1 at 0x2464: file simple.cc, line 21.
(gdb) q
gemini % exit
exit
script done on Fri Dec 11 15:59:39 1992
trial four:
**************************************************************************
MIPS, gdb 4.7, gcc 2.3.2
Script started on Fri Dec 11 16:12:03 1992
meng % g++ -g -fno-inline -fno-default-inline simple.cc
meng % gcc -v
Reading specs from /usr/local/lib/gcc-lib/mips-dec-ultrix/2.3.2/specs
gcc version 2.3.2
meng % gdb a.out
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.7, Copyright 1992 Free Software Foundation, Inc...
(gdb) break test_t::testset
warning: the class test_t does not have any method named testset
Hint: try 'test_t::testset<TAB> or 'test_t::testset<ESC-?>
(Note leading single quote.)
(gdb) break test_t::testget
warning: the class test_t does not have any method named testget
Hint: try 'test_t::testget<TAB> or 'test_t::testget<ESC-?>
(Note leading single quote.)
(gdb) q
meng % exit
meng %
script done on Fri Dec 11 16:13:16 1992
Technical Details
Message-ID:
<9212112119.AA29565@sol.cs.bucknell.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sol.cs.bucknell.edu!mengShow Full Headers
Complete Article Headers
Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sol.cs.bucknell.edu!meng From: meng@sol.cs.bucknell.edu (Xiannong Meng) Subject: gdb bug or g++ bug Message-ID: <9212112119.AA29565@sol.cs.bucknell.edu> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Fri, 11 Dec 1992 21:19:20 GMT Approved: bug-gdb@prep.ai.mit.edu Lines: 174