Clion memory view
Memory View has been added to CLion in version 2019.1. To open it, select a pointer variable in the debugger’s variables view and press Ctrl+Enter
on Windows/Linux or ⌘Enter
on macOS.
In all earlier versions you can use the debugger's command x
which is available in both GDB and LLDB. You can choose the debugger via CLion->Preferences->Build,Execution,Deployment->Toolchains->Debugger, and display the Debug window via View->Tool Windows->Debug or it should appear if you start a new debugging session via Run->Debug.
For example, in the Debug window I can eXplore memory starting at the address of a variable i
:
(lldb) x &i
0x7fff59dbac58: 00 00 00 00 00 00 00 00 88 ac db 59 ff 7f 00 00 ...........Y....
0x7fff59dbac68: 5e 30 2f 61 ff 7f 00 00 88 ac db 59 ff 7f 00 00 ^0/a.......Y....
Not exactly memory view, but the following proved extremely useful for me. If you have a variable like char *p
then you can add (char[100])p
to watches and see 100 characters in memory beginning from p
.