Debugging a program that uses SIGINT with gdb
<p>I frequently work with PostgreSQL for debugging, and it uses <code>SIGINT</code> internally for some of its inter-backend signalling.</p>

<p>As a result when running certain backends under <code>gdb</code> execution tends to get interrupted a lot. One can use the <code>signal</code> command to make sure <code>SIGINT</code> is passed to the program and that it is not captured by <code>gdb</code>... but then <code>gdb</code> doesn't respond to control-C on the command line, since that sends <code>SIGINT</code>.</p>

<p>If you run:</p>

<pre class="lang-none prettyprint-override"><code>handle SIGINT noprint nostop pass
</code></pre>

<p><code>gdb</code> will complain</p>

<pre class="lang-none prettyprint-override"><code>SIGINT is used by the debugger.
Are you sure you want to change it? (y or n) y
</code></pre>

<p>Is there any way to get gdb to use a different interrupt signal? Or any alternative method that'd let me have <code>gdb</code> ignore <code>SIGINT</code>?</p>

<p>(This isn't an issue for most PostgreSQL backend debugging, but it's a pain with background workers and autovacuum).</p>