From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Zoltan Kemenczy" Newsgroups: gmane.emacs.devel Subject: Re: Fw: lisp/gud.el Jdb support for nested class breakpoints Date: Wed, 18 Dec 2002 22:18:05 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <006101c2a70d$3f2de120$0701a8c0@rim.net> References: <000c01c2a322$4f674a20$0701a8c0@rim.net> Reply-To: Zoltan Kemenczy NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_005F_01C2A6E3.5620EAA0" X-Trace: main.gmane.org 1040267935 26355 80.91.224.249 (19 Dec 2002 03:18:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 19 Dec 2002 03:18:55 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18OrD3-0006ql-00 for ; Thu, 19 Dec 2002 04:18:53 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18OrDy-00030S-00 for ; Thu, 19 Dec 2002 04:19:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18OrCs-0003aO-03 for emacs-devel@quimby.gnus.org; Wed, 18 Dec 2002 22:18:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18OrCQ-0003UR-00 for emacs-devel@gnu.org; Wed, 18 Dec 2002 22:18:14 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18OrCN-0003Oo-00 for emacs-devel@gnu.org; Wed, 18 Dec 2002 22:18:13 -0500 Original-Received: from fep04-mail.bloor.is.net.cable.rogers.com ([66.185.86.74]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18OrCI-00039e-00; Wed, 18 Dec 2002 22:18:06 -0500 Original-Received: from zkemenczy1lt ([24.112.238.47]) by fep04-mail.bloor.is.net.cable.rogers.comESMTP <20021219031739.XYUB214174.fep04-mail.bloor.is.net.cable.rogers.com@zkemenczy1lt>; Wed, 18 Dec 2002 22:17:39 -0500 Original-To: =?Windows-1252?Q?Pavel_Jan=EDk?= X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4920.2300 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300 X-Authentication-Info: Submitted using SMTP AUTH LOGIN at fep04-mail.bloor.is.net.cable.rogers.com from [24.112.238.47] using ID at Wed, 18 Dec 2002 22:17:39 -0500 Original-cc: rms@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10270 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10270 This is a multi-part message in MIME format. ------=_NextPart_000_005F_01C2A6E3.5620EAA0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable This should work better as a MIME quoted printable text attachment... = Tabs are preserved. (Though I used the previous method of submission for lisp/gud.el without = receiving complaints last January...) Please confirm, Regards, Zoltan ----- Original Message -----=20 From: "Pavel Jan=EDk" To: "Zoltan Kemenczy" Cc: ; Sent: Wednesday, December 18, 2002 9:36 AM Subject: Re: Fw: lisp/gud.el Jdb support for nested class breakpoints From: "Zoltan Kemenczy" Date: Fri, 13 Dec 2002 22:38:47 -0500 Hi Zoltan, > The original submission is below... now I understand what is the problem. What did you patched? patching file gud.el Hunk #1 FAILED at 93. Hunk #2 FAILED at 1367. Hunk #3 FAILED at 1811. Hunk #4 FAILED at 1898. Hunk #5 FAILED at 1919. Hunk #6 FAILED at 1930. Hunk #8 FAILED at 2541. Hunk #9 FAILED at 2755. 8 out of 9 hunks FAILED -- saving rejects to file gud.el.rej Your patch does not seem to contain proper tabs/spaces (at least). I = tried to ignore whitespaces (patch -l) but it results with similar report = (some hunks got applied, but broken indentation, of course). Can you please = send me the whole new file you have? > For some reason this message did not remain up on the emacs-devel = list > archive either...?? Peeple are upgrading majordomo on savannah. Have a lokk at http://savannah.gnu.org/ --=20 Pavel Jan=EDk Emacs byte compiler is a VW Bug. This code makes it be a VW Bug with = fuel injection and a turbocharger... -- An unknown author in GNU Emacs about Emacs's = byte-opt ------=_NextPart_000_005F_01C2A6E3.5620EAA0 Content-Type: application/octet-stream; name="gud.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gud.patch" *** /Zoltan/emacs/emacs/lisp/gud.el Tue Dec 10 16:49:24 2002 --- /Zoltan/local/lisp/gud.el Mon Dec 16 14:13:59 2002 *************** *** 93,99 **** '(([refresh] "Refresh" . gud-refresh) ([run] menu-item "Run" gud-run :enable (and (not gud-running) ! (memq gud-minor-mode '(gdba gdb)))) ([goto] menu-item "Continue to selection" gud-goto :enable (and (not gud-running) (memq gud-minor-mode '(gdba gdb)))) --- 93,99 ---- '(([refresh] "Refresh" . gud-refresh) ([run] menu-item "Run" gud-run :enable (and (not gud-running) ! (memq gud-minor-mode '(gdba gdb jdb)))) ([goto] menu-item "Continue to selection" gud-goto :enable (and (not gud-running) (memq gud-minor-mode '(gdba gdb)))) *************** *** 1367,1372 **** --- 1367,1373 ---- ;; ;; CREATED: Sun Feb 22 10:46:38 1998 Derek Davies. ;; UPDATED: Nov 11, 2001 Zoltan Kemenczy + ;; Dec 10, 2002 Zoltan Kemenczy - added nested class support ;; ;; INVOCATION NOTES: ;; *************** *** 1810,1816 **** ;; name relative to classpath (filename (concat ! (mapconcat (lambda (x) x) (split-string ;; Eliminate any subclass references in the class ;; name string. These start with a "$" --- 1811,1817 ---- ;; name relative to classpath (filename (concat ! (mapconcat 'identity (split-string ;; Eliminate any subclass references in the class ;; name string. These start with a "$" *************** *** 1897,1904 **** ;; ;; FIXME: Java ID's are UNICODE strings, this matches ASCII ;; ID's only. ! "\\(?:\[\\([0-9]+\\)\] \\)*\\([a-zA-Z0-9.$_]+\\)\\.[a-zA-Z0-9$_<>(),]+ \ ! \\(([a-zA-Z0-9.$_]+:\\|line=\\)\\([0-9]+\\)" gud-marker-acc) ;; A good marker is one that: --- 1898,1912 ---- ;; ;; FIXME: Java ID's are UNICODE strings, this matches ASCII ;; ID's only. ! ;; ! ;; The "," in the last square-bracket is necessary because of ! ;; Sun's total disrespect for backwards compatibility in ! ;; reported line numbers from jdb - starting in 1.4.0 they ! ;; introduced a comma at the thousands position (how ! ;; ingenious!) ! ! "\\(\[[0-9]+\] \\)*\\([a-zA-Z0-9.$_]+\\)\\.[a-zA-Z0-9$_<>(),]+ \ ! \\(([a-zA-Z0-9.$_]+:\\|line=\\)\\([0-9,]+\\)" gud-marker-acc) ;; A good marker is one that: *************** *** 1911,1917 **** ;; ( . ) . (if (if (match-beginning 1) (let (n) ! (setq n (string-to-int (match-string 1 gud-marker-acc))) (if (< n gud-jdb-lowest-stack-level) (progn (setq gud-jdb-lowest-stack-level n) t))) t) --- 1919,1928 ---- ;; ( . ) . (if (if (match-beginning 1) (let (n) ! (setq n (string-to-int (substring ! gud-marker-acc ! (1+ (match-beginning 1)) ! (- (match-end 1) 2)))) (if (< n gud-jdb-lowest-stack-level) (progn (setq gud-jdb-lowest-stack-level n) t))) t) *************** *** 1919,1925 **** (gud-jdb-find-source (match-string 2 gud-marker-acc))) (setq gud-last-frame (cons file-found ! (string-to-int (match-string 4 gud-marker-acc)))) (message "Could not find source file."))) ;; Set the accumulator to the remaining text. --- 1930,1941 ---- (gud-jdb-find-source (match-string 2 gud-marker-acc))) (setq gud-last-frame (cons file-found ! (string-to-int ! (let ! ((numstr (match-string 4 gud-marker-acc))) ! (if (string-match "," numstr) ! (replace-match "" nil nil numstr) ! numstr))))) (message "Could not find source file."))) ;; Set the accumulator to the remaining text. *************** *** 1990,1995 **** --- 2006,2012 ---- (gud-def gud-finish "step up" "\C-f" "Continue until current method returns.") (gud-def gud-up "up\C-Mwhere" "<" "Up one stack frame.") (gud-def gud-down "down\C-Mwhere" ">" "Up one stack frame.") + (gud-def gud-run "run" nil "Run the program.") ;if VM start using jdb (setq comint-prompt-regexp "^> \\|^[^ ]+\\[[0-9]+\\] ") (setq paragraph-start comint-prompt-regexp) *************** *** 2524,2532 **** ((eq key ?a) (setq subst (gud-read-address))) ((eq key ?c) ! (setq subst (gud-find-class (if insource ! (buffer-file-name) ! (car frame))))) ((eq key ?p) (setq subst (if arg (int-to-string arg))))) (setq result (concat result (match-string 1 str) subst))) --- 2541,2557 ---- ((eq key ?a) (setq subst (gud-read-address))) ((eq key ?c) ! (setq subst ! (gud-find-class ! (if insource ! (buffer-file-name) ! (car frame)) ! (if insource ! (save-restriction ! (widen) ! (+ (count-lines (point-min) (point)) ! (if (bolp) 1 0))) ! (cdr frame))))) ((eq key ?p) (setq subst (if arg (int-to-string arg))))) (setq result (concat result (match-string 1 str) subst))) *************** *** 2730,2761 **** (t nil))) (t nil)))) ! (defun gud-find-class (f) ! "Find fully qualified class corresponding to file F. This function uses the `gud-jdb-classpath' (and optional `gud-jdb-sourcepath') list(s) to derive a file pathname relative to its classpath directory. The values in `gud-jdb-classpath' are assumed to have been converted to absolute ! pathname standards using file-truename." ;; Convert f to a standard representation and remove suffix (if (and gud-jdb-use-classpath (or gud-jdb-classpath gud-jdb-sourcepath)) (save-match-data ! (let ((cplist (append gud-jdb-sourcepath gud-jdb-classpath)) ! class-found) ! (setq f (file-name-sans-extension (file-truename f))) ! ;; Search through classpath list for an entry that is ! ;; contained in f ! (while (and cplist (not class-found)) ! (if (string-match (car cplist) f) ! (setq class-found (mapconcat 'identity ! (split-string ! (substring f (+ (match-end 0) 1)) ! "/") "."))) ! (setq cplist (cdr cplist))) ! (if (not class-found) ! (message "gud-find-class: class for file %s not found!" f)) ! class-found)) ;; Not using classpath - try class/source association list (let ((class-found (rassoc f gud-jdb-class-source-alist))) (if class-found --- 2755,2831 ---- (t nil))) (t nil)))) ! (defun gud-find-class (f line) ! "Find fully qualified class in file F at line LINE. This function uses the `gud-jdb-classpath' (and optional `gud-jdb-sourcepath') list(s) to derive a file pathname relative to its classpath directory. The values in `gud-jdb-classpath' are assumed to have been converted to absolute ! pathname standards using file-truename. ! If F is visited by a buffer and its mode is CC-mode(Java), ! syntactic information of LINE is used to find the enclosing (nested) ! class string which is appended to the top level ! class of the file (using s to separate nested class ids)." ;; Convert f to a standard representation and remove suffix (if (and gud-jdb-use-classpath (or gud-jdb-classpath gud-jdb-sourcepath)) (save-match-data ! (let ((cplist (append gud-jdb-sourcepath gud-jdb-classpath)) ! (fbuffer (get-file-buffer f)) ! class-found) ! (setq f (file-name-sans-extension (file-truename f))) ! ;; Search through classpath list for an entry that is ! ;; contained in f ! (while (and cplist (not class-found)) ! (if (string-match (car cplist) f) ! (setq class-found (mapconcat 'identity ! (split-string ! (substring f (+ (match-end 0) 1)) ! "/") "."))) ! (setq cplist (cdr cplist))) ! ;; if f is visited by a java(cc-mode) buffer, walk up the ! ;; syntactic information chain and collect any 'inclass ! ;; symbols until 'topmost-intro is reached to find out if ! ;; point is within a nested class ! (if (and fbuffer (equal (symbol-file 'java-mode) "cc-mode")) ! (save-excursion ! (set-buffer fbuffer) ! (let ((nclass) (syntax) ! (pos (point))) ! ;; While the c-syntactic information does not start ! ;; with the 'topmost-intro symbol, there may be ! ;; nested classes... ! (while (not (eq 'topmost-intro ! (car (car (c-guess-basic-syntax))))) ! ;; Check if the current position c-syntactic ! ;; analysis has 'inclass ! (setq syntax (c-guess-basic-syntax)) ! (while ! (and (not (eq 'inclass (car (car syntax)))) ! (cdr syntax)) ! (setq syntax (cdr syntax))) ! (if (eq 'inclass (car (car syntax))) ! (progn ! (goto-char (cdr (car syntax))) ! ;; Now we're at the beginning of a class ! ;; definition. Find class name ! (looking-at ! "[A-Za-z0-9 \t\n]*?class[ \t\n]+\\([^ \t\n]+\\)") ! (setq nclass ! (append (list (match-string-no-properties 1)) ! nclass))) ! (setq syntax (c-guess-basic-syntax)) ! (while (and (not (cdr (car syntax))) (cdr syntax)) ! (setq syntax (cdr syntax))) ! (goto-char (cdr (car syntax))) ! )) ! (string-match (concat (car nclass) "$") class-found) ! (setq class-found ! (replace-match (mapconcat 'identity nclass "$") ! t t class-found))))) ! (if (not class-found) ! (message "gud-find-class: class for file %s not found!" f)) ! class-found)) ;; Not using classpath - try class/source association list (let ((class-found (rassoc f gud-jdb-class-source-alist))) (if class-found ------=_NextPart_000_005F_01C2A6E3.5620EAA0 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel ------=_NextPart_000_005F_01C2A6E3.5620EAA0--