节目接收信号SIGTRAP,跟踪/断点陷阱 [英] Program received signal SIGTRAP, Trace/breakpoint trap

查看:4210
本文介绍了节目接收信号SIGTRAP,跟踪/断点陷阱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我调试一块(嵌入式)软件。我给自己定一个函数断点,出于某种原因,一旦我达到这个断点和继续我总是回来的功能(这是一个初始化函数这应该只能被调用一次)。当我删除了断点,继续,GDB告诉我:

I'm debugging a piece of (embedded) software. I've set a breakpoint on a function, and for some reason, once I've reached that breakpoint and continue I always come back to the function (which is an initialisation function which should only be called once). When I remove the breakpoint, and continue, GDB tells me:

程序接收到的信号SIGTRAP,跟踪/断点陷阱。

由于我与断点的工作,我假设我在一个断点陷阱下跌。什么是断点陷阱?

Since I was working with breakpoints, I'm assuming I fell in a "breakpoint trap". What is a breakpoint trap?

推荐答案

断点陷阱仅仅意味着处理器已达到一个断点。有两种可能性,为什么发生这种情况。最有可能的,你的初始code被击中,因为你的CPU被复位,并再次击中断点。另一种可能性是,该code你设置断点比初始化其他地方的实际运行。有时,通过积极的编译器优化它可以是很难判断到底是哪code断点映射到和路径可以到达那里它执行。

Breakpoint trap just means the processor has hit a breakpoint. There are two possibilities for why this is happening. Most likely, your initialization code is being hit because your CPU is resetting and hitting the breakpoint again. The other possibility would be that the code where you set the breakpoint is actually run in places other than initialization. Sometimes with aggressive compiler optimization it can be hard to tell exactly which code your breakpoint maps to and which execution paths can get there.

这篇关于节目接收信号SIGTRAP,跟踪/断点陷阱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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