set print elements number-of-elements
set print elements unlimited
Set a limit on how many elements of an array gdb will print. If gdb is printing
a large array, it stops printing after it has printed the number of elements set
by the set print elements command. This limit also applies to the display of
strings. When gdb starts, this limit is set to 200. Setting number-of-elements
to unlimited or zero means that the number of elements to print is unlimited.
show print elements
Display the number of elements of a large array that gdb will print. If the
number is 0, then the printing is unlimited.
set print elements 0
或
set print elements unlimited

本文介绍如何使用GDB调试器设置打印数组元素的数量限制,包括将限制设为无限,以及显示当前设置的元素数量。这对于调试大型数组时控制输出信息量非常有用。
571

被折叠的 条评论
为什么被折叠?



