Per Inge Mathisen wrote:
On 2/22/07, Dennis Schridde <[EMAIL PROTECTED]> wrote:
[ lots of talking to himself ]

Using backtrace_symbols() gives you some more information, but it is
still very hard to read. It is nothing compared to the output given by
gdb. Anyway, you can see if by pasting this into your gdmp.c:

       char **result = backtrace_symbols(btBuffer, btSize);

       if (result != NULL) {
               int i;

               fprintf(stdout, "Backtrace with symbols:\n");
               for (i = 0; i < btSize; i++) {
                       fprintf(stdout, "%i: %s\n", i, result[i]);
               }
       } else {
               fprintf(stderr, "backtrace_symbols failed");
       }

backtrace_symbols_fd() is safer, though. You must compile with -rdynamic

Also see "info Backtrace glibc". The best would be to automatically
connect gdb to the program and give a "bt full" dump. If you
automatically emailed that back to us, it would be an invaluable debug
aid, and a massive privacy violation ;-)
We could just ask the user if we can do that ;)
I once had an ASSERT macro that fired up GDB automagically, but I seem to have lost it. I searched my hard drive for invocations of GDB and noticed that the QT toolkit has a whole file with GDB calls. That might be usefull to look at.

http://www.google.com/codesearch?q=qcrashhandler.cpp
The original is written by Bjorn Reese:
http://www.google.com/codesearch?q=stacktrace.c+Bjorn+Reese

A Google code search for gdb+getpid also yields some interesting results:
http://www.google.com/codesearch?q=gdb+getpid

- Gerard

_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to