3

I would like the command gdb on program X to instead switch to an existing debugging session of X if it already exists instead of signalling an error "This program is already being debugged" in gud-common-init.

I believe this is important as it makes the behaviour of gdb harmonize with the standard behaviour of most other Emacs interactions such as, find-file, switch-to-buffer etc, thus creating less confusion to the user.

So far I have modified the line containing

(error "This program is already being debugged"))

to instead do

(message "This program is already being debugged")

to at least prevent the error from arising. However, the function gdb does some extra initializations that should not be needed that causes some unnecessary delays. Is this a todo item or have I missed some gud/gdb-function that does this already?

Many thanks in advance, Per Nordlöw

4

1 回答 1

0

您可以随时重命名缓冲区。这就是我可以在同一个可执行文件上运行多个 gdb 会话的方式。它不是自动的,但它是一种有效的解决方法。

例如,如果我的可执行文件名为 pump,那么在运行 gdb 时,将生成一个名为*gud-pump*的缓冲区,它代表 gdb 会话。从这个缓冲区做meta-x rename-buffer *gud-pump1*

然后再次调用 gdb,您将拥有两个 GUD 会话,一个*gud-pump**gud-pump1*。会话是分开的,不应相互干扰(尽管它们可以交互)。

于 2012-07-20T11:59:28.163 回答