0

我记得 CGDB 能够在它的 GDB 窗口中换行,但是在客户端的机器上,我几乎无法控制它,它只会剪掉所有不适合的东西——而在同一台机器上,纯 GDB 会换行.

我知道有问题的 GDB 窗口可以使用 PgUp/PgDn 垂直滚动,但问题是我无法查看 long std::string-s 的内容或查看类方法的全名。

那么,我该如何水平滚动它——或者恢复正常的换行模式呢?

$ gdb --version
GNU gdb (GDB) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ cgdb --version
CGDB 20210810
Copyright 2002-2019 Bob Rossi and Mike Mueller.
CGDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for CGDB.

PS:set width <any number>从 GDB 窗口中似乎没有帮助,被完全忽略;show width,当在之前调用时set width,输出 4 个字符后的值:

<code here>  │GNU gdb (GDB) 10.1
<code here>  │Copyright (C) 2020 Free Software Foundation, Inc.
<code here>  │License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.ht
<code here>  |
<code here>  | ...
<code here>  |
<code here>  |(gdb) show width
<code here>  │Number of characters gdb thinks are in a line is 79.
<code here>  |
<code here>  | ...
<code here>  |
<code here>  │(gdb) quit
<code here>  │A debugging session is active.
<code here>  │
<code here>  │        Inferior 1 [process 20220] will be killed.
<code here>  │
<code here>  │Quit anyway? (y or n) y

$ wc -c <<<'License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.ht'
75

[UPD:]经过进一步调查,这看起来像是一个 CGDB 错误;修复(或仅仅是一种解决方法,如果没有 CGDB 开发人员审查就无法判断)就在这里

4

0 回答 0