Convert a libc backtrace to a source line number

前端 未结 1 1647
一向
一向 2021-02-07 03:56

I have an MPI application with which combines both C and Fortran sources. Occasionally it crashes due to a memory related bug, but I am having trouble finding the bug (it is som

相关标签:
1条回答
  • 2021-02-07 04:29

    If you are in gdb and you have debugging symbols, it is quite easy. Use list.

    (gdb) list *0x804d5ce
    

    This should give you the line of code, and show you the source if it is able to find the source file.

    Without gdb you could try to use addr2line:

    $ addr2line -e finite_element 0x804d5ce
    
    0 讨论(0)
提交回复
热议问题