title: gdb No source file named input.c
body: <p>I'm trying to debug <a href="https://ftp.osuosl.org/pub/blfs/conglomeration/graphviz/" rel="nofollow noreferrer">Graphviz 2.34.0</a> after having built it from source with configure+make.</p>
  
  <p>Here is the gdb script I'm using:</p>
  
  <pre><code>####################
  # Pagination = off #
  ####################
  set pagination off
  
  #######################
  # Initial breakpoints #
  ####################### 
  dir /home/oren/GIT/klee/benchmarks/graphviz/graphviz-2.34.0/lib/cgraph
  dir /home/oren/GIT/klee/benchmarks/graphviz/graphviz-2.34.0/lib/common
  start
  break input.c:570
  break grammar.c:1281
  break dot.c:210
  run
  </code></pre>
  
  <p>But for some reason gdb fails to add 2 of the 3 breakpoints.
  (at first it looked like <a href="https://stackoverflow.com/questions/47388639/problems-with-setting-breakpoints-in-a-gdb-sciprt">this post</a> but I've added the start and no change):</p>
  
  <pre><code>No source file named input.c.
  Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
  No source file named grammar.c.
  Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
  </code></pre>
  
  <p>When I try to stepi my way through I get this:</p>
  
  <pre><code>210     while ((G = gvNextInputGraph(Gvc))) {
  (gdb) stepi
  0x0000000000400fba  210     while ((G = gvNextInputGraph(Gvc))) {
  (gdb) stepi
  0x0000000000400be0 in gvNextInputGraph@plt ()
  (gdb) stepi
  0x0000000000400be6 in gvNextInputGraph@plt ()
  (gdb) stepi
  0x0000000000400beb in gvNextInputGraph@plt ()
  (gdb) stepi
  0x0000000000400b80 in ?? ()
  (gdb) stepi
  0x0000000000400b86 in ?? ()
  </code></pre>
  
  <p>Any help is very much appreciated, thanks!</p>
  
  <h1>EDIT:</h1>
  
  <p>I tried building without shared libraries with:</p>
  
  <pre><code>../graphviz-2.34.0/configure --disable-shared
  </code></pre>
  
  <p>And the package builds without errors, but some executables (including mine) are missing. So I guess this option is not on the table (?)
  After that I tried setting the variable LD_BIND_NOW:</p>
  
  <pre><code>LD_BIND_NOW=1 gdb -x ./gdbCommands.txt --args ./build2/cmd/dot/.libs/dot -Tjpeg -oInput.jpeg Input.txt
  </code></pre>
  
  <p>And then I get (with either step or stepi):</p>
  
  <pre><code>(gdb) stepi
  0x0000000000400fba  210     while ((G = gvNextInputGraph(Gvc))) {
  (gdb) 
  0x0000000000400be0 in gvNextInputGraph@plt ()
  (gdb) 
  0x00007ffff7b7e200 in gvNextInputGraph () from /usr/lib/libgvc.so.6
  (gdb) 
  0x00007ffff7b7e202 in gvNextInputGraph () from /usr/lib/libgvc.so.6
  </code></pre>
  
  <p>Then I also ask info sharedlibrary and get:</p>
  
  <pre><code>(gdb) info sharedlibrary
  From                To                  Syms Read   Shared Object Library
  0x00007ffff7ddab00  0x00007ffff7df5660  Yes         /lib64/ld-linux-x86-64.so.2
  0x00007ffff7b601a0  0x00007ffff7bb04b8  Yes (*)     /usr/lib/libgvc.so.6
  0x00007ffff792e310  0x00007ffff7938722  Yes (*)     /usr/lib/libcgraph.so.6
  (*): Shared library is missing debugging information.
  </code></pre>