我的gcc编译器由ubuntu提供: g ++(Ubuntu 5.4.0-6ubuntu1~16.04.9)5.4.0 20160609
gdb是vesion 7.11.1
二进制文件是用littools构建的。
当步进一个只有几行的简单测试C ++程序时,它会来回走动,最终它会一步一步走。如果你执行二进制文件,它没有执行它的问题。我想知道,这是我的编译器还是gdb的错误?这个问题可能非常罕见。我的ubuntu是Ubuntu 16.04.4 LTS。内核:4.4.0-128-通用。我之前从未遇到任何问题。当前的gdb可以使用continue命令完成程序而不会出现任何问题。
gdb /usr/local/bin/testrepeatrun
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/bin/testrepeatrun...done.
(gdb) b 9
Breakpoint 1 at 0x4018f4: file testrepeatrun.cpp, line 9.
(gdb) r
Starting program: /usr/local/bin/testrepeatrun
Breakpoint 1, main (argc=1, argv=0x7fffffffdd68) at testrepeatrun.cpp:9
9 string sA1 = "ACCCGTGTGGCCAGTCGTACGTGTACACTGACGTACGATCAGTC";
(gdb) next
8 int main(int argc, char* argv[]) {
(gdb) n
9 string sA1 = "ACCCGTGTGGCCAGTCGTACGTGTACACTGACGTACGATCAGTC";
(gdb) n
8 int main(int argc, char* argv[]) {
我的问题是接下来的问题。 9 - &gt; 8 - &gt; 9 - &gt; 10 ...... 15 - &gt; 17 - &gt; 15 - &gt; 17至少重复两次,然后转到下一行。