I know that this question has been asked many times on different sites, but I could not find recommendations to fix my problem. I work with GCC 4.8.1 on NetBeans 8.0 and must (visually) debug a program that accesses raw devices, so I need to run it through sudo.
Settings of my project parameters:
- Run β Run Command = "sudo $ {OUTPUT_PATH}"
- Run β Console Type = "External Terminal"
- Run β External terminal type = "Default"
All other settings are standard, including Debug -> Debug Command , which is empty.
So, the program works fine when I run in NetBeans - sudo asks for a password, and then the program continues. However, I cannot debug it in NetBeans - the debugger displays the text below and stops.

Any ideas? Please do not offer to run NetBeans as root - this is too troublesome for me.
(I am on Xubuntu 3.11 , which runs as guest OS on VMWare Fusion VM on Mac)
UPDATE FROM 2015/09/16:
According to a few tips (from the network), I tried to replace the Debug Command in the popup window Tools β Options β C/C++ my script with the following content:
#!/bin/bash PROG=$(which gdb) sudo $PROG " $@ "
This script works fine from the command line. However, when I try to debug my program from NetBeans, I get the following popup:

So, the first problem goes away, and the second one appears. I saw a number of recommendations for clearing control points in this case - it did not help me.
Any ideas what to try next?
(gdb version - GNU gdb (Ubuntu / Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04)