在 emacs 25.3.1 中,我对https://github.com/ptrv/emacs.d/blob/master/site-lisp/gud-lldb.el的运气更好。它还具有不尝试修补 gud.el 的优点。我是一个更加独立的解决方案。上下移动堆栈帧时,它也无法移动光标,但通过此更改它可以工作:
*** gud-lldb.el.orig 2017-12-11 17:22:08.000000000 -0700
--- gud-lldb.el 2017-11-18 11:52:55.000000000 -0700
***************
*** 64,73 ****
;; * thread #1: tid = 0x2e03, 0x0000000100000de8 a.out`c + 7 at main.c:39, stop reason = breakpoint 1.1, queue = com.apple.main-thread
(string-match " at \\([^:\n]*\\):\\([0-9]*\\), stop reason = .*\n"
gud-marker-acc start)
! ;; (lldb) frame select -r 1
! ;; frame #1: 0x0000000100000e09 a.out`main + 25 at main.c:44
! (string-match "^[ ]*frame.* at \\([^:\n]*\\):\\([0-9]*\\)\n"
! gud-marker-acc start))
;(message "gud-marker-acc matches our pattern....")
(setq gud-last-frame
(cons (match-string 1 gud-marker-acc)
--- 70,79 ----
;; * thread #1: tid = 0x2e03, 0x0000000100000de8 a.out`c + 7 at main.c:39, stop reason = breakpoint 1.1, queue = com.apple.main-thread
(string-match " at \\([^:\n]*\\):\\([0-9]*\\), stop reason = .*\n"
gud-marker-acc start)
! ;; cherry
! ;; (lldb) frame #1: 0x000000010013e29a sta`sta::PathEnumFaninVisitor::visitFromToPath(sta::Pin const*, sta::Vertex*, sta::TransRiseFall const*, sta::Tag*, sta::PathVertex*, sta::Edge*, sta::TimingArc*, float, sta::Vertex*, sta::TransRiseFall const*, sta::Tag*, float&, sta::MinMax const*, sta::PathAnalysisPt const*) + 986 at /Users/foobar/File.cc:348
! (string-match "^.*frame.* at \\([^:\n]*\\):\\([0-9]*\\)\n"
! gud-marker-acc start))
;(message "gud-marker-acc matches our pattern....")
(setq gud-last-frame
(cons (match-string 1 gud-marker-acc)