How to analyse a coredump file of GDB.
Asked
Active
Viewed 1,174 times
-3
-
Another interview question? Stop it. – ams Nov 28 '14 at 12:25
-
If you can't answer,Please you stop it. – sv1 Nov 28 '14 at 13:01
-
Exactly how many ways do you imagine a program could "do core dump"? – ams Nov 28 '14 at 13:04
-
I don't know anything about coredump.Explain it if you can.I have heard these words in GDB debugging.Don't know exactly what it is – sv1 Nov 28 '14 at 13:06
-
This site is here for people who need help. "Name all the ways ..." is not how you ask for help. Perhaps you'd like to go to one of the religious exchange sites, and ask "Names all kinds of sin"? It's the same question. – ams Nov 28 '14 at 13:11
-
Improve your attitude. – sv1 Nov 28 '14 at 13:16
-
Well, that edit improved the question. – ams Nov 28 '14 at 13:27
1 Answers
1
GDB can get you started:
$ gdb --help
This is the GNU debugger. Usage:
gdb [options] [executable-file [core-file or process-id]]
gdb [options] --args executable-file [inferior-arguments ...]
[snip extended docs]
So, you'll invoke it like this:
gdb myprog core
GDB will then start in the usual way, but the state will be as if you'd stopped at a breakpoint. You can then use "print", "examine", "list", "backtrace", "up", "down", etc. to investigate what caused the crash.
In fact, you can use any GDB command except "continue", "step", "next", or anything else that requires an actual running program.

ams
- 24,923
- 4
- 54
- 75
-
-
1
-
-
(for reference) [gdb - Core dump file analysis - Stack Overflow](https://stackoverflow.com/questions/5115613/core-dump-file-analysis) . – user202729 Mar 07 '22 at 04:02