1
我在下面寫了一個非常小的prog來添加兩個整數來檢查跟蹤點的使用情況。設置跟蹤點但無法找到跟蹤數據,因爲tfind顯示「目標無法找到請求的跟蹤幀」。
1 #include<stdio.h>
2 main(){
3 int x,y,sum;
4 x = 3;
5 y = 4;
6 sum = x + y;
7 printf("sum = %d\n",sum);
8 }
一個終端上,我跑gdbserver的爲:
$ gdbserver :10000 ./chk
Process ./chk created;
pid = 13956
Listening on port 10000
Remote debugging from host 127.0.0.1
在其他終端,我跑的gdb爲:
$ gdb -ex 'target remote :10000' ./chk
,然後將下面的步驟如下所示:
(gdb) trace chk.c:6
Tracepoint 1 at 0x80483fd: file chk.c, line 6.
(gdb) passcount 1 1
Setting tracepoint 1's passcount to 1
(gdb) actions 1
Enter actions for tracepoint 1, one per line.
End with a line saying just "end".
>collect $regs
>end
(gdb) tstart
(gdb) tstatus
Trace is running on the target.
Collected 0 trace frames.
Trace buffer has 5242880 bytes of 5242880 bytes free (0% full).
Trace will stop if GDB disconnects.
Not looking at any trace frame.
(gdb) tstop
(gdb) tfind
Target failed to find requested trace frame.
(gdb) tdump
warning: No current trace frame.
任何人都可以請讓我知道爲什麼tstatus,tfind和tdump給我這樣一個輸出?這裏有什麼問題?我如何檢查跟蹤的價值(我在這裏給出的$ regs)?