all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* (debug) backtrace: how to show source code at current location.
@ 2011-01-05 18:07 Larry Evans
  2011-01-05 19:06 ` Drew Adams
  0 siblings, 1 reply; 11+ messages in thread
From: Larry Evans @ 2011-01-05 18:07 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 2180 bytes --]

In:

  ~/.emacs.d/init.common.el

which is attached, there's a (debug) call around line 150.
init.common.el is called by ~/.emacs, which is also attached.
After this line is executed, the *Backtrace* buffer is as
shown in the next attachment.  After 2 d's in the *Backtrace*
buffer, it shows as in the next attachment.

At this point, I've not a precise location of where the
debugger is in the emacs code.  There are no "source code"
windows showing this.  How can I see where the debugger
is now located in the source code?

After the next d, the top of the *Backtrace* shows:

> Debugger entered--beginning evaluation of function call form:
> * (quote c-insert-my-tab)
> * (define-key c++-mode-map (quote tab) (quote c-insert-my-tab))
>   c++-mode-my-hook()
>   run-hooks(c-mode-common-hook c++-mode-hook)

So, I guess the debugger will soon be in c-insert-my-tab (defined
in the 1st attachment).  So, I hit d again and get the following:

> Debugger entered--returning value: c-insert-my-tab
>   (quote c-insert-my-tab)
> * (define-key c++-mode-map (quote tab) (quote c-insert-my-tab))
>   c++-mode-my-hook()
>   run-hooks(c-mode-common-hook c++-mode-hook)

Which is not much help; so, I hit d again and get:

> Debugger entered--beginning evaluation of function call form:
> * (byte-code "ÁÂÃ\b!\"‡" [err message "File mode specification error: %s" prin1-to-string] 4)
>   normal-mode(t)
>   after-find-file(nil t)

Which tells me nothing about what code is being executed.
Hitting d again gives:

> Debugger entered--entering a function:
> * prin1-to-string((wrong-type-argument arrayp tab))
> * byte-code("ÁÂÃ\b!\"‡" [err message "File mode specification error: %s" prin1-to-string] 4)
>   normal-mode(t)
>   after-find-file(nil t)

which doesn't help much.

Finally, I hit c, resulting in the top *Backtrace* containing:

> Debugger entered--returning value: "(wrong-type-argument arrayp tab)"
>   prin1-to-string((wrong-type-argument arrayp tab))
> * byte-code("ÁÂÃ\b!\"‡" [err message "File mode specification error: %s" prin1-to-string] 4)


Please, how can I find out what's causing this error message:

  "(wrong-type-argument arrayp tab)"

TIA.

-Larry





[-- Attachment #2: init.common.el --]
[-- Type: text/x-emacs-lisp, Size: 9567 bytes --]

;;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
;;
(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-indentation)

;;************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{")
  (debug)
  (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 <command-name> 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))))
;;==================================

[-- Attachment #3: .emacs --]
[-- Type: text/plain, Size: 5209 bytes --]

;;; XEmacs backwards compatibility file
(setq my-user-init-file
      (expand-file-name "init.common.el"
			(expand-file-name ".emacs.d" "~")))
(load-file my-user-init-file)
;;(message "{***(my-custom-file load)")
(setq my-custom-file
      (expand-file-name "custom.el"
			(expand-file-name ".xemacs" "~")))
;;(load-file my-custom-file)
;;(message "}***(my-custom-file load)")

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(agda2-include-dirs (quote ("." "/usr/lib/agda-stdlib/")))
 '(c-cleanup-list nil)
 '(c-echo-syntactic-information-p t)
 '(c-hanging-braces-alist (quote ((brace-list-open) (brace-entry-open) (statement-cont) (substatement-open after) (block-close . c-snug-do-while) (extern-lang-open after) (namespace-open after) (module-open after) (composition-open after) (inexpr-class-open after) (inexpr-class-close before))))
 '(c-offsets-alist (quote ((arglist-close . 0))))
 '(c-report-syntactic-errors t)
 '(c-syntactic-indentation t)
 '(case-fold-search t)
 '(column-number-mode t)
 '(current-language-environment "Latin-1")
 '(default-input-method "latin-1-prefix")
 '(desktop-load-locked-desktop nil)
 '(desktop-save t)
 '(desktop-save-mode t)
 '(ecb-cedet-url "http://cedet.sourceforge.net/")
 '(haskell-doc-show-global-types t)
 '(haskell-program-name (or (cond ((not (fboundp (quote executable-find))) nil) ((executable-find "ghci") "ghci") ((executable-find "hugs") "hugs \"+.\"")) "ghci"))
 '(line-number-mode t)
 '(mail-archive-file-name "/home/evansl/Mail/emacs-sent-mail")
 '(mail-host-address "pop.suddenlink.net")
 '(recent-files-add-menu-before "nil")
 '(recent-files-include-save-now t)
 '(recent-files-menu-path nil)
 '(require-final-newline t)
 '(safe-local-variable-values (quote ((folded-file . t) (fold-internal-margins . 0) (Fill-column . 100))))
 '(save-place t nil (saveplace))
 '(shell-input-autoexpand (quote input))
 '(smtpmail-default-smtp-server "smtp.suddenlink.net")
 '(speedbar-frame-parameters (quote ((minibuffer) (width . 20) (border-width . 0) (menu-bar-lines . 0) (tool-bar-lines . 0) (unsplittable . t) (set-background-color "black"))))
 '(standard-indent 8)
 '(tab-width 8)
 '(tags-table-list (quote ("TAGS")))
 '(transient-mark-mode t)
 '(user-mail-address "cppljevans@suddenlink.net")
 '(version-control (quote never)))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(background "blue")
 '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "Turquoise"))))
 '(font-lock-comment-face ((t (:foreground "MediumAquamarine"))))
 '(font-lock-constant-face ((((class color) (background dark)) (:bold t :foreground "DarkOrchid"))))
 '(font-lock-doc-string-face ((t (:foreground "green2"))))
 '(font-lock-function-name-face ((t (:foreground "SkyBlue"))))
 '(font-lock-keyword-face ((t (:bold t :foreground "CornflowerBlue"))))
 '(font-lock-preprocessor-face ((t (:italic nil :foreground "CornFlowerBlue"))))
 '(font-lock-reference-face ((t (:foreground "DodgerBlue"))))
 '(font-lock-string-face ((t (:foreground "LimeGreen"))))
 '(font-lock-type-face ((t (:foreground "#9290ff"))))
 '(font-lock-variable-name-face ((t nil)))
 '(font-lock-warning-face ((((class color) (background dark)) (:foreground "yellow" :background "red"))))
 '(highlight ((t (:background "CornflowerBlue"))))
 '(list-mode-item-selected ((t (:background "gold"))))
 '(makefile-space-face ((t (:background "wheat"))) t)
 '(mode-line ((t (:background "gray"))))
 '(mode-line-inactive ((default nil) (((class color) (min-colors 88) (background light)) (:background "grey90" :foreground "grey20" :box (:line-width -1 :color "grey40") :weight light))))
 '(paren-match ((t (:background "darkseagreen4"))))
 '(region ((t (:background "DarkSlateBlue"))))
 '(show-paren-match ((t (:foreground "black" :background "wheat"))))
 '(show-paren-mismatch ((((class color)) (:foreground "white" :background "red"))))
 '(speedbar-button-face ((((class color) (background dark)) (:foreground "green4"))))
 '(speedbar-directory-face ((((class color) (background dark)) (:foreground "khaki"))))
 '(speedbar-file-face ((((class color) (background dark)) (:foreground "cyan"))))
 '(speedbar-tag-face ((((class color) (background dark)) (:foreground "Springgreen"))))
 '(vhdl-speedbar-architecture-selected-face ((((class color) (background dark)) (:underline t :foreground "Blue"))))
 '(vhdl-speedbar-entity-face ((((class color) (background dark)) (:foreground "darkGreen"))))
 '(vhdl-speedbar-entity-selected-face ((((class color) (background dark)) (:underline t :foreground "darkGreen"))))
 '(vhdl-speedbar-package-face ((((class color) (background dark)) (:foreground "black"))))
 '(vhdl-speedbar-package-selected-face ((((class color) (background dark)) (:underline t :foreground "black"))))
 '(widget-field ((((class grayscale color) (background light)) (:background "DarkBlue")))))

[-- Attachment #4: bt.txt.~1.1~ --]
[-- Type: application/octet-stream, Size: 2111 bytes --]

[-- Attachment #5: bt.txt.~1.2~ --]
[-- Type: application/octet-stream, Size: 2209 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-01-06 13:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 18:07 (debug) backtrace: how to show source code at current location Larry Evans
2011-01-05 19:06 ` Drew Adams
2011-01-05 19:43   ` Larry Evans
2011-01-05 19:54     ` Larry Evans
2011-01-05 19:58     ` Drew Adams
     [not found]   ` <mailman.0.1294256637.13904.help-gnu-emacs@gnu.org>
2011-01-05 23:31     ` Tim X
2011-01-06  2:53       ` Larry Evans
2011-01-06  3:50         ` Larry Evans
2011-01-06  3:55         ` Drew Adams
2011-01-06  4:50           ` Larry Evans
2011-01-06 13:57             ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.