* GDB and C++ problem
@ 1999-09-14 4:00 Pierre Theate
1999-09-14 4:00 ` Tom Kacvinsky
0 siblings, 1 reply; 8+ messages in thread
From: Pierre Theate @ 1999-09-14 4:00 UTC (permalink / raw)
Hi wizards,
I can use gdb with C program but have some trouble with C++.
For example, see folowing gdb session :
> more pth.cpp
1 #include <stream.h>
2
3 void
4 main (void)
5 {
6 int i = 1;
7
8 i++;
9 cout << "i = " << i << endl;
10 }
> g++ -g pth.cpp
> gdb a.out
GNU gdb 4.17
..
(gdb) b 6
Breakpoint 1 at 0x12000a6e8: file pth.cpp, line 6.
(gdb) r
Starting program: /shared/home/rtrp/tmp/a.out
Breakpoint 1, main () at pth.cpp:6
6 int i = 1;
(gdb) n
8 i++;
(gdb) n
9 cout << "i = " << i << endl;
(gdb) print i
$1 = 2
(gdb) n
operator::operator<< (this=0x14002e600, s=0x0) at iostream.cc:765
765 {
(gdb)
I use 'next' command but gdb step in cout operator source code !
Do you have the same behaviour on your system ?
My system is Digital OSF1 V4.0 878 alpha.
Any help would be greatly apreciated.
Pierre.
--------------------------------------------
Pierre Theate
Belgacom, Multimedia & Infohighways division
e-mail: pth@belbone.be
phone: +32 2 202.44.45.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: GDB and C++ problem
1999-09-14 4:00 GDB and C++ problem Pierre Theate
@ 1999-09-14 4:00 ` Tom Kacvinsky
1999-09-20 4:00 ` Thomas Riechen
1999-09-23 4:00 ` Pierre Theate
0 siblings, 2 replies; 8+ messages in thread
From: Tom Kacvinsky @ 1999-09-14 4:00 UTC (permalink / raw)
Hi,
Try compiling gdb 4.18 with Compaq's C compiler. Let me know
if that works.
Tom
--
Tom Kacvinsky
Technical Support
American Mathematical Society
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: GDB and C++ problem
1999-09-14 4:00 ` Tom Kacvinsky
@ 1999-09-20 4:00 ` Thomas Riechen
1999-09-20 4:00 ` Tom Kacvinsky
1999-09-23 4:00 ` Pierre Theate
1 sibling, 1 reply; 8+ messages in thread
From: Thomas Riechen @ 1999-09-20 4:00 UTC (permalink / raw)
Hi,
>
> Try compiling gdb 4.18 with Compaq's C compiler. Let me know
> if that works.
You can use the gcc C++ compiler, but there is a problem with Patch-Kit
4! After installing Patch-Kit 4 you can't use an old gcc binary!? There
happen strange things while compiling, like "sizeof(short) == 0"(?). In
addition some old binaries compiled with gcc will crash...
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: GDB and C++ problem
1999-09-20 4:00 ` Thomas Riechen
@ 1999-09-20 4:00 ` Tom Kacvinsky
1999-09-20 4:00 ` Thomas Riechen
0 siblings, 1 reply; 8+ messages in thread
From: Tom Kacvinsky @ 1999-09-20 4:00 UTC (permalink / raw)
Hi,
On DU 4.0D, I had no problems compiling gdb with DEC's C compiler.
Then all of my problems with gdb went away.
As for your gcc C++ compiler problems, what version of gcc are you using?
Are you using a precompiled package? If so, and that package was
compiled with an earlier version of DU, you might be running into runtime
library problems. We had that experience when updating from 4.0B to 4.0E
on one of our machines, but it was a DynaLoader module in Perl that was
barfing.
Perhaps a recompile of the gcc package is in order?
Regards,
Tom
--
Tom Kacvinsky
Technical Support
American Mathematical Society
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: GDB and C++ problem
1999-09-20 4:00 ` Tom Kacvinsky
@ 1999-09-20 4:00 ` Thomas Riechen
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Riechen @ 1999-09-20 4:00 UTC (permalink / raw)
Hi,
> As for your gcc C++ compiler problems, what version of gcc are you using?
egcs-2.91.66
> Are you using a precompiled package? If so, and that package was
> compiled with an earlier version of DU, you might be running into runtime
> library problems. We had that experience when updating from 4.0B to 4.0E
> on one of our machines, but it was a DynaLoader module in Perl that was
> barfing.
We always compiling those GNU packages, but I didn't look for the
reason.
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: GDB and C++ problem
1999-09-14 4:00 ` Tom Kacvinsky
1999-09-20 4:00 ` Thomas Riechen
@ 1999-09-23 4:00 ` Pierre Theate
1999-09-23 4:00 ` Tom Kacvinsky
1 sibling, 1 reply; 8+ messages in thread
From: Pierre Theate @ 1999-09-23 4:00 UTC (permalink / raw)
In article <tjk-175ED6.10550814091999@sun06.ams.org>, Tom Kacvinsky <tjk@ams.org> wrote:
>Hi,
>
>Try compiling gdb 4.18 with Compaq's C compiler. Let me know
>if that works.
>
>Tom
>
Sorry for this late answer.
I try with cc compiler and it does not help.
Is it possible to download a binary version of gdb for OSF1 4.0D somewhere ?
Pierre.
--------------------------------------------
Pierre Theate
Belgacom, Multimedia & Infohighways division
e-mail: pth@belbone.be
phone: +32 2 202.44.45.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: GDB and C++ problem
1999-09-23 4:00 ` Pierre Theate
@ 1999-09-23 4:00 ` Tom Kacvinsky
1999-09-27 4:00 ` Pierre Theate
0 siblings, 1 reply; 8+ messages in thread
From: Tom Kacvinsky @ 1999-09-23 4:00 UTC (permalink / raw)
Hi,
>
> >
> >Try compiling gdb 4.18 with Compaq's C compiler. Let me know
> >if that works.
> >
>
> Sorry for this late answer.
> I try with cc compiler and it does not help.
>
Can you be more specific? What failed? configuration? compilation?
Or gdb compiled fine, but you still had problems debugging a g++
compiled binary?
> Is it possible to download a binary version of gdb for OSF1 4.0D
> somewhere ?
>
I am sure this is a binary release out there somewhere, but I haven't
a clue (right now) where that place is. I believe that Compaq has
an ftp site where you can pick up precomiled binaries for Tru64 UNIX.
Tom
--
Tom Kacvinsky
Technical Support
American Mathematical Society
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: GDB and C++ problem
1999-09-23 4:00 ` Tom Kacvinsky
@ 1999-09-27 4:00 ` Pierre Theate
0 siblings, 0 replies; 8+ messages in thread
From: Pierre Theate @ 1999-09-27 4:00 UTC (permalink / raw)
In article <7sd4rm$75n$1@sun06.ams.org>, Tom Kacvinsky <tjk@ams.org> wrote:
>Hi,
>
>>
>> >
>> >Try compiling gdb 4.18 with Compaq's C compiler. Let me know
>> >if that works.
>> >
>>
>> Sorry for this late answer.
>> I try with cc compiler and it does not help.
>>
>
>Can you be more specific? What failed? configuration? compilation?
>Or gdb compiled fine, but you still had problems debugging a g++
>compiled binary?
gdb compiled fine but I see no difference with the one compiled with gcc.
So, it means if I do next on a cout statement, it steps in cout code.
By the way, does your gdb behave differently (execute cout and go to next
statement) ?
>
>> Is it possible to download a binary version of gdb for OSF1 4.0D
>> somewhere ?
>>
>
>I am sure this is a binary release out there somewhere, but I haven't
>a clue (right now) where that place is. I believe that Compaq has
>an ftp site where you can pick up precomiled binaries for Tru64 UNIX.
>
I am going to search the net for it.
>Tom
>
Pierre.
--------------------------------------------
Pierre Theate
Belgacom, Multimedia & Infohighways division
e-mail: pth@belbone.be
phone: +32 2 202.44.45.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~1999-09-27 4:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-09-14 4:00 GDB and C++ problem Pierre Theate
1999-09-14 4:00 ` Tom Kacvinsky
1999-09-20 4:00 ` Thomas Riechen
1999-09-20 4:00 ` Tom Kacvinsky
1999-09-20 4:00 ` Thomas Riechen
1999-09-23 4:00 ` Pierre Theate
1999-09-23 4:00 ` Tom Kacvinsky
1999-09-27 4:00 ` Pierre Theate
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox