Function: gud-jdb-find-source-using-classpath

gud-jdb-find-source-using-classpath is a byte-compiled function defined in gud.el.gz.

Signature

(gud-jdb-find-source-using-classpath P)

Documentation

Find source file corresponding to fully qualified class P.

Convert P from jdb's output, converted to a pathname relative to a classpath directory.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gud.el.gz
(defun gud-jdb-find-source-using-classpath (p)
  "Find source file corresponding to fully qualified class P.
Convert P from jdb's output, converted to a pathname
relative to a classpath directory."
  (save-match-data
    (let
      (;; Replace dots with slashes and append ".java" to generate file
       ;; name relative to classpath
       (filename
	(concat
	 (mapconcat #'identity
		    (split-string
		     ;; Eliminate any subclass references in the class
		     ;; name string. These start with a "$"
                     (if (string-match "\\$.*" p)
                         (replace-match "" t t p) p)
		     "\\.")
		    "/")
	 ".java"))
       (cplist (append gud-jdb-sourcepath gud-jdb-classpath))
       found-file)
    (while (and cplist
		(not (setq found-file
			   (file-readable-p
			    (concat (car cplist) "/" filename)))))
      (setq cplist (cdr cplist)))
    (if found-file (concat (car cplist) "/" filename)))))