<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 16, 2015 at 1:35 PM, Song Gao <span dir="ltr"><<a href="mailto:song.gao2@mail.mcgill.ca" target="_blank">song.gao2@mail.mcgill.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear PETSc users,<div><br></div><div>I'm debugging my code but cannot see those line informations in gdb<br></div><div><br></div><div>I compiled PETSc with </div><div>--with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --with-debugging=yes</div><div><br></div><div>I modified my code from KSP ex1f.F and use that makefile.</div><div><br></div><div>Then compiled code </div><div>make PETSC_DIR=/home/cfd/sgao/bin/petsc-3.5.3 PETSC_ARCH=FEM_project_DEBUG ex1f</div><div>The log is attached, I see the -g flag there. But when I run code with gdb, I didn't see line information there.</div><div><br></div><div><br></div><div><div>$gdb ./ex1f</div><div>(gdb) b main</div><div>Breakpoint 1 at 0x4080e0: file ../../../gcc-4.3.0/libgfortran/fmain.c, line 11.</div></div></div></blockquote><div><br></div><div>main() is not the Fortran entry point. You might be better off working in C.</div><div><br></div><div>However, if you really want Fortran, try breaking at a line number in your file. Also</div><div>make sure you did not delete the *.o file</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>(gdb) r</div><div>Starting program: /home/cfd/sgao/FEM_in_CFD/code/ex1f </div><div>[Thread debugging using libthread_db enabled]</div><div><br></div><div>Breakpoint 1, main (argc=1, argv=0x7fffffffcc58) at ../../../gcc-4.3.0/libgfortran/fmain.c:11</div><div>11<span style="white-space:pre-wrap"> </span>../../../gcc-4.3.0/libgfortran/fmain.c: No such file or directory.</div><div><span style="white-space:pre-wrap"> </span>in ../../../gcc-4.3.0/libgfortran/fmain.c</div><div>(gdb) l</div><div>6<span style="white-space:pre-wrap"> </span>in ../../../gcc-4.3.0/libgfortran/fmain.c</div><div>(gdb) </div></div><div><br><br></div><div>What did I miss here? Thank you in advance.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Song<br></div></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>