Dear JDE users and developers,

I still have not got much joy with JDEbug. I am
unable to find, in the mailing list archives, anything 
which offers a solution to the failure, on my 
Linux system,  of JDEbug to 
stop at  breakpoints in my program.

The rather contrived code, base on a program,
downloaded from www.ora.com,  which searches for prime 
numbers, is included below.  

A 'Problem Report' web page, can be found at:

http://www.sci.usq.edu.au/staff/sinnamon/jde/jdebug.html

I would appreciate it if anyone could take the time
to have a look and offer me any ideas

Code:
public class Sieve {
  public static void main(String[] args) {
    // We will compute all primes less than the supplied command line
argument
    // Or, if no argument, all primes less than 100
    int max = 100; // Assign a default value
    max = max + 50;
    max = max - 50;
    max = max - 75;
    max = max + 75;
    max = max + 50;
    max = max - 50;
    max = max - 75;
    max = max + 75;
    try { max = Integer.parseInt(args[0]); } // Try to parse user-supplied
arg
    catch (Exception e) {}                   // Silently ignore exceptions.

    // Create an array that specifies whether each number is prime or not.
    boolean[] isprime = new boolean[max+1];

    // Assume that all numbers are primes, until proven otherwise.
    for(int i = 0; i <= max; i++) isprime[i] = true;

    // However, we know that 0 and 1 are not primes.  Make a note of it.
    isprime[0] = isprime[1] = false;

    // To compute all primes less than max, we need to rule out
    // multiples of all integers less than the square root of max.
    int n = (int) Math.ceil(Math.sqrt(max));  // See java.lang.Math class

    // Now, for each integer i from 0 to n:
    //   If i is a prime, then none of its multiples are primes, so
    //   indicate this in the array.  
    //   If i is not a prime, then its multiples have already been
    //   ruled out by one of the prime factors of i, so we can skip this
case.
    for(int i = 0; i <= n; i++) {
      if (isprime[i])                          // If i is a prime, 
        for(int j = 2*i; j <= max; j = j + i)  // loop through its multiples
          isprime[j] = false;                  // noting they are not prime.
    }

    // Now go look for the largest prime:
    int largest;
    for(largest = max; !isprime[largest]; largest--) ;  // empty loop body
    
    // Output the result
    System.out.println("The largest prime less than or equal to " + max +
                       " is " + largest);
  }
}

Thanks again, in Advance,

regards,

James Sinnamon


-----Original Message-----
From: James Sinnamon
To: '[EMAIL PROTECTED]'
Sent: 9/20/00 2:04 AM
Subject: am baffled by JDEbug 

Dear JDE users and developers,

I have read the JDEbug users guide, but I have not been
to find a great deal about how to use JDEbug once
JDEbug has been successfully launched.

I am somewhat familiar with the use of gdb 
to debug C and C++ programs,
but I find it hard to apply my knowledge to JDEbug.

For example, how is one supposed to set a breakpoint
at the start of main, run the program, hit the
breakpoint, then continue, one statement at a time?

I have been unable to do this, so I don't feel very 
confident about attempting to use more sophisticated 
debugging techniques.

My breakpoints are nearly always are ignored no matter 
how I try to run the program, and even when my program 
stops, I don't see the JDEbug "Step Over" or "Step Into"
menu items highlighted.  When I select "Continue", being
the only applicable ative item on the menu, the 
program will usually continue to the end.

Would anyone be able to either:

(1) Show me where to find documentation which 
explains how to run JDEbug once it has started,
and give me some idea of whatis going on; or

(2) Suggest how I could work out what is wrong 
with my JDEbug setup.

In case it might help, I will include a 'bug report' 
below. (Apologies for its size - I don't know 
what to leave out). Please let me know if any further 
information is needed. 

Thanks again in advance.

regards,

James Sinnamon


Please enter the details of your bug report here
--------------------------------------------------------------------
'.emacs' file  ("actually/home/sinnamon/java/ora/examples/_emacs")  :

