Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 Discussions

Error when running IDB under Emacs: "unrecognized option: emacs (GDB mode)"

limh
Beginner
808 Views
Hello, everyone!

I was trying to run idb under emacs with the command line:
[limh@localhost ~]$ idb -emacs

And the feedback was:
[limh@localhost ~]$ idb -emacs
unrecognized option: emacs (GDB mode)
Use 'idb --help' for a complete list of options.


Below is my emacs's initialization file, the so-called ".emacs" file:

(load-file "~/mywork/cedet-1.0pre6/common/cedet.el") ; my cedet-1.0pre6 directory is located in /home/limh/mywork/
(global-ede-mode 1) ; Enable the Project management system
(semantic-load-enable-code-helpers) ; Enable prototype help and smart completion
(global-srecode-minor-mode 1) ; Enable template insertion menu

(add-to-list 'load-path "/home/limh/mywork/ecb-2.40")
(require 'ecb)
;; The file contains the lisp variables and functions that enable 
;; the user to use idb in the Emacs GUD framework.
;;
(require 'gud)

(defvar gud-idb-history nil)

(defun gud-idb-massage-args (file args)
(cons "-emacs" args)
)


(defvar easy-mmode-support (fboundp 'easy-mmode-define-keymap))

(if easy-mmode-support
(progn
(easy-mmode-defmap gud-idb-menu-map
'(([refresh] "Refresh" . gud-refresh)
([run] "Run/Rerun" . gud-run)
([down] "Down Stack" . gud-down)
([up] "Up Stack" . gud-up)
([finish] "Finish Function" . gud-finish)
([stepi] "Step Instruction" . gud-stepi)
([nexti] "Next Instruction" . gud-nexti)
([step] "Step Line" . gud-step)
([next] "Next Line" . gud-next)
([print] "Print Expression" . gud-print)
([break] "Set Breakpoint" . gud-break)
([where] "Print Stack" . gud-where)
([cont] "Continue" . gud-cont)
)

"Menu for `gud-idb-mode'."
:name "Gud/Idb"
)


(easy-mmode-defmap gud-idb-minor-mode-map
`(([menu-bar debug] . ("Gud" . ,gud-idb-menu-map)))
"Map used in visited files."
)


(let ((m (assq 'gud-minor-mode minor-mode-map-alist)))
(if m (setcdr m gud-idb-minor-mode-map)
(push (cons 'gud-minor-mode gud-minor-mode-map) minor-mode-map-alist)
)
)
)
)


(defun idb (command-line)
"Run idb on program in buffer *gud-*. The directory
containing becomes the current working directory for your debugger."

(interactive
(list (read-from-minibuffer "Run idb (like this): "
(if (consp gud-idb-history)
(car gud-idb-history)
"idb "
)

nil nil
'(gud-idb-history . 1)
)
)
)


(gud-common-init command-line
'gud-idb-massage-args
'gud-gdb-marker-filter
'gud-gdb-find-file
)


(set (make-local-variable 'gud-minor-mode) 'gdb)

(gud-def gud-break "stop at "%f":%l" "\C-b" "Set breakpoint at current line of current buffer.")
(gud-def gud-step "step" "\C-s" "Step one line (into functions).")
(gud-def gud-stepi "stepi" "\C-i" "Step one instruction.")
(gud-def gud-nexti "nexti" "\C-j" "Next one instruction.")
(gud-def gud-next "next" "\C-n" "Step one line (over functions).")
(gud-def gud-cont "cont" "\C-r" "Continue.")
(gud-def gud-finish "return" "\C-f" "Return from current function.")
(gud-def gud-up "up %p" "<" "Up (numeric arg) stack frames.")
(gud-def gud-down "down %p" ">" "Down (numeric arg) stack frames.")
(gud-def gud-print "print %e" "\C-p" "Evaluate expression at point.")
(gud-def gud-run "run" "\C-u" "Run/Rerun the debuggee.")
(gud-def gud-where "where" "\C-w" "Print the stack.")

(if (not easy-mmode-support)
(progn
(local-set-key [menu-bar debug finish] '("Finish Function" . gud-finish))
(local-set-key [menu-bar debug up] '("Up Stack" . gud-up))
(local-set-key [menu-bar debug down] '("Down Stack" . gud-down))
)
)


(setq comint-prompt-regexp "^[^)]*idb) *")
(setq paragraph-start comint-prompt-regexp)

(run-hooks 'idb-mode-hook)
)


(provide 'idb)


The question is:
Is there anything wrong with my .emacs file that disabled my request to run IDB under Emacs?
And moreover, I can't find the so-called idb.el file in my Intel Fortran Compiler installation directory or anywhere in my computer.

All kind of help is welcome, thanks.
Best regards, limh


0 Kudos
2 Replies
Kevin_D_Intel
Employee
808 Views

We have some obvious omissions involving the idb.el file that I will notify the Debugger Development team about. It appears we are only delivering this in the binsub-directory with the ia64 (Itanium) compiler, and not the ia32 or intel64 compilers.

I attached the 11.1.056 version of idb.el to this post. In this version, I modified the idb references to be idbc to ensure the command-line version of the debugger starts under emacs. I also changed the command-line option -emacs to -fullname (a listed alternative under -help to -emacs). I will check w/Development about the error with the option also.

If you change all the idbc references back to idb in this idb.el file, when idb is started under emacs the idb GUI version launches in a separate IDE window. You can tailor the attached file to your liking, but I expect most users want the command-line debugger interface to launch under emacs, so I will suggest to Development the idb.el we distribute reference idbc accordingly.

I willpost again when I know more, but hopefully the attached file will get you going. Our apologies for omission and difficulties.

(Internal tracking id: DPD200140472 - -emacs not accepted)
(Internal tracking id: DPD200140473 - missing idb.el)

An update from Development (10/14/09): Development clarified, -emacs/-fullname are only supported in IDB/DBX mode and only -fullnameis supported in GDB-mode (the idbc default) as documented under -help. Thus, the error shown earlier with -emacs in GDB mode is expected.

Update (12/23/09): The idb.el file was restored for ia32 and intel64 in the 11.1 update 4 release, however, the file still referencesidb and not idbc, therefore to run the command-line version of debugger the file must be modified as described earlier.
0 Kudos
limh
Beginner
808 Views
Hello, Kevin! The attachment worked!!! I can start idb under emacs.

Thanks for your prompt reply.
0 Kudos
Reply