CLion 2020.3 Help

Core dump debug

CLion supports postmortem debug with code dump files. These files are copies of process memory captured by the system at the point the program crashed or otherwise terminated abnormally.

Since the only available data is a memory snapshot for the time of a crash, stepping through the program is not possible, but you can investigate the corresponding source code, frames, and variables. Memory view, disassembly view, and debugger console can be used as well.

Configure a core dump debug session

  1. Use one of the options:

    • Select Run | Open Core Dump from the main menu or call this action from Help | Find Action ( Ctrl+Shift+A ).

      If there are no Core Dump Debug configurations in the project, the Open Core Dump dialog will be shown right away. Otherwise, select New Core Dump from the popup menu.

      The Open Core Dump dialog
    • Create a Core Dump Debug configuration manually. Go to Run | Edit Configurations, click icons.general.add.svg, and select Core Dump Debug from the list of templates.

      Core Dump Debug configuration

  2. Configure the following settings:

    • Debugger

      Select the debugger to be used: bundled LLDB, bundled GDB, toolchain's GDB, or a custom external GDB.

      Default debuggers are the bundled LLDB if the default toolchain is configured with LLDB, and the bundled GDB in all other cases.

    • Core dump

      Provide the path to the core dump file or select it using the file chooser. Make sure the file has read access permission.

    • Symbol file (optional for LLDB)

      Here you can specify the program's binary built with debug information, or this can be a separate symbol file.

      Currently, symbol file is ignored by CLion when using LLDB (CPP-22539).

    • Path mappings (optional)

      Use this pane to set path mappings if the binary was built on another machine with different file/directory names or paths.

Launch a core dump session

  • For the Open Core Dump action, CLion creates the corresponding configuration and launches it automatically.

    If you call Open Core Dump when there are existing configurations in the project, it will open the list of them with the option to create a new one:

    The Open Core Dump popup

  • If you created a Core Dump Debug configuration manually, select it in the switcher and press icons.actions.startDebugger.svg ( Shift+F9 ).

Core dump debug process

When you start a core dump debug session, CLion opens the corresponding source code and the Debug tool window automatically. Similarly to a regular debug session, you can use the Frames tab and the Variables pane, as well as Memory and Disassembly view. Debugger console for running debugger commands is also available.

Core dump debugging

Current issues and limitations

  • Symbol file is ignored in case of LLDB (CPP-22539).

  • Remote core dump debugging is currently in development (CPP-22736, CPP-22656).

  • On macOS, bundled GDB might fail to start with the No core file handler recognizes format error, which is a known issue with GDB on macOS.

  • Evaluate expression functionality can be limited.

  • Debugging Windows minidumps is not supported currently (CPP-22760).

Last modified: 18 November 2020