title: How to use gdb command list to print a function's parameter and return value without pausing?
body: <p>I want to see which parameter and return value to a function. I use gdb breakpoint command list (gdb command script) as follow:</p>
  
  <pre><code>int foo(int)
  
  (gdb) break foo
  (gdb) print $r0
  (gdb) finish
  (gdb) print $r0
  (gdb) continue
  (gdb) end
  </code></pre>
  
  <p>But it print only the parameter. </p>
  
  <p>I got the reason from here <a href="http://www.delorie.com/gnu/docs/gdb/gdb_35.html" rel="nofollow noreferrer">GDB Breakpoint command lists</a></p>
  
  <blockquote>
    <p>Any other commands in the command list, after a command that resumes execution, are ignored.</p>
  </blockquote>
  
  <p>Any help is appreciated.</p>