我正在RHEL7中构建我的ProC代码,并将其部署到RHEL6服务器。它工作正常,但我无法正确gdb。它说-“单步执行直到从函数退出,该函数没有行号信息。”
如果我在RHEL7服务器中进行部署,则不会看到此错误,并且可以逐行执行gdb。
当gdb在RHEL6中已部署的应用程序中运行时:
$> gdb progname
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-92.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 progname...done.
(gdb) b progname.c:main
Breakpoint 1 at 0x8048fe8
(gdb) run arguments
Starting program: progname argments
[Thread debugging using libthread_db enabled]
Breakpoint 1, 0x08048fe8 in main ()
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.212.el6.i686
(gdb) n
*Single stepping until exit from function main,
which has no line number information.*
当gdb在已部署的RHEL7应用程序中运行时,我们将看到以下结果,这在RHEL6版本中也是预期的
$> gdb progname
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1
Copyright (C) 2013 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 progname...done.
(gdb) b progname.c:main
Breakpoint 1 at 0x8048ff1: file progname.c, line 87.
(gdb) run arguments
Starting program: progname arguments
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
Breakpoint 1, main (argc=8, argv=0xffffbd14) at progname.c:87
87 progname.c:
Missing separate debuginfos, use: debuginfo-install glibc-2.17-196.el7_4.2.i686 libgcc-4.8.5-16.el7_4.3.i686 libstdc++-4.8.5-16.el7_4.3.i686
(gdb) n
88 in /progname.c
答案 0 :(得分:1)
我正在RHEL7中构建我的ProC代码,并将其部署到RHEL6服务器。
那只能是偶然的,并且可以随时中断。
我无法正确gdb
您在RHEL6上使用的是较旧的GDB,可能无法理解RHEL7编译器创建的某些调试信息。
您可以尝试在RHEL6上构建GDB的新版本,并使用它。