This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gdb seg violation during print command


> 
> 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
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]