(setq default-directory "/home/sinnamon/java/ora/examples/")
(setq load-path 
      (nconc '("/home/sinnamon/emacs/site/jde-2.2.4/lisp/" )))

(add-to-list 'load-path "/home/sinnamon/emacs/site/semantic/")
(add-to-list 'load-path "/home/sinnamon/emacs/site/speedbar/" )
(add-to-list 'load-path "/home/sinnamon/emacs/site/elib/" )
(add-to-list 'load-path "/home/sinnamon/emacs/site/jde-contrib/" )
(add-to-list 'load-path "/usr/share/emacs/20.5/lisp/")
(add-to-list 'load-path "/usr/share/emacs/20.5/lisp/emacs-lisp/")
(add-to-list 'load-path "/usr/share/emacs/20.5/lisp/progmodes/")
(add-to-list 'load-path "/usr/share/emacs/20.5/lisp/mail/")
(add-to-list 'load-path "/usr/share/emacs/site-lisp/")

(autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
(autoload 'speedbar-get-focus "speedbar" "Jump to speedbar frame" t)

(require 'jde)
(require 'jmaker)
(require 'jdok)
(require 'jsee)

(custom-set-variables
 '(jde-compile-option-command-line-args "-g")
 '(jde-db-read-vm-args t)
 '(jde-compile-option-deprecation t)
 '(jde-db-debugger (quote ("JDEbug" . "Executable")))
 '(jde-db-read-app-args t)
 '(jde-bug-jpda-directory "/usr/local/jdk1_2_2")
 '(jde-bug-vm-includes-jpda-p nil))
(custom-set-faces
 '(font-lock-comment-face ((((class color) (background dark))
(:foreground
"White")))))



Emacs  : GNU Emacs 20.5.1 (i386-redhat-linux-gnu, X toolkit)
 of Tue Feb 22 2000 on porky.devel.redhat.com
Package: JDE version 2.2.4.1

current state:
==============
(setq
 jde-gen-session-bean-template '("(jde-wiz-insert-imports-into-buffer
(list
\"javax.ejb.*\"\n\"java.rmi.RemoteException\"))"
"(jde-wiz-update-implements-clause \"SessionBean\")" "'> \"public void
ejbActivate() throws RemoteException {\"'>'n \"}\"'>'n\n'>'n" "'>
\"public
void ejbPassivate() throws RemoteException {\"'>'n \"}\"'>'n\n'>'n" "'>
\"public void ejbRemove() throws RemoteException {\"'>'n \"}\"'>'n '>'n"
"'>
\"public void setSessionContext(SessionContext ctx)
throws\nRemoteException
{\"" "'>'n \"}\"'>'n '>'n" "'> \"public void unsetSessionContext()
throws
RemoteException {\"'>'n\n\"}\"'>'n '>'n'>")
 jde-gen-beep '("(end-of-line) '&"
                "\"Toolkit.getDefaultToolkit().beep();\"'>'n'>")
 jde-which-method-format '(" [" jde-which-method-current "]")
 jde-run-classic-mode-vm nil
 jde-javadoc-gen-nodeprecatedlist nil
 jde-imenu-include-classdef t
 jde-javadoc-gen-link-online nil
 jde-gen-code-templates '(("Get Set Pair" . jde-gen-get-set)
                          ("toString method" . jde-gen-to-string-method)
                          ("Action Listener" . jde-gen-action-listener)
                          ("Window Listener" . jde-gen-window-listener)
                          ("Mouse Listener" . jde-gen-mouse-listener)
                          ("Mouse Motion Listener" .
                           jde-gen-mouse-motion-listener)
                          ("Inner Class" . jde-gen-inner-class)
                          ("println" . jde-gen-println)
                          ("beep" . jde-gen-beep)
                          ("property change support" .
                           jde-gen-property-change-support)
                          ("EJB Entity Bean" . jde-gen-entity-bean)
                          ("EJB Session Bean" . jde-gen-session-bean))
 jde-gen-cflow-else '("(if (jde-parse-comment-or-quoted-p)" "'(l
\"else\")"
                      "'(l '> \"else \"" "(if jde-gen-k&r " "()" "'>'n)"
                      "\"{\"'>'n'>'r'n" "\"} // end of else\"'>'n'>)"
")")
 jde-make-args ""
 jde-javadoc-gen-destination-directory "JavaDoc"
 jde-mode-line-format '("-" mode-line-mule-info mode-line-modified
                        mode-line-frame-identification
                        mode-line-buffer-identification "   "
                        global-mode-string "   %[(" mode-name
                        mode-line-process minor-mode-alist "%n" ")%]--"
                        (jde-which-method-mode
                         ("" jde-which-method-format "--"))
                        (line-number-mode "L%l--")
                        (column-number-mode "C%c--") (-3 . "%p") "-%-")
 jde-mode-abbreviations '(("ab" . "abstract") ("bo" . "boolean")
                          ("br" . "break") ("by" . "byte") ("byv" .
"byvalue")
                          ("cas" . "cast") ("ca" . "catch") ("ch" .
"char")
                          ("cl" . "class") ("co" . "const")
                          ("con" . "continue") ("de" . "default")
                          ("dou" . "double") ("el" . "else")
                          ("ex" . "extends") ("fa" . "false") ("fi" .
"final")
                          ("fin" . "finally") ("fl" . "float") ("fo" .
"for")
                          ("fu" . "future") ("ge" . "generic") ("go" .
"goto")
                          ("impl" . "implements") ("impo" . "import")
                          ("ins" . "instanceof") ("in" . "int")
                          ("inte" . "interface") ("lo" . "long")
                          ("na" . "native") ("ne" . "new") ("nu" .
"null")
                          ("pa" . "package") ("pri" . "private")
                          ("pro" . "protected") ("pu" . "public")
                          ("re" . "return") ("sh" . "short") ("st" .
"static")
                          ("su" . "super") ("sw" . "switch")
                          ("sy" . "synchronized") ("th" . "this")
                          ("thr" . "throw") ("throw" . "throws")
                          ("tra" . "transient") ("tr" . "true")
                          ("vo" . "void") ("vol" . "volatile")
                          ("wh" . "while"))
 jde-imenu-enable t
 jde-jsee-javadoc-package-option nil
 jde-compile-option-verbose nil
 jde-db-option-heap-size '((1 . "megabytes") (16 . "megabytes"))
 jde-bug-debugger-host-address "smaug.sci.usq.edu.au"
 jde-jsee-javadoc-noindex-option t
 jde-make-working-directory ""
 jde-bug-breakpoint-marker-colors '("red" . "yellow")
 jde-javadoc-gen-use nil
 jde-gen-buffer-boilerplate nil
 jde-bug-raise-frame-p t
 jde-db-option-application-args nil
 jde-javadoc-gen-nonavbar nil
 jde-javadoc-gen-nohelp nil
 jde-bug-vm-includes-jpda-p nil
 jde-gen-jfc-app-buffer-template '("(funcall
jde-gen-boilerplate-function)
'>'n" "\"import java.awt.Dimension;\" '>'n" "\"import
java.awt.Graphics;\"
'>'n" "\"import java.awt.Graphics2D;\" '>'n" "\"import java.awt.Color;\"
'>'n" "\"import java.awt.geom.Ellipse2D;\" '>'n" "\"import
java.awt.event.WindowAdapter;\" '>'n" "\"import
java.awt.event.WindowEvent;\" '>'n" "\"import javax.swing.JFrame;\"
'>'n"
"\"import javax.swing.JPanel;\" '>'n" "\"import
javax.swing.JScrollPane;\"
'>'n" "\"import javax.swing.JMenuBar;\" '>'n" "\"import
javax.swing.JMenu;\"
'>'n" "\"import java.awt.event.ActionEvent;\" '>'n" "\"import
javax.swing.AbstractAction;\" '>'n '>'n" "\"/**\" '>'n" "\" * \""
"(file-name-nondirectory buffer-file-name) '>'n" "\" *\" '>'n" "\" *\"
'>'n"
"\" * Created: \" (current-time-string) '>'n" "\" *\" '>'n" "\" *
@author <a
href=\\\"mailto: \\\"\" (user-full-name) \"</a>\"'>'n" "\" * @version\"
'>'n" "\" */\" '>'n" "'>'n" "\"public class \""
"(file-name-sans-extension
(file-name-nondirectory buffer-file-name))" "\" extends JFrame\"" "(if
jde-gen-k&r " "()" "'>'n)" "\"{\"'>'n" "\"class Canvas extends JPanel\""
"(if jde-gen-k&r " "()" "'>'n)" "\"{\"'>'n" "\"public Canvas () \"" "(if
jde-gen-k&r " "()" "'>'n)" "\"{\"'>'n" "\"setSize(getPreferredSize());\"
'>'n" "\"Canvas.this.setBackground(Color.white);\" '>'n" "\"}\"'>'n
'>'n"
"\"public Dimension getPreferredSize() \"" "(if jde-gen-k&r " "()"
"'>'n)"
"\"{\"'>'n" "\"return new Dimension(600, 600);\" '>'n" "\"}\"'>'n '>'n"
"\"public void paintComponent(Graphics g) \"" "(if jde-gen-k&r " "()"
"'>'n)" "\"{\"'>'n" "\"super.paintComponent(g);\" '>'n" "\"Graphics2D
g2d =
(Graphics2D) g;\" '>'n" "\"Ellipse2D circle = new Ellipse2D.Double(0d,
0d,
100d, 100d);\" '>'n" "\"g2d.setColor(Color.red);\" '>'n"
"\"g2d.translate(10, 10);\" '>'n" "\"g2d.draw(circle);\" '>'n"
"\"g2d.fill(circle);\" '>'n" "\"}\"'>'n " "\"}\"'>'n '>'n" "\"public \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
"\"()\"" "(if jde-gen-k&r " "()" "'>'n)" "\"{\"'>'n" "\"super(\\\"\" (P
\"Enter app title: \") \"\\\");\" '>'n" "\"setSize(300, 300);\" '>'n"
"\"addWindowListener(new WindowAdapter() \"" "(if jde-gen-k&r " "()"
"'>'n)"
"\"{\"'>'n" "\"public void windowClosing(WindowEvent e)
{System.exit(0);}\"
'>'n" "\"public void windowOpened(WindowEvent e) {}\" '>'n"
"\"});\"'>'n"
"\"setJMenuBar(createMenu());\" '>'n" "\"getContentPane().add(new
JScrollPane(new Canvas()));\" '>'n" "\"}\"'>'n" "'>'n" "\"public static
void
main(String[] args) \"" "(if jde-gen-k&r " "()" "'>'n)" "\"{\"'>'n"
"'>'n"
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
"\" f
= new \"" "(file-name-sans-extension (file-name-nondirectory
buffer-file-name))" "\"();\" '>'n" "\"f.show();\" '>'n" "\"}\"'>'n '>'n"
"\"protected JMenuBar createMenu() \"" "(if jde-gen-k&r " "()" "'>'n)"
"\"{\"'>'n" "\"JMenuBar mb = new JMenuBar();\" '>'n" "\"JMenu menu = new
JMenu(\\\"File\\\");\" '>'n" "\"menu.add(new
AbstractAction(\\\"Exit\\\")
\"" "(if jde-gen-k&r " "()" "'>'n)" "\"{\"'>'n" "\"public void
actionPerformed(ActionEvent e) \"" "(if jde-gen-k&r " "()" "'>'n)"
"\"{\"'>'n" "\"System.exit(0);\" '>'n" "\"}\" '>'n" "\"});\" '>'n"
"\"mb.add(menu);\" '>'n" "\"return mb;\" '>'n" "\"}\"'>'n " "\"} //
\"'>"
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
"'>'n")
 jde-bug-key-bindings '(("[?  

Reply via email to