CLion 2019.2 Help

Memory View

In some cases (for example, to debug 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 pane to the memory region that includes the required address and examine the changes along with stepping through the program.

Invoke Memory View

  1. In the Variables pane of the Debugger tool window, select the desired pointer variable. For a non-pointer object in memory, you can set a watch for the variable's address (like &var) and then invoke Memory View for it.

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

    show a variable in memory view

    Note that for non-pointer variables this option is disabled (greyed out).

  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 arе highlighted in the same window, and the region is extended to show more addresses if necessary.

    You can also open several Memory View windows by splitting the editor tabs vertically icons actions splitVertically or horizontally icons actions splitHorizontally. Use the context menu of the left column to hide/show or copy the addresses:

    multiple memory view windows

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

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 call the address of any variable using &.

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

    completion in go to address

Examine memory while stepping

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

Last modified: 27 November 2019