Migration from RWTools to string - problems [newbie]
Tue Sep 30 16:38:00 GMT 2003
Well, if your program is crashing, it should be generating a core file
(if not, then you might need to reset your ulimit for core files with
this command: 'ulimit -c unlimited' (without the quotes, of course). On
newer RedHat systems, the core file will probably be named core.<pid>,
where <pid> is the process ID of the process that died. Once you have
the core file, you load it into GDB, which can show you the stack trace.
You do that like this:
gdb <path_to_prog> <core_file>
For example, if your program is "myprog", and is in the current
directory, and your core file is simply name "core", then you would load
it into gdb like this:
gdb myprog core
Once you get to GDB's prompt, type "where" and hit return. This will
show you the stack at the time the program crashed. Type "quit" to
Now, for this to really be useful, you will need to have compiled your
program with debugging information using the '-g' compiler switch (just
add it to your command line for compiling and linking). With that, you
should get the actual line of code that it crashed on, if it crashed on
a line in your program. Or, if it crashed in another library, or
something, you can see from the stack trace where the function that
crashed was ultimately called from.
If you can't figure out what the stack trace means, try posting it again
to the list. Someone here will know how to read it.
I'm quite positive that I have not tried such a thing since
returns const char* and modifying that would cause the compiler to
have no idea about stack tracing, how is that done and by what tools?
More information about the Gcc-help