title: Signals when debugging
body: <p>I'm developing an application (a service/daemon, really) on Linux in C++ that needs to interface with a piece of hardware. If my program doesn't release the resources for this peice of hardware cleanly when terminating, then I have to reload the device driver, a process that takes about 10 minutes and for obvious reasons having to wait 10 minutes between each test of the program would be frustrating.</p>
  
  <p>So I have used the <code>sigaction()</code> function to catch a SIGINT (a ctrl-c) so that my program can cleanly shutdown when I'm finished with it. When running the program from the console, this works fine. However, when debugging in Netbeans or Eclipse (I've tried both) things don't work.</p>
  
  <ul>
  <li>In Eclipse, if I hit ctrl-c in the console it provides, it doesn't seem to register that a SIGINT ever occurred</li>
  <li>In Eclipse, if I run the program in debug mode and then use <code>kill -SIGINT &lt;pid&gt;</code>, the program just breaks as if it hit a breakpoint</li>
  <li>Netbeans actually seems to realise a signal has been sent when I hit ctrl-c in the console, and pops up a dialog asking if I want to forward it to the application. Clicking "Forward and continue" just seems to break the program and the signal is not received by the application. It also says I can configure this stuff in Debug -> Dbx configure, a menu item that doesn't exist</li>
  <li>In Netbeans, if I run the program in debug mode and then use <code>kill -SIGINT &lt;pid&gt;</code>, the behaviour is the same as above</li>
  <li>I then added a SIGQUIT handler and tried sending that via <code>kill</code> when debugging in Netbeans. This time, no dialog appears and the signal handler is never tripped.</li>
  </ul>
  
  <p>I need <em>some</em> way to cleanly shutdown my app while I'm debugging. Any ideas?</p>