设置跟踪点但不能找到作为tfind的跟踪数据显示“目标无法找到请求的跟踪帧”。 [英] setting the tracepoints but not able to find the trace data as tfind shows "Target failed to find requested trace frame."

查看:174
本文介绍了设置跟踪点但不能找到作为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 \\\
,sum);
8}

在一个终端上,我运行gdbserver为:

  $ gdbserver:10000 ./chk 
过程./chk created;
pid = 13956
监听端口10000
从主机进行远程调试127.0.0.1

在其他终端上,我运行gdb为:

  $ gdb -ex'target remote:10000'.// chk 

然后按以下步骤操作:
$ b $
$ b $ (gdb)trace chk.c:6
0x80483fd的Tracepoint 1:file chk.c,line 6.

(gdb) passcount 1 1
将tracepoint 1的passcount设置为1

(gdb)actions 1
为tracepoint 1输入操作,每行一个。
以一行说结束结束。

> collect $ regs
> end
(gdb)tstart
(gdb)tstatus
Trace正在目标上运行。
收集0个跟踪帧。
跟踪缓冲区有5242880字节的5242880字节空闲(0%已满)。
如果GDB断开,跟踪将停止。
不看任何跟踪帧。

(gdb)tstop
(gdb)tfind
目标无法找到请求的跟踪帧。

(gdb)tdump
警告:没有当前跟踪帧。

任何人都可以让我知道为什么tstatus,tfind和tdump给我这样的输出?这里有什么问题?如何检查我的跟踪的值(我在这里给出的$ regs)?

解决方案


为什么tstatus,tfind和tdump给了我这样的输出


当你连接GDB时,低级(被调试)进程是停在 _start (即尚未达到主要)。



使用 tstart 开始追踪实验后,您需要继续执行下级,以便到达您的追踪点并自动停止跟踪(使用 continue GDB命令)。



相反,您立即停止实验(使用 tstop ),这会导致空迹线。


i wrote a very small prog below to add two integers just to check the usage of tracepoints.

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 }       

on one terminal, i ran gdbserver as :

$ gdbserver :10000 ./chk
Process ./chk created; 
pid = 13956
Listening on port 10000
Remote debugging from host 127.0.0.1

On other terminal,i ran gdb as :

$ gdb -ex 'target remote :10000' ./chk

and then the following steps as shown below :

(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.

Can anyone please let me know why tstatus,tfind and tdump are giving me such an output? What is the issue here? How can i check the value of my trace (which i have given here as $regs) ?

解决方案

why tstatus,tfind and tdump are giving me such an output

When you attach GDB, the inferior (being debugged) process is stopped in _start (i.e. has not reached main yet).

After you start the tracing experiment with tstart, you need to continue execution of the inferior, so it reaches your trace point, and automatically stops the trace (with continue GDB command).

Instead, you are stopping the experiment immediately (with tstop), which leads to empty trace.

这篇关于设置跟踪点但不能找到作为tfind的跟踪数据显示“目标无法找到请求的跟踪帧”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