title: Automate gdb: show backtrace at every call to function puts
body: <p>I want to debug some program. I need backtraces from all calls to some function, e.g. puts.</p>
  
  <p>Now I use such gdb <code>script</code>:</p>
  
  <pre><code>set width 0
  set height 0
  set verbose off
  break puts
  commands 1
  backtrace
  continue
  end
  </code></pre>
  
  <p>But starting it with </p>
  
  <pre><code>gdb --batch --command=script --args ./some_program arguments
  </code></pre>
  
  <p>Gives a error:</p>
  
  <pre><code>Function "puts" not defined.
  Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
  /root/script:5: Error in sourced command file:
  No breakpoint number 1.
  </code></pre>
  
  <p>How can I set breakpoint in script for library call?</p>