gdb tracepoint 使用demo

这篇博客详细介绍了如何使用gdb的tracepoint功能进行调试。通过一个名为'demo'的实例,包括了'i.tracepoint.c'源代码,'Makefile'构建文件和具体的命令操作。博主还进行了测试,通过运行'./tracepoint',配合'gdbserver'和'gdb'客户端。然而,目前在tracepoint中查看局部变量存在一些问题,博主尚未找出解决办法。
摘要由CSDN通过智能技术生成

gdb对tracepoint的描述

In some applications, it is not feasible for the debugger to interrupt
the program's execution long enough for the developer to learn anything
helpful about its behavior.  If the program's correctness depends on
its real-time behavior, delays introduced by a debugger might cause the
program to change its behavior drastically, or perhaps fail, even when
the code itself is correct.  It is useful to be able to observe the
program's behavior without interrupting it.


I.demo
i.tracepoint.c

#include <stdio.h>
#include <unistd.h>

int indx;

int main(int argc, char *argv[])
{
    int res;

    indx = 0;
    while ( indx < 10000 ) {
        res = indx * 2;
        printf("%d\n", res);
        sleep(1);
        indx++;
    }

    return 0;
}


ii.Makefile


                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值