Asking for debugging suggestions... (GNU/Linux)

Hello,

I need your suggestions to find the *variable* and the *source code file* involved in this runtime error,

1
2
3
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted


Thanks,

S.


Build the program with debugging symbols (compile with -g).

Set your limits to allow a coredump file to be created (ulimit -c unlimited).

Run the program and get a core file.

Load the program and core into gdb (gdb <program> <core file>).

Look at the the backtrace (gdb's "where" command).

That's a start. If you have a good IDE with built-in support for debugging, load the program into your IDE, set a breakpoint before where the error occurs and then step through the program.
Thanks,

Build the program with debugging symbols (compile with -g).

Set your limits to allow a coredump file to be created (ulimit -c unlimited).


Done... but,


Run the program and get a core file.


How can I get the "core file" ?

S.
Done... but,

compile with -ggdb.. which will include symbols so that you can debug with gdb.

How can I get the "core file" ?

when you set the limit with ulimit as PanGalactic said, the core will create.. you dont have to create it.
Just an FYI -- there is no need to use -ggdb on Linux. It won't hurt, but it is redundant. It can be useful on other Unix platforms though.
File "core" found...

Thanks to all,

S.
Topic archived. No new replies allowed.