Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li>Enable your user to run <a href="/questions/tagged/gdb" class="post-tag" title="show questions tagged &#39;gdb&#39;" rel="tag">gdb</a> as root without being asked for any password:<br> <code>sudo visudo</code><br> Add the following line after all other rules:<br> <code>&lt;youruser&gt; ALL=(root) NOPASSWD:/usr/bin/gdb</code></li> <li>Create or modify a debug configuration in <a href="/questions/tagged/eclipse" class="post-tag" title="show questions tagged &#39;eclipse&#39;" rel="tag">eclipse</a> to run gdb as root<br> e.g. in Run > Debug Configurations > C/C++ Application > YourProject Debug:<br> change Debugger > Main > GDB debugger from <code>gdb</code> to <code>sudo -u &lt;youruser&gt; gdb</code></li> </ol> <p><strong>Update (and warning!):</strong></p> <p>In his comment nategoose pointed out that this answer should come with a warning:</p> <p>Enabling a user to use <code>sudo</code> for <code>gdb</code> like suggested in my answer <em>in fact gives admin privileges to him/her</em> which in many cases might be an undesired side effect. I therefore consider the answer appropriate in an environment where it's not assumed that the user would try to harm the system (e.g. it's your own personal computer or a virtual machine)</p> <p>For a multi-(non-trusted)-user environment I think it might be a better idead to utilize <a href="http://linux.die.net/man/7/capabilities" rel="noreferrer">unix' file capabilities</a> to enable <code>gdb</code> to debug an application without the need of admin privileges</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload