Run a C++ program in Clion as root

Mazzy picture Mazzy · Jan 21, 2016 · Viewed 7.2k times · Source

I'm trying to run a program written in C++ by using CLion v1.2 as super user. Anyone here knows how to run it as superuser? I'm using CMake.

Answer

Antony picture Antony · Dec 23, 2016

I solved this by remote debugging on local machine. I run gdbserver with root privileges and connected to it from CLion.

To start gdbserver sudo gdbserver :port myapp, configure remote GDB debug with port