title: Can gdb print the contents of the buffer written to by the C write() function?
body: <p>I have the following code:</p>
  
  <pre><code>write(fd[1], user_id, sizeof(user_id));
  </code></pre>
  
  <p>Is it possible to use gdb to see the contents of the buffer written to by this command?
  Using x or print just gives the memory address, not the contents of the buffer in that address.</p>
  
  <pre><code>(gdb) x write
  0x7ffff7af4140 &lt;__GI___libc_write&gt;: 0xb1058d48
  </code></pre>
  
  <p>Since the fd[1] refers to stdout, this request should be equivalent to checking the status of the stdout buffer.</p>
  
  <p>Additional info:
  user_id is a char array. fd[1] means write is writing to stdout (fd[0] refers to stdin).
  This is line 44 of a program, and I am accessing it with a breakpoint. </p>