gpt4 book ai didi

c - 为什么我在 gdb 回溯中看不到行号?

转载 作者:太空宇宙 更新时间:2023-11-04 04:11:51 25 4
gpt4 key购买 nike

我在 gdb 中看不到行号。我用 mpiicc 编译了所有带有 -g 标志的东西。

对于我来说,即使是断点,gdb 也不显示行号。

可能问题出在“缺少单独的调试信息,使用:debuginfo-install glibc-2.12-1.166.el6_7.7.x86_64 numactl-2.0.9-2.el6.x86_64”,但我不是 super 用户,所以我无法安装这些。

 gdb  --args ./central -g 5 51
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-83.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/dslavchev/NuclearTesting/MPI/project-a-test-mpi/central...done.
(gdb) break direct.c:55
Breakpoint 1 at 0x40855d: file direct.c, line 55.
(gdb) l direct.c:55
50
51 void direct(int* N, double **PA, Coord **points)
52 {
53 int i ,j ,k ,l, ir, irr,
54 md = suma(N , NUM_AIRFOILS) - NUM_AIRFOILS,
55 m;
56 double *D, // **D,
57 *A, *sv;
58
59 int matrix_size_D = md*md;
(gdb) r
Starting program: /home/dslavchev/NuclearTesting/MPI/project-a-test-mpi/central -g 5 51
[Thread debugging using libthread_db enabled]

Breakpoint 1, 0x000000000040855d in direct ()
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.166.el6_7.7.x86_64 numactl-2.0.9-2.el6.x86_64
(gdb) bt
#0 0x000000000040855d in direct ()
#1 0x0000000000405ee9 in main ()
(gdb) s
Single stepping until exit from function direct,
which has no line number information.
PMPI_Comm_size (comm=1140850688, size=0x7fffffffc240) at ../../src/mpi/comm/comm_size.c:57
57 ../../src/mpi/comm/comm_size.c: No such file or directory.
in ../../src/mpi/comm/comm_size.c
(gdb) s
65 in ../../src/mpi/comm/comm_size.c
(gdb) s
57 in ../../src/mpi/comm/comm_size.c
(gdb)
58 in ../../src/mpi/comm/comm_size.c
(gdb)
59 in ../../src/mpi/comm/comm_size.c
(gdb)
65 in ../../src/mpi/comm/comm_size.c
(gdb)

这也是构建命令:

mpiicc -g -c -o central.o central.c -qopenmp 
mpiicc -g -c -o contours.o contours.c -qopenmp
mpiicc -g -c -o mymath.o mymath.c -qopenmp
mpiicc -g -c -o vort.o vort.c -qopenmp
mpiicc -g -qopenmp -I/opt/intel/parallel_studio_xe_2017.2.050/compilers_and_libraries_2017/linux/mkl/include -c -o direct.o direct.c
mpiicc -g -c -o a_liftarg.o a_liftarg.c -qopenmp
mpiicc -g -c -o psavel.o psavel.c -qopenmp
mpiicc -g -c -o euler.o euler.c -qopenmp
mpiicc -g -c -o streamline.o streamline.c -qopenmp
mpiicc -g -c -o speedmap.o speedmap.c -qopenmp
mpiicc -g -o central central.o contours.o mymath.o vort.o direct.o a_liftarg.o psavel.o euler.o streamline.o speedmap.o /opt/intel/parallel_studio_xe_2017.2.050/compilers_and_libraries_2017/linux/mkl/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group /opt/intel/parallel_studio_xe_2017.2.050/compilers_and_libraries_2017/linux/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/parallel_studio_xe_2017.2.050/compilers_and_libraries_2017/linux/mkl/lib/intel64/libmkl_intel_thread.a /opt/intel/parallel_studio_xe_2017.2.050/compilers_and_libraries_2017/linux/mkl/lib/intel64/libmkl_core.a /opt/intel/parallel_studio_xe_2017.2.050/compilers_and_libraries_2017/linux/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group -liomp5 -lpthread -lm -ldl -qopenmp

最佳答案

May be the problem is

不:问题不在于(libc 中定义了maindirect)。

这似乎是 GDB 中的一个错误:在执行 run 之前,它清楚地知道地址 0x40855d 对应于 direct.c,第 55 行.

但是在 run 之后,它以某种方式忘记了它知道这一点。

您的 GDB 版本也有 9 年历史。作为第一步,我建议构建一个当前版本 ( 8.3 as of today )。

关于c - 为什么我在 gdb 回溯中看不到行号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56365312/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com