在Emacs里面使用gdb-many-windows调试,非常方便。但是有时候碰到复杂的局部变量,gdb-mi会无法显示,并报错:Stack overflow in regexp matcher。
不能显示局部变量问题不大,大不了手工使用p命令。问题是之后gdb-mi的状态就乱掉了,无法继续调试,非常烦人。
终于,使用下面的patch,一切都平静了……
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 27846ed..d147b82 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -4022,7 +4022,7 @@ member." ;; Don't display values of arrays or structures. ;; These can be expanded using gud-watch. (defun gdb-locals-handler-custom () - (let ((locals-list (bindat-get-field (gdb-json-partial-output) 'locals)) + (let ((locals-list (bindat-get-field (ignore-errors (gdb-json-partial-output)) 'locals)) (table (make-gdb-table))) (dolist (local locals-list) (let ((name (bindat-get-field local 'name))
相关内容:http://lists.gnu.org/archive/html/emacs-devel/2015-02/msg01265.html