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


> First off, your code is broken. You claim to return an int, but don't.
> This is what is causing the segfault in gdb.
> It's impossible for us to not believe the compiler when it says "this
> function returns an int". We expect it to return an int.

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.

> 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? Where can I get the "newer"
gdb? What version is the "newer" gdb?

-- DavidC


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