免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3241 | 回复: 1
打印 上一主题 下一主题

[桌面系统] 我的emacs用GDB调试多个文件时,总是出错, [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-24 09:42 |只看该作者 |倒序浏览
我的emacs 是 GNU Emacs 22.2.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)

.emacs中的配置
;; gdb
(setq toolbar-mode t) ;display the gdb toolbar
(setq gdb-many-windows t) ;gdb many windows mode
(load-library "multi-gud.el")
(load-library "multi-gdb-ui.el")


调试单个文件的时候是没问题的,但是调试多个文件的时候就报错,不知道怎么回事?

单文件
Makefile sample sample.c sample.o semantic.cache
编译
g++ -g -c -o sample.o sample.c
g++ -g sample.o -o sample


多文件
Circle.cpp Circle.o makefigure.cpp Makefile Point.hpp semantic.cache
Circle.hpp makefigure makefigure.o Point.cpp Point.o
编译
g++ -g -c makefigure.cpp -o makefigure.o
g++ -g -c Circle.cpp -o Circle.o
g++ -g -c Point.cpp -o Point.o
g++ -g -o makefigure makefigure.o Circle.o Point.o



错误信息:
Debugger entered--Lisp error: (args-out-of-range 477 503)
match-string(1)
(cons (match-string 1) gdb-source-file-list)
(setq gdb-source-file-list (cons (match-string 1) gdb-source-file-list))
(push (match-string 1) gdb-source-file-list)
(save-current-buffer (set-buffer gud-comint-buffer) (push (match-string 1) gdb-source-file-list))
(with-current-buffer gud-comint-buffer (push (match-string 1) gdb-source-file-list))
(gdb-push (match-string 1) gdb-source-file-list)
(while (re-search-forward gdb-source-file-regexp-1 nil t) (gdb-push (match-string 1) gdb-source-file-list))
gdb-set-gud-minor-mode-existing-buffers-1()
funcall(gdb-set-gud-minor-mode-existing-buffers-1)
(save-current-buffer (set-buffer (gdb-get-buffer-create ...)) (funcall handler))
(with-current-buffer (gdb-get-buffer-create (quote gdb-partial-output-buffer)) (funcall handler))
(let ((handler ...)) (with-current-buffer (gdb-get-buffer-create ...) (funcall handler)))
(cond ((eq sink ...) t) ((eq sink ...) (setq gdb-output-sink ...) (let ... ...)) (t (gdb-resync) (error "Phase error in gdb-prompt (got %s)" sink)))
(let ((sink gdb-output-sink)) (cond (... t) (... ... ...) (t ... ...)))
(save-current-buffer (set-buffer gud-comint-buffer) (when gdb-first-prompt (gdb-force-mode-line-update ...) (gdb-init-1) (setq gdb-first-prompt nil)) (let (...) (cond ... ... ...)) (let (...) (if input ... ...)))
(with-current-buffer gud-comint-buffer (when gdb-first-prompt (gdb-force-mode-line-update ...) (gdb-init-1) (setq gdb-first-prompt nil)) (let (...) (cond ... ... ...)) (let (...) (if input ... ...)))
gdb-prompt("")
funcall(gdb-prompt "")
(if annotation-rule (funcall (car ...) annotation-arguments))
(let* ((annotation-type ...) (annotation-arguments ...) (annotation-rule ...)) (if annotation-rule (funcall ... annotation-arguments)))
(let ((annotation ...)) (setq output (gdb-concat-output output ...)) (setq gud-marker-acc (substring gud-marker-acc ...)) (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation) (let* (... ... ...) (if annotation-rule ...)))
(while (string-match "\n\\(.*\\)\n" gud-marker-acc) (let (...) (setq output ...) (setq gud-marker-acc ...) (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation) (let* ... ...)))
(let ((output "")) (while (string-match "\n\\(.*\\)\n" gud-marker-acc) (let ... ... ... ... ...)) (if (string-match "\n\\'\\|\n\\'\\|\n.*\\'" gud-marker-acc) (progn ... ...) (progn ... ...)) output)
(if (gdb-get gdb-flush-pending-output) nil (with-current-buffer gud-comint-buffer (when gdb-enable-debug ... ...)) (setq gud-marker-acc (concat gud-marker-acc string)) (let (...) (while ... ...) (if ... ... ...) output))
gud-gdba-marker-filter("\npre-prompt\n(gdb) \nprompt\n")
apply(gud-gdba-marker-filter "\npre-prompt\n(gdb) \nprompt\n")
gud-marker-filter("\npre-prompt\n(gdb) \nprompt\n")
(setq output (gud-marker-filter string))
(save-restriction (widen) (if (marker-buffer gud-delete-prompt-marker) (let ... ... ... ...)) (setq output (gud-marker-filter string)) (setq process-window (and gud-last-frame ... ...)))
(save-current-buffer (set-buffer (process-buffer proc)) (save-restriction (widen) (if ... ...) (setq output ...) (setq process-window ...)) (comint-output-filter proc output))
(with-current-buffer (process-buffer proc) (save-restriction (widen) (if ... ...) (setq output ...) (setq process-window ...)) (comint-output-filter proc output))
(let ((gud-filter-defer-flag t)) (if gud-filter-pending-text (setq string ... gud-filter-pending-text nil)) (with-current-buffer (process-buffer proc) (save-restriction ... ... ... ...) (comint-output-filter proc output)) (if process-window (with-selected-window process-window ...) (with-current-buffer ... ...)))
(if gud-filter-defer-flag (setq gud-filter-pending-text (concat ... string)) (let (...) (if gud-filter-pending-text ...) (with-current-buffer ... ... ...) (if process-window ... ...)) (if gud-filter-pending-text (gud-filter proc "")))
(if (buffer-name (process-buffer proc)) (if gud-filter-defer-flag (setq gud-filter-pending-text ...) (let ... ... ... ...) (if gud-filter-pending-text ...)))
(let (output process-window) (if (buffer-name ...) (if gud-filter-defer-flag ... ... ...)))
gud-filter(#<process gud-makefigure> "\npre-prompt\n(gdb) \nprompt\n")

[ 本帖最后由 newman0708 于 2009-7-24 11:20 编辑 ]

Screenshot.png (58.39 KB, 下载次数: 20)

Screenshot.png

Screenshot-1.png (50.65 KB, 下载次数: 20)

Screenshot-1.png

makefigure.rar

3.39 KB, 下载次数: 13

论坛徽章:
0
2 [报告]
发表于 2009-07-24 12:49 |只看该作者
找到原因了,和大家分享

;; gdb
  ;(setq toolbar-mode t) ;display the gdb toolbar
  (setq gdb-many-windows t) ;gdb many windows mode
  ;(load-library "multi-gud.el")                      ;把这行注释掉
  ;(load-library "multi-gdb-ui.el")                  ;把这行注释掉

就好了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP