Abhishek Sagar
Abhishek Sagar

Reputation: 1326

How to get linux kernel coredump for later analysis using gdb tool?

Is it possible to intentionally crash the kernel at specific point during the course of its execution (by inserting some C statement there Or otherwise) and then collect the corefile for analysis using normal gdb program ? Can somebody pls share the steps and what needs to be done.

Upvotes: 1

Views: 200

Answers (1)

Employed Russian
Employed Russian

Reputation: 213385

Is it possible to intentionally crash the kernel

Sure: just insert a call to panic() in desired place.

The easiest way to do this is using user-mode linux. The kernel becomes just a regular program, and you can execute it under GDB the usual way, setting breakpoints, looking at variables, etc.

If you need to do "bare metal" execution, you should probably start here or here.

Upvotes: 2

Related Questions