Debugging: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
If you have a program crash and create a .core file, like say Thunderbird crashes on you and you find the .core file: | |||
$ gdb thunderbird thunderbird-bin.core | |||
where thunderbird is the application and thunderbird-bin.core is the core file. In this case I got an error: | |||
"/usr/X11R6/bin/thunderbird": not in executable format: File format not recognized | |||
as when I looked at this file a little further I found out it is a shell script and not a binary. I did find a -g (debug) mode in this shell script which I used. Most cases it is a binary though, so the most common starting point is | |||
(gdb) bt | |||
backtrace. This won't usually too much good unless you have compiled the program with debugging symbols. | |||
== FreeBSD == | == FreeBSD == | ||
Revision as of 18:56, 12 November 2005
If you have a program crash and create a .core file, like say Thunderbird crashes on you and you find the .core file:
$ gdb thunderbird thunderbird-bin.core
where thunderbird is the application and thunderbird-bin.core is the core file. In this case I got an error:
"/usr/X11R6/bin/thunderbird": not in executable format: File format not recognized
as when I looked at this file a little further I found out it is a shell script and not a binary. I did find a -g (debug) mode in this shell script which I used. Most cases it is a binary though, so the most common starting point is
(gdb) bt
backtrace. This won't usually too much good unless you have compiled the program with debugging symbols.
FreeBSD
I had a case where Mozilla Thunderbird would core on me as soon as I started it.
$ ktrace thunderbird
which created a file called "ktrace.out".
$ kdump -f ./ktrace.out
produced a lot of output, so much that I won't paste it here. These are the system calls that were made. You will most likely want to send that output to the appropriate helplist/bug report for that application.