如何直观地描绘内存中的堆栈?
这是一个由两部分组成的问题:
我想知道是否有人知道有任何免费的工具/应用程序来设计内存堆栈的可视化应用程序?其中包括堆栈信息(例如堆栈指针、返回地址、变量、帧指针...)。我听说 Multi(Green Hills)可能会这样做,但是当我检查他们的网站时,他们似乎没有提供这样的功能。如果你想不出一个程序可以完成我所要求的任务,那么我将从你能找到的包含堆栈信息的最佳图像中受益(我在谷歌上搜索过“内存堆栈图像”,但它们都非常不同)寻找)。
我对 C 编程语言完全陌生,正在尝试执行上述操作。因此,我的第一个问题的结果是如何找到所有堆栈信息以将其转换为可视格式?我这样做是为了完成一项课堂作业,并且相信 GDB 可能能够完成这个任务。我仍在学习如何使用 GDB(已经阅读了一些指南),所以如果有人知道如何使用它来查找程序中执行的每个步骤的所有变量、返回地址、指针等每个堆栈帧,那就太棒了。如果您知道另一个可以简单地完成此任务的工具,那么我很愿意了解它以及如何使用它。
非常感谢!
注意:我在该网站上发现了一些类似的问题,但其中一些问题要么没有得到解答,要么得到了模糊的答复。我希望有人能花几分钟详细解释一下,特别是问题 2。
操作系统:Linux (Ubuntu) 编程语言:C
This is a two-part question:
I was wondering if anyone knew of any FREE tools/applications to design visual applications of memory stacks? Of which would include stack information (e.g. stack pointers, return addresses, variables, frame pointers...). I've heard Multi (Green Hills) might do this, but when I've checked their website it didn't seem as if they offered such a feature. If you can't think of a program that can do what I'm asking, then I would benefit from the best image you can find that includes stack information (I've Googled "memory stack images," but they are all very different looking).
I'm completely new to the C programming language and am trying to do the above. As such, a consequence of my first question is how do I find out all the stack information for me to put into a visual format? I'm doing this for a class assignment and believe that GDB might be able to accomplish this. I'm still learning how to use GDB (have read a couple of guides already), so if anyone knows how to use it to find out all the variables, return addresses, pointers, and so forth for each step in a program executing through each stack frame, that would be awesome. If you know another tool that can accomplish this simply however, then I'd be open to hearing about it and how to use it.
Thanks so much!
Note: I found some similar questions addressed on this site, but must of them either weren't answered or were vaguely answered. I hope someone out there has a few minutes to detail an explanation, particularly for question 2.
Operating System: Linux (Ubuntu)
Programming Language: C
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几点:
[http://pages.cs.wisc.edu/~bart/DynStackwalker.pdf][1]。
A couple of points:
[http://pages.cs.wisc.edu/~bart/DynStackwalker.pdf][1]