在vscode中调试时,底部似乎有一个gdb控制台。目前我正在远程连接到gdbserver
,并且能够在断点处暂停。我希望能够在控制台中键入gdb命令。问题是,无论我键入什么,例如info sharedlibrary
,它都会打印以下内容:
info sharedlibrary
Cannot evaluate expression on the specified stack frame.
这不是gdb的直接接口。要使命令通过,您需要键入-exec
。错误信息令人痛苦地困惑。
-exec info sharedlibrary
...
事实上,以下内容可以在同一控制台中找到,当有一堆其他输出时,很容易错过:
Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)