From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Larry Evans Newsgroups: gmane.emacs.help Subject: Re: (debug) backtrace: how to show source code at current location. Date: Wed, 05 Jan 2011 13:43:34 -0600 Message-ID: References: <4678E0C82C5D4DAB81AF90DFA7E07027@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000803050309010301060202" X-Trace: dough.gmane.org 1294256785 32760 80.91.229.12 (5 Jan 2011 19:46:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 Jan 2011 19:46:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 05 20:46:20 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PaZHd-0007sR-Mt for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Jan 2011 20:46:19 +0100 Original-Received: from localhost ([127.0.0.1]:56170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaZHW-0001aX-Vk for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Jan 2011 14:44:27 -0500 Original-Received: from [140.186.70.92] (port=39422 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaZH0-0001ZH-4o for help-gnu-emacs@gnu.org; Wed, 05 Jan 2011 14:43:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaZGy-0006aI-2A for help-gnu-emacs@gnu.org; Wed, 05 Jan 2011 14:43:53 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:51059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaZGx-0006aC-H7 for help-gnu-emacs@gnu.org; Wed, 05 Jan 2011 14:43:51 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PaZGu-0007Qp-Lw for help-gnu-emacs@gnu.org; Wed, 05 Jan 2011 20:43:48 +0100 Original-Received: from r74-192-28-166.bcstcmta01.clsttx.tl.dh.suddenlink.net ([74.192.28.166]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jan 2011 20:43:48 +0100 Original-Received: from cppljevans by r74-192-28-166.bcstcmta01.clsttx.tl.dh.suddenlink.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jan 2011 20:43:48 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 374 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: r74-192-28-166.bcstcmta01.clsttx.tl.dh.suddenlink.net User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Lightning/1.0b1 Thunderbird/3.0.6 In-Reply-To: <4678E0C82C5D4DAB81AF90DFA7E07027@us.oracle.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78223 Archived-At: This is a multi-part message in MIME format. --------------000803050309010301060202 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit On 01/05/11 13:06, Drew Adams wrote: >> Please, how can I find out what's causing this error message: >> >> "(wrong-type-argument arrayp tab)" > > From your error message alone, it seems that the symbol `tab' is being passed to > some function that expects an array. That's not much help yet, but things might > become clearer when you dig deeper using the debugger. > > (setq debug-on-error t) > > 1. Load source (*.el) files for the library where the error occurred. > > IOW, look at the `debug-on-error' backtrace to see which function(s) were > involved when the error occurred. Then use `C-h f' or `find-func' to find the > function definition(s) (source file(s)). Load the source file(s) (*.el) using > `load-file' or `load-library', including the extension `.el' in the name. > > 2. Provoke the error and backtrace again. It should now show more source-code > entry points instead of byte-code (the `(byte-code "ÁÂÃ...' stuff) > > 3. You can also use `M-x debug-on-entry THE-FUNCTION' to enter the debugger > whenever a problematic function is invoked. Then you can walk through the > invocation to see more about what caused the error. > > > Thank you very much for the help Drew. What I did was started with just: (setq debug-on-error t) as shown in the attachment (a revision of the one posted earlier). The started emacs; however, no backtrace appeared. OTOH, the *Messages* buffer contained: > Loading /home/evansl/.emacs.d/init.common.el (source)... > Loading /home/evansl/.recentf...done > Cleaning up the recentf list...done (0 removed) > Loading /usr/share/emacs/site-lisp/haskell-mode/haskell-site-file.el (source)...done > Loading /home/evansl/.emacs.d/init.common.el (source)...done > Loading desktop...done > Loading eldoc...done > uncompressing indent.el.gz...done > Note: file is write protected > Loading cc-mode...done > Note: file is write protected > c-tab-stop-my-list message > c++-mode-my-hook message:tabs= > (0 2 4) > c++-mode-my-hook message{ > File mode specification error: (wrong-type-argument arrayp tab) > Loading /usr/share/emacs/site-lisp/haskell-mode/haskell-mode.el (source)...done Is there something else I should do to get a backtrace? TIA. -regards, Larry --------------000803050309010301060202 Content-Type: text/x-emacs-lisp; name="init.common.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="init.common.el" ;;Purpose: ;; init file common to both emacs and xemacs ;; ;;================== ;;================================== ;; ChangeLog:2009-11-08 ;; The following is based on instructions from: ;; ;; http://www.gnu.org/software/cflow/manual/cflow.html#Emacs ;; ;;(autoload 'cflow-mode "cflow-mode") ;;(setq auto-mode-alist (append auto-mode-alist ;; '(("\\.cflow$" . cflow-mode)))) ;;================================== ;(debug) ;;(load-file "/usr/share/emacs/site-lisp/cedet-common/cedet.el") ;;Above load-file according to http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html#sec2 ;;========>Desktop save<============ ;;;;Don't use the following desktop calls because ;;;;they seem to cause > to be indented 2 spaces ;;;;past where it's actually inserted in a .cpp file :( ;;(desktop-load-default) ;; ;; By default we starting in text mode. (setq initial-major-mode (lambda () (text-mode) (turn-on-auto-fill) (font-lock-mode 1) )) ;; Define function to match a parenthesis otherwise insert a % (defun match-paren (arg) "Go to the matching parenthesis if on parenthesis otherwise insert %." (interactive "p") (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) (t (self-insert-command (or arg 1))))) (global-set-key "%" 'match-paren) ;;======>save recent files<========= (recentf-mode t) ;; ;;(debug-on-entry 'run-hooks ) ;;(debug-on-entry 'c++-mode-my-hook ) ;;=================================== ;; ChangeLog:2010-12-08.1616 ;; As instructed by: ;; http://haskell.org/haskellwiki/Haskell_mode_for_Emacs#Setup ;; ChangeLog:2011-01-05.1326 ;; Because getting error about ;; turn-on-haskell-indentation ;; being void, and seeing in: ;; /usr/share/emacs/site-lisp/haskell-mode/haskell-indent.el ;; the instruction: ;; (add-hook 'haskell-mode-hook 'turn-on-haskell-indent) ;; followed that instruction. ;; (load "/usr/share/emacs/site-lisp/haskell-mode/haskell-site-file") (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) (add-hook 'haskell-mode-hook 'turn-on-haskell-indent) ;;************2011-01-04.2219:copied from ../xemacs/custom.el********** ;;************************************ (defun c-electric-my-brace (arg) "my c-electric-brace. arg ignored. Only present because required by ?" (interactive "P") (self-insert-command (prefix-numeric-value arg)) ) ;;defun)c-electric-my-brace defun ;;************************************ (defun c-newline-indent-my-relative (arg) "insert newline and then indent relative" (interactive "P") (newline ) (indent-relative-maybe) ;;(message "indent-my-rel") ) ;;defun)c-newline-indent-my-relative ;;************************************ (defun c-insert-my-tab (arg) "insert a tab. arg is ignored" (interactive "P") (message "{insert tab") (move-to-tab-stop) (message "}insert tab") ) ;;defun)c-insert-my-tab ;;************************************ (defun c-insert-my-shift-tab (arg) "insert a shift-tab. arg is ignored" (interactive "P") (message "{insert shift-tab") (let ((tabs tab-stop-list) (new-column 0) ) (while (and tabs (< (car tabs) (current-column))) (setq new-column (car tabs)) (setq tabs (cdr tabs)) );end while (if tabs (move-to-column new-column t) );end if );end let (message "}insert shift-tab") ) ;;defun)c-insert-my-shift-tab ;;************************************ (defun c-tab-stop-my-list () "my tab-stop-list for c/c++ modes" (message "%s" "c-tab-stop-my-list message") (setq tab-stop-list (let ( (value) (tab-width 2) ) (dotimes (number 3 value) (setq value (append value (list (* number tab-width)) ; 1 element list ) ) ) ) ) ) ;;defun)c-tab-stop-my-list ;;************************************ (defun c++-mode-my-hook () "my c++-mode-hook" (c-tab-stop-my-list) (message "%s" "c++-mode-my-hook message:tabs=") (message "%s" tab-stop-list) (define-key c++-mode-map "\r" 'c-newline-indent-my-relative) (define-key c++-mode-map "<" 'self-insert-command) (define-key c++-mode-map ">" 'self-insert-command) (define-key c++-mode-map "(" 'self-insert-command) (define-key c++-mode-map ")" 'self-insert-command) (define-key c++-mode-map "{" 'self-insert-command) (define-key c++-mode-map "}" 'self-insert-command) (define-key c++-mode-map "/" 'self-insert-command) (define-key c++-mode-map "," 'self-insert-command) (define-key c++-mode-map ";" 'self-insert-command) (define-key c++-mode-map ":" 'self-insert-command) (message "%s" "c++-mode-my-hook message{") (setq debug-on-error t) (define-key c++-mode-map 'tab 'c-insert-my-tab) (message "%s" "c++-mode-my-hook message;") ;;(define-key c++-mode-map 'iso-left-tab 'c-insert-my-shift-tab) (message "%s" "c++-mode-my-hook message}") (setq indent-tabs-mode nil) ) ;;defun) c++-mode-my-hook (setq c++-mode-hook 'c++-mode-my-hook ) ;;the filename extension in the following is for Template definitions (setq auto-mode-alist (cons ( cons "\\.hpp\\'" 'c++-mode ) auto-mode-alist ) ) ;;the filename extension in the following is for Template definitions (setq auto-mode-alist (cons ( cons "\\.cpp\\'" 'c++-mode ) auto-mode-alist ) ) ;;the filename extension in the following is for Template definitions (setq auto-mode-alist (cons ( cons "\\.tpp\\'" 'c++-mode ) auto-mode-alist ) ) ;;the filename extension in the following is for Forward declarations (setq auto-mode-alist (cons ( cons "\\.fpp\\'" 'c++-mode ) auto-mode-alist ) ) ;;the filename extension in the following is for "simple" include files ;; i.e. files included in another file which is a .cpp or .hpp file (setq auto-mode-alist (cons ( cons "\\.ipp\\'" 'c++-mode ) auto-mode-alist ) ) ;;************************************ (defun text-mode-my-hook () "my text-mode-hook" ;; (message "text-mode-my-hook message") (c-tab-stop-my-list) (auto-fill-mode) (define-key text-mode-map "\r" 'c-newline-indent-my-relative) ) ;;defun) text-mode-my-hook (setq text-mode-hook 'text-mode-my-hook ) (setq auto-mode-alist (cons ( cons "\\.log\\'" 'text-mode ) auto-mode-alist ) ) (setq auto-mode-alist (cons ( cons "\\.pl\\'" 'text-mode ) auto-mode-alist ) ) (setq auto-mode-alist (cons ( cons "\\.pm\\'" 'text-mode ) auto-mode-alist ) ) (setq auto-mode-alist (cons ( cons "\\.g\\'" 'text-mode ) auto-mode-alist ) ) (setq auto-mode-alist (cons ( cons "\\.imk\\'" 'makefile-mode ) auto-mode-alist ) ) (setq auto-mode-alist (cons ( cons "\\.mk\\'" 'makefile-mode ) auto-mode-alist ) ) ;;************************************ (put 'narrow-to-region 'disabled nil) ;; The following copied from ../.emacs.d/Abrahams.emacs ; is it gnu emacs or xemacs (setq my-gnup (not (string-match "^\\(XEmacs\\).*" (emacs-version)))) ;; font-lock-mode is what implements syntax coloring and hilighting. (require 'font-lock) ; require forces the module to load right away. ;; ;; Override some of the default version-control behavior ;; (require 'vc-hooks) (defun my-vc-file-owner (file) ;; vc-mode doesn't seems overly strict in checking the writable status of ;; checked-out files: It wants the CVS username to be identical to the login ;; of the emacs user. This is problematic if you work with repositories where ;; your userID is different from your OS login. This is typical when working ;; with remote repositories. Here we just fake emacs into thinking that these ;; things always match. (vc-user-login-name)) ;; ;; Set defaults that will be picked up by various modes and other emacs packages. ;; (setq-default ;; "Electrify" a few keys in SGML-mode for editing HTML documents sgml-quick-keys t sgml-validate-command "gtidy" ; sgml-validate-command "tidy -i -wrap 78 --keep-time 0 --gnu-emacs 1 --gnu-emacs-file" ;; Tell me if I use M-x when there was a key binding for it teach-extended-commands-p t ;; Non-nil means truncate lines in all windows less than full frame wide. truncate-partial-width-windows nil ;; Show the file name in the buffer's mode-line ;; mode-line-buffer-identification '("%12b [%f]") ;; Always indent using spaces instead of tabs (hooked separately for makefiles below) indent-tabs-mode nil ;; By default, ediff all in one frame. ediff-window-setup-function 'ediff-setup-windows-plain ;; view diffs side-by-side ediff-split-window-function 'split-window-horizontally ;; only highlight the selected diff (keeps down gray cruft onscreen) ediff-highlight-all-diffs nil ;; don't try to use pkunzip to extract archive-zip-use-pkzip nil ) (if my-gnup (progn ;; Automatically revert unmodified buffers when they change out from under us on disk. (global-auto-revert-mode 1) ;; Turn on syntax highlighting in all modes by default (global-font-lock-mode 1) ;; This highlights the region (between point and mark) whenever the mark is ;; active. It also causes the mark to be able to become inactive (e.g. by ;; typing C-g. To get the mark back, just type C-x C-x. (transient-mark-mode 1) )) ;;================================== ;; ChangeLog:2009-11-09 ;; The following is based on instructions from: ;; ;; http://www.rattlesnake.com/intro/Loading-Files.html ;; (setq load-path (cons "~/download/cflow/install/share/emacs/site-lisp" load-path)) ;;================================== ;; ChangeLog:2009-11-08 ;; The following is based on instructions from: ;; ;; http://www.gnu.org/software/cflow/manual/cflow.html#Emacs ;; (autoload 'cflow-mode "cflow-mode") (setq auto-mode-alist (append auto-mode-alist '(("\\.cflow$" . cflow-mode)))) ;;================================== --------------000803050309010301060202--