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

推荐答案

set print elements 0

From the GDB manual:

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.

C++相关问答推荐

为什么getchar()挂起了,尽管poll()返回了一个好的值?""

括号中的堆栈实现错误问题

为什么C语言允许你使用var =(struct NAME){

C由四个8位整数组成无符号32位整数

如何在不使用其他数组或字符串的情况下交换字符串中的两个单词?

如何在C中使printf不刷新标准输出?

C中函数类型的前向声明

将uintptr_t添加到指针是否对称?

解决S随机内存分配问题,实现跨进程高效数据共享

我的C函数起作用了,但我不确定为什么

C:在编译时构建和使用字符串文字的预处理器宏?

这段代码用于在C中以相反的顺序打印数组,但它不起作用

pthread_create的用法

如果格式字符串的内存与printf的一个参数共享,会发生什么情况?

带有数组指针的 struct 在print_stack()函数中打印随机数

为什么GCC 13没有显示正确的二进制表示法?

在NASM中链接Linux共享库时出错-';将R_ X86_64_;foo';

中位数和众数不正确

C语言程序流程解释

如何确定 C 程序中的可用堆内存