我試圖通過GDB類中步入一個方法。所以目前,我的gdb適用於獨立函數。但是,當我嘗試進入某種方法時,我可以將它們融入其中,但它並未涉足。這裏是我的腳本:無法步入一個類的方法GDB
#include <iostream>
using namespace std;
class test{
public:
void say_hello(){
cout<< "hello";
}
};
int main(){
test t;
t.say_hello();
return 0;
}
這是gdb在我按下運行「運行」命令後吐出的東西。
warning: `/BinaryCache/coreTLS/coreTLS-35.40.1~1/Objects/coretls.build/coretls.build/Objects-normal/x86_64/system_coretls_vers.o': can't open to read symbols: No such file or directory.
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_ciphersuites.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_handshake.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_record.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_stream_parser.a"
這裏發生了什麼,當我嘗試步:
Breakpoint 1, main() at test.cpp:13
13 t.say_hello();
(gdb) s
14 return 0;
(gdb)
0x00007fff91eec5c9 in start() from /usr/lib/system/libdyld.dylib
(gdb)
Single stepping until exit from function start,
which has no line number information.
hello[Inferior 1 (process 9896) exited normally]
如果這有什麼差別,當我運行的g ++ --version,我得到蘋果LLVM 7.0.0版。 謝謝。
不熟悉的g ++,但簡單的成員函數的特定版本特意去內聯。你在編譯優化嗎? –
沒有,我做的是G ++ -g TEST.CPP,然後GDB的a.out –
使用與Fedora Linux系統我看它一步成員函數的cout語句G ++ --version 5.1.1您編譯行。對不起,如此有用。 –