CLion 2021.1 Help

Memory view

In some cases, for example, when debugging data processing problems, you may need to view raw memory of the running process. For this, CLion provides Memory View: you can jump from a pointer in the Variables tab to the memory region that includes the required address and examine the changes along with stepping through the program.

Show Memory View

  1. In the Variables tab of the Debugger tool window, select the desired pointer variable.

  2. Press Ctrl+Enter or choose Show in Memory View from the variable's context menu:

    show a variable in memory view

    This option is available for non-pointer variables as well. The variable's address will be taken automatically.

  3. The Memory View window initially shows a 256-byte region that starts from the chosen address, with higher memory addresses at the bottom of the window. When you then invoke Memory View for other pointers, they are highlighted in the same window, and the region is extended to show more addresses if necessary.

    Use the context menu of the left column to hide/show or copy the addresses:

    addresses column menu

    The right-hand column displays the ASCII character equivalents of the memory values.

  4. When you step through the code, CLion highlights the changes that happen in the currently shown memory region:

    changes in memory during stepping

Open Memory View in the editor

  1. Use the Move Memory View to Editor Icons general layout editor preview button on the Variables (or Watches) tab to open Memory View in the editor:

    Move memory view to editor

  2. This way, you can open two independent memory windows, in the Debug tool window and in the editor:

    multiple memory view windows

Go to address

  • Use the Go to field of the Memory View window to jump to a particular address. You can enter the address directly as a hex number, specify a pointer variable or an expression evaluating to a pointer, or use the address of operator & to get the address of any variable.

    Code completion in this field helps in choosing from the known symbols:

    completion in go to address

Last modified: 11 May 2021