如何调试目标上的 stackoverflow 问题

发布于 2024-09-04 04:56:15 字数 64 浏览 8 评论 0原文

我想知道我们如何继续调试目标上的 STACKOVERFLOW 问题。 我的意思是我们应该遵循哪些步骤才能得出结论。

I want to know how do we proceed to debug a STACKOVERFLOW issue on targets .
I mean what are the steps we should follow to reach a conclusion.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

魂归处 2024-09-11 04:56:15

将一个单词的内存写入观察点放置在堆栈空间末尾之后。然后,当该位置被写入时,调试器将中断,您可以看到出了什么问题。

Put a memory write watchpoint for one word past the end of your stack space. Then the debugger will break in when that spot gets written to, and you can see what's at fault.

愿得七秒忆 2024-09-11 04:56:15

所有堆栈都可以在启动时填充特定的十六进制值(例如 0xAAAAAAAA)。然后使用特殊例程,您可以通过计算堆栈末尾已知值(0xAA..)的数量来定期监视所有堆栈的最大使用量,直到找到第一个差异。

All stacks can be filled at start up with certain hex value (for example 0xAAAAAAAA). And then using special routine you can monitor all stack's maximum usage periodically by calculating the quantity of known values (0xAA..) from end of stack until finds the first difference.

回眸一遍 2024-09-11 04:56:15

通过 gdb 等调试器运行它。堆栈溢出时的回溯将准确地告诉您哪个或哪些函数正在无限重复。从那里,找出这些函数的哪些输入没有改变,并且不将函数(如果是递归的)移向将结束递归的基本情况。

Run it through a debugger such as gdb. The backtrace at the time of the stack overflow will tell you exactly which function or functions are repeating indefinitely. From there, figure out which input(s) to those functions are not changing, and not moving the function (if it's recursive) towards a base-case that will end the recursion.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文