当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 2 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 我的emacs用GDB调试多个文件时,总是出错,
帖子发表于 : 2009-07-24 9:32 
头像

注册: 2007-09-22 13:09
帖子: 188
送出感谢: 0 次
接收感谢: 0 次
我的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")


附件:
文件注释: 调试的文件
makefigure.rar [3.39 KiB]
被下载 5 次
文件注释: 启动gdb调试单个文件就没问题,
Screenshot-1.png
Screenshot-1.png [ 53.44 KiB | 被浏览 515 次 ]

文件注释: 启动gdb调试多个文件就出问题,
Screenshot.png
Screenshot.png [ 62.17 KiB | 被浏览 515 次 ]

页首
 用户资料  
 
2 楼 
 文章标题 : Re: 我的emacs用GDB调试多个文件时,总是出错,
帖子发表于 : 2009-07-24 12:44 
头像

注册: 2007-09-22 13:09
帖子: 188
送出感谢: 0 次
接收感谢: 0 次
找到原因了,和大家分享

;; 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") ;把这行注释掉

就好了。


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 2 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:Sogou [Spider] 和 3 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译