From 8d3803dfa7baf0c2f05e39c77a3392ee8ca7d058 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Thu, 24 Sep 2009 10:33:23 +0000 Subject: [PATCH] (gdb-jsonify-buffer): Catch log stream output. (gdb-init-2): Fortran requires list MAIN__ to find source buffer. (gdb-jsonify-buffer): Handle case where "=" is part of value string. --- lisp/progmodes/gdb-ui.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index d038f01b0ef..f26eff183e2 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -732,6 +732,7 @@ otherwise do not." ;; Find source file and compilation directory here. ;; Works for C, C++, Fortran and Ada but not Java (GDB 6.4) (gdb-enqueue-input (list "server list\n" 'ignore)) + (gdb-enqueue-input (list "server list MAIN__\n" 'ignore)) (gdb-enqueue-input (list "server info source\n" 'gdb-source-info))) (defun gdb-get-version () @@ -1824,7 +1825,6 @@ incompatible with GDB/MI output syntax." (save-excursion (while (re-search-forward (concat "[\\[,]\\(" fix-key "=\\)") nil t) (replace-match "" nil nil nil 1)))) - ;; Emacs bug #3794 (when fix-list (save-excursion ;; Find positions of braces which enclose broken list @@ -1842,9 +1842,9 @@ incompatible with GDB/MI output syntax." (insert "]")))))) (goto-char (point-min)) (insert "{") - ;; TODO: This breaks badly with foo= inside constants - (while (re-search-forward "\\([[:alpha:]-_]+\\)=" nil t) - (replace-match "\"\\1\":" nil nil)) + (while (re-search-forward + "\\([[:alnum:]-_]+\\)=\\(\\[\\|\"\"\\|\".*?[^\\]\"\\)" nil t) + (replace-match "\"\\1\":\\2" nil nil)) (goto-char (point-max)) (insert "}"))) -- 2.39.2