每次程序到達特定行時,我想記錄一個局部變量的值,即t
。因此,我想:gdb:tstart錯誤的含義「當你的目標是'exec'時,你不能這樣做」
(gdb) trace stoer_wagner_min_cut.hpp :197 Tracepoint 1 at 0x4123a0: file ./boost/graph/stoer_wagner_min_cut.hpp, line 197. (gdb) actions Enter actions for tracepoint 1, one per line. End with a line saying just "end". > collect t > end (gdb) tstart You can't do that when your target is `exec' (gdb) break main Breakpoint 2 at 0x401448: file time_stoer_wagner.cpp, line 50. (gdb) run Starting program: C:\Users\Daniel\Documents\projects\stoer_wagner_min_cut/time_stoer_wagner.exe [New Thread 3908.0x39c] Breakpoint 2, main() at time_stoer_wagner.cpp:50 50 std::ifstream ifs("prgen_500_50_2.txt"); (gdb) tstart You can't do that when your target is `child'
但錯誤信息:「你不能這樣做,當你的目標是'高管「」和「你不能這樣做,當你的目標是'孩子」」也沒有什麼幫助對我來說。這些錯誤意味着什麼?
你爲什麼要使用'trace'上的本地程序?如果您的目標是更快地創建斷點+命令,似乎目前還沒有其他選擇,但未來可能會提供代碼注入功能:http://stackoverflow.com/a/31712150/895245 – 2015-07-31 14:40:55