有什么方法可以找到分配给 Ubuntu 中的应用程序的堆和堆栈的地址范围?

is there any way to find address range of heap and stack allocated to an application in Ubuntu?

有什么办法可以找到分配给Ubuntu中的应用程序的堆和栈的地址范围? 我希望 Valgrind 或 Valgrind 的插件可以帮助我,但我没有找到它。

在 Linux 上,您可以检查 /proc/[pid]/maps 包含当前映射到进程的区域的文件。该文件还有用于主进程堆栈的特殊部分 [stack],用于线程 tid 堆栈的 [stack:<tid>] 和用于进程堆的 [heap]。有关详细信息,请参阅 man 5 proc