<?xml version="1.0"?>
<paste-with-annotations>
  <paste>
    <number>
      <integer>39856</integer>
    </number>
    <user>
      <string>myrkraverk</string>
    </user>
    <title>
      <string>idb.el</string>
    </title>
    <contents>
      <string>;; 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 &quot;-emacs&quot; args))

(defvar easy-mmode-support (fboundp 'easy-mmode-define-keymap))

(if easy-mmode-support
    (progn
      (easy-mmode-defmap gud-idb-menu-map
			 '(([refresh]	&quot;Refresh&quot; . gud-refresh)
			   ([run]	&quot;Run/Rerun&quot; . gud-run)
			   ([down]	&quot;Down Stack&quot; . gud-down)
			   ([up]	&quot;Up Stack&quot; . gud-up)
			   ([finish]	&quot;Finish Function&quot; . gud-finish)
			   ([stepi]	&quot;Step Instruction&quot; . gud-stepi)
			   ([nexti]	&quot;Next Instruction&quot; . gud-nexti)
			   ([step]	&quot;Step Line&quot; . gud-step)
			   ([next]	&quot;Next Line&quot; . gud-next)
			   ([print]	&quot;Print Expression&quot; . gud-print)
			   ([break]	&quot;Set Breakpoint&quot; . gud-break)
			   ([where]	&quot;Print Stack&quot; . gud-where)
			   ([cont]	&quot;Continue&quot; . gud-cont))
			 &quot;Menu for `gud-idb-mode'.&quot;
			 :name &quot;Gud/Idb&quot;)
      
      (easy-mmode-defmap gud-idb-minor-mode-map
			 `(([menu-bar debug] . (&quot;Gud&quot; . ,gud-idb-menu-map)))
			 &quot;Map used in visited files.&quot;)
      
      (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)
  &quot;Run idb on program &lt;FILE&gt; in buffer *gud-&lt;FILE&gt;*. The directory 
containing &lt;FILE&gt; becomes the current working directory for your debugger.&quot;
  (interactive
   (list (read-from-minibuffer &quot;Run idb (like this): &quot;
			       (if (consp gud-idb-history)
				   (car gud-idb-history)
				   &quot;idb &quot;)
			       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  &quot;stop at \&quot;%f\&quot;:%l&quot; &quot;\C-b&quot; &quot;Set breakpoint at current line of current buffer.&quot;)
  (gud-def gud-step   &quot;step&quot;       &quot;\C-s&quot; &quot;Step one line (into functions).&quot;)
  (gud-def gud-stepi  &quot;stepi&quot;      &quot;\C-i&quot; &quot;Step one instruction.&quot;)
  (gud-def gud-nexti  &quot;nexti&quot;      &quot;\C-j&quot; &quot;Next one instruction.&quot;)
  (gud-def gud-next   &quot;next&quot;       &quot;\C-n&quot; &quot;Step one line (over functions).&quot;)
  (gud-def gud-cont   &quot;cont&quot;	   &quot;\C-r&quot; &quot;Continue.&quot;)
  (gud-def gud-finish &quot;return&quot;	   &quot;\C-f&quot; &quot;Return from current function.&quot;)
  (gud-def gud-up     &quot;up %p&quot;	   &quot;&lt;&quot;    &quot;Up (numeric arg) stack frames.&quot;)
  (gud-def gud-down   &quot;down %p&quot;	   &quot;&gt;&quot;    &quot;Down (numeric arg) stack frames.&quot;)
  (gud-def gud-print  &quot;print %e&quot;   &quot;\C-p&quot; &quot;Evaluate expression at point.&quot;)
  (gud-def gud-run    &quot;run&quot;        &quot;\C-u&quot; &quot;Run/Rerun the debuggee.&quot;)
  (gud-def gud-where  &quot;where&quot;      &quot;\C-w&quot; &quot;Print the stack.&quot;)

  (if (not easy-mmode-support)
      (progn 
	(local-set-key [menu-bar debug finish] '(&quot;Finish Function&quot; . gud-finish))
	(local-set-key [menu-bar debug up]     '(&quot;Up Stack&quot;    . gud-up))
	(local-set-key [menu-bar debug down]   '(&quot;Down Stack&quot;  . gud-down))))

  (setq comint-prompt-regexp  &quot;^[^)]*idb) *&quot;)
  (setq paragraph-start comint-prompt-regexp)

  (run-hooks 'idb-mode-hook)
)

(provide 'idb)
</string>
    </contents>
    <universal-time>
      <integer>3385804946</integer>
    </universal-time>
    <channel>
      <string>#XEmacs</string>
    </channel>
    <colorization-mode>
      <string>Emacs Lisp</string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <null/>
    </is-unicode>
    <deletion-requested>
      <null/>
    </deletion-requested>
    <deletion-requested-email>
      <null/>
    </deletion-requested-email>
    <expiration-time>
      <null/>
    </expiration-time>
  </paste>
</paste-with-annotations>
