title: gdb not hitting breakpoints
body: <p>To learn a bit more about FreeBSD and *nix systems in general, I'm starting to look at the binaries from the DEFCON 17 Capture The Flag game.  Right now, I'm reversing the tucod binary.  Here's some possibly useful information on tucod:</p>
  
  <pre><code>tucod: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 7.2, dynamically linked (uses shared libs), FreeBSD-style, stripped
  </code></pre>
  
  <p>Some other possibly useful information gained from some brief static analysis is that tucod binds on port 0xDEAD (cute, eh?) and if you give it a specific password ("HANGEMHIGH!") it will play a game of hang-man with you.</p>
  
  <p><strong>The problem that I'm encountering is that I'm not hitting my breakpoints in gdb.</strong>  Specifically, the breakpoint that I'm trying to reach is in the code that handles the client connection.  Without breakpoints, the code executes as expected.  When I set a breakpoint on that code, the child exits (instead of breaking into gdb, as expected).  If I set breakpoints before the server forks off the child, I can hit those fine but after hitting "continue" the child does not continue to process my connection (that is, it won't ask me for a password or play hang-man).</p>
  
  <p>Since the daemon forks when it receives a new connection, I try to tell gdb to follow the child with this command:</p>
  
  <pre><code>(gdb) set follow-fork-mode child
  </code></pre>
  
  <p>But after single-stepping the instructions after the fork, it appears that this isn't working.</p>
  
  <p>I've tried looking for calls to <code>signal</code>, thinking they implemented a custom SIGINT handler (or similar), but the only call to <code>signal</code> that I can see handles SIGCHLD.</p>
  
  <p>My breakpoint in gdb currently looks like this:</p>
  
  <pre><code>(gdb) info breakpoints
  Num Type           Disp Enb Address    What
  1   breakpoint     keep y   0x080497d0
  </code></pre>
  
  <p>And <code>0x080497d0</code> is the address I want to break on in the client processing code. </p>
  
  <p>I'm sort of new to analyzing software on *nix systems and could use some pointers.  <strong>How else should I go about troubleshooting why GDB will not hit my breakpoints?</strong>  Or is there something major I'm just overlooking?</p>
  
  <p>There's a <a href="http://www.ddtek.biz/ctf_dc17_binaries.zip.torrent" rel="nofollow noreferrer" title="torrent">torrent</a> available with all of the game binaries for those interested in seeing the binary first-hand.</p>