我有这个简单的C ++程序
#include <iostream>
using namespace std
int main() {
cout << "Hello" << endl;
return 0;
}
该程序不会发生段错误。
我像这样运行gdb:
gdb a.out
break main
run
target record
record save
s
record stop
c
quit
然后我再次调用gdb:
gdb
record restore gdb_record.21158
[New LWP 21158]
Core was generated by `a.out'.
Program terminated with signal 5, Trace/breakpoint trap.
\#0 0x08048617 in ?? ()
Segmentation fault