17

I can't find a memory view in Jetbrain's clion IDE. Does anybody know to show it (has clion this feature)?

Meant is this: memory view in eclipse

Martin Pfeffer
  • 12,471
  • 9
  • 59
  • 68

4 Answers4

18

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....
V-R
  • 1,309
  • 16
  • 32
  • "For example in the Debugger window I can display memory starting at the address of a variable i:" how do you do this? – clankill3r May 14 '16 at 09:16
12

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.

Notinlist
  • 16,144
  • 10
  • 57
  • 99
4

Memory view is a built in feature as of Clion 2019.1.

You can access it by selecting a pointer in the debugger list and pressing either ⌘Enter on Mac or Ctrl+Enter on Windows/Linux.

From the "What's New" page:

Memory View dumps the memory behind the pointer in the Debug mode. To invoke it, select a pointer variable in the debugger’s variables view and press ⌘Enter.

During stepping, if you have Memory View opened, CLion will highlight the memory changes that take place in the selected memory piece.

And here is what the memory view looks like:

Memory view demo

Community
  • 1
  • 1
Increasingly Idiotic
  • 5,700
  • 5
  • 35
  • 73
3

Latest (CLion 2018.1) has GDB in default layout. and you at any point can see memory dump according to your taste (https://sourceware.org/gdb/onlinedocs/gdb/Memory.html)

f.e. x/16ux &myVar

Boris Ivanov
  • 4,145
  • 1
  • 32
  • 40