如何使用德语语言环境在gdb中设置双变量
How to set a double variable in gdb with German locale?
我正在用gdb调试我的c++程序。由于德语环境的原因,我很难设置一个简单的double
变量。
gdb不会接受带小数点的值。gdb使用德语小数点(逗号)键入,忽略逗号后的所有内容。
(gdb) p this->foodSupply
$1 = 1
(gdb) set this->foodSupply = 4.3
Ungültige Nummer »4.3«.
(gdb) p this->foodSupply
$1 = 1
(gdb) set this->foodSupply = 4,3
(gdb) p this->foodSupply
$3 = 4
我想我可以通过使用LC_ALL=EN gdb ...
运行gdb来避免这个问题。但由于在IDE中工作并不容易,我想知道是否还有其他方法。
德国用户如何在gdb中键入小数点?
看看这个bug:
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1341125
也许可以解释一下,为什么它不能像你希望的那样工作。
你可以尝试像这样的变通方法
(gdb) set this->foodSupply = (double) 43/10
如果你的数字像4.3那么简单。
相关文章:
- 设置变量时C++程序挂起
- 从系统("command") (C++) 设置变量
- 在构造函数中设置变量失败?
- 如何为输入设置变量编号和__android_log_print格式
- 从输入文件 c++ 中提取和设置变量
- 使用 void 函数在主函数中设置变量的值
- 未在另一个函数中设置变量引用的问题
- 对于循环设置变量为条件
- 使用 argv 设置变量
- 为什么我的代码未设置变量
- 在C++中设置变量的值之前检查变量是否更好
- 在 if 语句中设置变量
- 在子类中设置变量
- 未设置变量并返回异常数字
- 如何设置变量的 char 数组的元素数量
- C++指针运行时错误 - 使用指针设置变量然后检索
- 从C++设置变量时 QML 内存泄漏
- 使用此功能在构造函数中设置变量
- 从函数设置变量时不会更改
- 类中的二传手不会设置变量