kdumper

Updated: October 26, 2022

Write a kernel dump

Syntax:

kdumper [-A|-a|-I]  [-B] [-C|-c] [-K|-k] [-l size] [-U] [-v] [-w writer_name]

Runs on:

QNX Neutrino

Options:

-A | -a | -I
-A: dump the memory allocated to user processes in addition to the memory allocated for procnto and the code and static data for the bootstrap executables in the image file system (IFS).
-a: dump the memory allocated to the active user process on the CPU that caused the dump, in addition to the memory allocated for procnto and the code and static data for the bootstrap executables in the image file system (IFS).
-I: dump all the IFS contents.
Default behavior (none of -A, -a, nor -I is specified) is to dump the memory allocated for procnto and the code and static data for the bootstrap executables in the image file system (IFS).
-B
By default, unless there's a physical address in the dump greater than 4 GB kdumper writes the dump in the 32-bit ELF format. If the dump contains a physical address greater than 4 GB, then kdumper writes the dump in the 64-bit ELF format. Specify the -B option to have kdumper write the dump in the 64-bit ELF format in all cases.
-C | -c
-C: compress the dump file.
-c: disable compression (default); reduces the amount of memory used, but prevents compression being turned on later.
-K | -k
-K: attempt to invoke the kernel debugger when a dump is requested. If the kernel debugger fails to clear the error condition, dump.
-k: don't check with the kernel debugger before dumping (default).
-l size
Set the size, in bytes, of the ring buffer used to record kprintf() (kprintf() is a kernel utility that produces (snprintf()-like output). Default is 512; minimum is 100.
-U
Cause a kernel dump if an unhandled exception occurs on a user process, in addition to the default behavior: cause a kernel dump if an unhandled exception occurs while the kernel or a process manager is executing.
-v[v..]
Operate verbosely. Specify additional -v options to increase verbosity. Default is quiet operation.
-w writer_name
Specify the device to which kdump will write the dump. Default is uuencode (see Writers below).

Description:

The kdumper utility writes out a memory dump which by default includes the memory allocated for procnto and the code and static data for the bootstrap executables in the image file system. You change this setting so that the dump also includes the memory allocated to the active user process on the CPU that caused the dump, the memory allocated to all user processes, or the memory allocated to the entire IFS.

The dump is an ELF file (either 32-bit or 64-bit format; see Options above). GDB can't read this file directly: use the kdserver utility with GDB to parse and examine the dump file.

For more information about using GDB in a QNX Neutrino environment, see the entry for gdb. For more information about GDB, see https://www.gnu.org/software/gdb/documentation/.

Including kdumper in your build

The kdumper utility is a bootstrap executable, so you need to place it in the [virtual=] section of the inline bootstrap file of your buildfile. Place it before procnto; if you are also loading kdebug, place kdumper after kdebug.

Writers

By default, kdumper dump is uuencoded. After uudecoding, the dump file will be named kdump.elf (default, or -c option) if uncompressed, or kdump.elf.gz if compressed (-C option), which you can uncompress with the gunzip utility.

The following other writers are available with kdumper:

dummy
Discard the dump; used for debugging kdumper.
external
Use the writer specified after kdumper in the buildfile's inline bootfile.