如何在 gdb 中打印长字符串的完整值?

2024-04-15

我想在 GDB 中打印 C 字符串的完整长度。默认情况下它是缩写的,如何强制 GDB 打印整个字符串?


set print elements 0

来自GDB手册 https://sourceware.org/gdb/onlinedocs/gdb/Print-Settings.html#index-number-of-array-elements-to-print:

set print elements number-of-elements
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 zero means that the printing is unlimited.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 gdb 中打印长字符串的完整值? 的相关文章

随机推荐