Function: gud-jdb-massage-args

gud-jdb-massage-args is a byte-compiled function defined in gud.el.gz.

Signature

(gud-jdb-massage-args FILE ARGS)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gud.el.gz
;; Change what was given in the minibuffer to something that can be used to
;; invoke the debugger.
(defun gud-jdb-massage-args (_file args)
  ;; The jdb executable must have whitespace between "-classpath" and
  ;; its value while gud-common-init expects all switch values to
  ;; follow the switch keyword without intervening whitespace.  We
  ;; require that when the user enters the "-classpath" switch in the
  ;; EMACS minibuffer that they do so without the intervening
  ;; whitespace.  This function adds it back (it's called after
  ;; gud-common-init).  There are more switches like this (for
  ;; instance "-host" and "-password") but I don't care about them
  ;; yet.
  (if args
      (let (massaged-args user-error)

	(while (and args (not user-error))
	  (cond
	   ((setq user-error (string-match "-classpath$" (car args))))
	   ((setq user-error (string-match "-sourcepath$" (car args))))
	   ((string-match "-classpath\\(.+\\)" (car args))
	    (setq massaged-args
		  (append massaged-args
			  (list "-classpath"
				(setq gud-jdb-classpath-string
				      (match-string 1 (car args)))))))
	   ((string-match "-sourcepath\\(.+\\)" (car args))
	    (setq massaged-args
		  (append massaged-args
			  (list "-sourcepath"
				(setq gud-jdb-sourcepath
				      (match-string 1 (car args)))))))
	   (t (setq massaged-args (append massaged-args (list (car args))))))
	  (setq args (cdr args)))

	;; By this point the current directory is all screwed up.  Maybe we
	;; could fix things and re-invoke gud-common-init, but for now I think
	;; issuing the error is good enough.
	(if user-error
	    (progn
	      (kill-buffer (current-buffer))
	      (error "Error: Omit whitespace between '-classpath or -sourcepath' and its value")))
	massaged-args)))