Skip to content

Developing with CLion

Flavio Roth edited this page Jun 4, 2020 · 2 revisions

Working on termdbg from CLion

Launching termdbg

termdbg wont diplay properly in CLion's terminal. A possible workaround is to edit the target launch options so that your terminal of choice is launched instead.

In the Executable input, choose Select other... and enter the full path of oyur gnome terminal (usually /usr/bin/gnome-terminal)

In the Program arguments input, enter:

--geometry 120x80 -- $CMakeCurrentProductFile$ $CMakeCurrentGenerationDir$/sdk/examples/hello_world/hello_world
  • $CMakeCurrentProductFile$ points to the termdbg binary being built.
  • $CMakeCurrentGenerationDir$ points to the current cmake binary dir (cmake-build-*)

This will launch termdbg in a gnome-terminal when you run the target from CLion, but won't work when debugging.

Debugging termdbg

Launch a debug build of termdbg with the CLion target as normal then manually attach the debugger to the termdbg manually via the Run menu.

You might get a Operation not permitted caused by a lack of ptrace permission. This can be resolved by running the following command:

sudo echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

For more info about Yama see https://www.kernel.org/doc/Documentation/security/Yama.txt