我想我大概會在只有多一點挖的時候已經回答了我自己的問題,但第一個gdb的解決方案,而把它從我的舊學前。我回過神來,所以..
C-H B C-S主要
後有點滾動,我們可以找出的「通信情報,送輸入」作爲必然鍵「進入」功能。看着這個功能的源代碼,comint.el:1765是「運行鉤與-ARGS」 ..this一個電話就是我們認識到,沒有什麼地方特別是「PDB」做我們想要的。
GUD是一個通用的包裝來調用外部調試過程並返回結果..hence控制是不存在的elisp的。它是用gdb相同,但有圍繞這使得告知該功能覺得「乾淨」外部調用一個不錯的(預先存在的)包裝。
所以黑客..只是上面的 '通信情報,發送輸入' 謊言 'COMINT-添加到輸入歷史' ..容易死人。
;;save command history
(defadvice comint-add-to-input-history (before pdb-save-history activate compile)
"write input ring on exit"
(message "%s" cmd)
(if (string-match "^e\\(x\\|xi\\|xit\\)?$" cmd)
(progn (comint-write-input-ring)
(message "history file '%s' written" comint-input-ring-file-name)))
)
僅供參考,我有這些是開始爲調試會話
;#debugger history
(defun debug-history-ring (file)
(comint-read-input-ring t)
(setq comint-input-ring-file-name file)
(setq comint-input-ring-size 1000)
(setq comint-input-ignoredups t))
(let ((hooks '((gdb-mode-hook . (lambda() (debug-history-ring "~/.gdbhist")))
(pdb-mode-hook . (lambda() (debug-history-ring "~/.pythonhist"))))))
(dolist (hook hooks) (print (cdr hook)) (add-hook (car hook) (cdr hook))))
..和輸入環寫入歷史文件,如果調試緩衝區被殺害
(add-hook 'kill-buffer-hook 'comint-write-input-ring)
乾杯。
一張字條:「GDB-發送項目」從emacs的去除(23.3)和現在(24.3)之間的地方,那麼,而是簡單地在答案的建議合併上面的字符串匹配下面有我的emacs GUD/GDB並再次同步外部gdb歷史記錄 – elbeardmorez 2013-05-03 07:09:40