如何使用德语语言环境在 gdb 中设置双变量?
How to set a double variable in gdb with German locale?
我正在用 gdb 调试我的 c++ 程序。由于德语语言环境,我很难设置一个简单的 double
变量。
gdb 不接受带小数点的值。使用德国小数点(逗号)输入,gdb 会忽略逗号后的所有内容。
(gdb) p this->foodSupply
= 1
(gdb) set this->foodSupply = 4.3
Ungültige Nummer »4.3«.
(gdb) p this->foodSupply
= 1
(gdb) set this->foodSupply = 4,3
(gdb) p this->foodSupply
= 4
我想我可以通过 运行 gdb 和 LC_ALL=EN gdb ...
来避免这个问题。
但是因为在我的 IDE 中工作并不那么容易,我想知道是否有其他方法。
德国用户如何在 gdb 中键入小数点?
看看这个错误:
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1341125
在那里可能会解释,为什么它不能像你想要的那样工作。
您可以尝试像
这样的解决方法
(gdb) set this->foodSupply = (double) 43/10
如果你的数字像 4.3 一样简单。
我正在用 gdb 调试我的 c++ 程序。由于德语语言环境,我很难设置一个简单的 double
变量。
gdb 不接受带小数点的值。使用德国小数点(逗号)输入,gdb 会忽略逗号后的所有内容。
(gdb) p this->foodSupply
= 1
(gdb) set this->foodSupply = 4.3
Ungültige Nummer »4.3«.
(gdb) p this->foodSupply
= 1
(gdb) set this->foodSupply = 4,3
(gdb) p this->foodSupply
= 4
我想我可以通过 运行 gdb 和 LC_ALL=EN gdb ...
来避免这个问题。
但是因为在我的 IDE 中工作并不那么容易,我想知道是否有其他方法。
德国用户如何在 gdb 中键入小数点?
看看这个错误:
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1341125
在那里可能会解释,为什么它不能像你想要的那样工作。
您可以尝试像
这样的解决方法(gdb) set this->foodSupply = (double) 43/10
如果你的数字像 4.3 一样简单。