Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help with debugging a Java applet



On Sep 25, 2003, at 6:29 PM, Christopher Henrich wrote:

I am trying to write a Java applet, and I would like to use the debugger to get some insight into what I am doing wrong. The project is buildable, and the Debug window comes up; but it does not seem to recognize any of the breakpoints that I set in my Java code.

When I follow the instructions in the Project Builder help file, it seems that the breakpoints I insert in Java code are not recognized. Evidence for this is that in the Debugger window, I get reports of an exception raised after some of the breakpoints have been passed. Do I need to do some magic with target settings in order to debug Java?

There are two common situations that together can lead to breakpoints not being seen by the Java debugger. One is that you're running code that's inside packages but not organized in the package hierarchy on disk. Two is that your project is not indexed. If you either organize your project into the package directory hierarchy or turn on indexing, PB should be able to correctly match breakpoints in your source code to the appropriate classes running in the VM.

<gory_details>

The Java VM does not set breakpoints by specifying a source file and line number. Instead, it sets them by class name and line number. Because of this, PB must somehow map a source file and line number to the correct class. Normally this is done using the project index. If the project isn't indexed, it then tries to guess the class by looking at the full file path and matching it to a package.classname. Xcode improves on this a bit by trying a third option of just matching the base classname with the base filename. (This extra step is not strictly correct and can give the wrong answer (when there are multiple classes with the same base name in different packages), but it actually works most of the time.)

</gory_details>

I hope that helps.

Dave
_______________________________________________
projectbuilder-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/projectbuilder-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Need help with debugging a Java applet (From: Christopher Henrich <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.