在Clion的调试器中,如何显示int数组的全部内容 [英] In Clion's debugger, how do I show the entire contents of an int array

查看:801
本文介绍了在Clion的调试器中,如何显示int数组的全部内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,它仅显示数组的第一个元素,但我希望看到数组中的所有元素。我认为Clion正在使用GDB。

Right now it is only showing the first element of the array but I want a visual of all the elements in the array. I think Clion is using GDB.

编辑:我指的是堆上的数组。堆栈上的阵列可以可视化。

I am referring specifically to arrays on the heap. Arrays on the stack can be visualised.

推荐答案

不幸的是,CLion当前不支持该功能。按照JetBrains员工建议,您可以使用解决方法。在评估/监视窗口中,使用以下表达式:

Unfortunately, CLion doesn't currently support such feature. As suggested by JetBrains employee, you can use a workaround. In Evaluate / Watches window use the following expression:

(MyType[128])myArray

您可以使用任意数组大小;

You can use arbitrary array size; whatever works for you.

如果数组存储在 void * 变量中,则需要做一些更棘手的事情:

If you array is stored in void * variable, you need to do something more tricky:

(MyType[128])*(char*)myArray

请支持此问题,以增加获得真正解决方案的机会。您可以通过点击页面右侧的小拇指图标来实现。

Please upvote this issue, to increase the chance of getting a real solution. You do this by clicking the tiny thumb-up icon on the right side of the page.

这篇关于在Clion的调试器中,如何显示int数组的全部内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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