This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: gdb seg violation during print command
- To: David Cogen <cogen at ll dot mit dot edu>
- Subject: Re: gdb seg violation during print command
- From: Daniel Berlin <dan at cgsoftware dot com>
- Date: Thu, 4 May 2000 10:41:15 -0700 (PDT)
- cc: kettenis at wins dot uva dot nl, gdb at sourceware dot cygnus dot com
>
> Sorry, that's not it. I have also tried the following:
>
> #include <iostream>
>
> int tteesstt11 (int)
> {
> cerr << "\n";
> return 4;
> }
>
> int main ()
> {
> }
>
> print tteesstt11(1) from a breakpoint in main() still causes gdb to seg
> fault. Indeed, I have tried lots of forms for tteesstt11; they all seg fault.
Okay.
Well, it works perfectly for me once i add the return. Prints the newline,
then 4.
>
> > In the newer gdb, what'll happen is you'll get no segfault, but a weird number
> > returned, which will actually the address of the function, which is
> > the last value we have around, i guess.
>
> Have you actually tried this or are you supposing?
How would i know what it did if i didn't try it?
> Where can I get the "newer"
> gdb?
sourceware.cygnus.com
Look at the gdb page.
> What version is the "newer" gdb?
>
You have a few choices.
You can get a 5.0 snapshot, or the main branch.
Doesn't matter, anything newer than February (when i became the C++
maintainer and started fixing this stuff) should work fine.
And does, for me.
On x86 Linux, and BeOS.
> -- DavidC
>