Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the console in the directory with your executable:</p> <pre><code>sudo gdb ./my_program </code></pre> <p>If eclipse supports remote debugging then you could do that even though it is running locally.</p> <p>From the console:</p> <pre><code>sudo gdbserver localhost:&lt;port_number&gt; ./my_program </code></pre> <p>And then tell Eclipse the address (localhost and the port number you chose).</p> <p>Oh yeah, you said the reason you were doing this was because you were using <code>libpcap</code>, so you may not want to use remote debugging over TCP because you may end up capturing your debugging connection packets in addition to your other network traffic.</p> <p>In that case you do your remote (but really local) debugging over a serial port. I have never done this on a local machine, but you could use two actual serial ports (attaching them though a null modem) or try using a psudoterminal:</p> <pre><code>sudo gdbserver /dev/ptmx ./my_program </code></pre> <p>This will create the psudo-terminal under <code>/dev/pts/</code> but you'll have to figure out the name of it, and it might also create it with restrictive permissions. You can get around those. Unless you are running lots of terminal windows as root, it is not likely that you have many entries under <code>/dev/pts</code> that belong to root, so take note of the one that does after running the above command and then <code>sudo chmod</code> or <code>sudo chown</code> it to make it usable for your normal user and then tell your debugger to use that as your serial connection to your remote debugging target.</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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