Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Debugging java with Xcode 1.5

Debugging java with Xcode 1.5
Thread Tools
Mac Elite
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status: Offline
Reply With Quote
Aug 31, 2004, 07:51 PM
 
Hi, I've got a cocoa-java application that I'm writing in Xcode. Before the recent update, the debugger worked absolutely fine. Now, it doesn't.

It won't stop at breakpoints any longer. It's fine in pure java projects and seems to be ok in objective-C, but cocoa-java application projects will not stop at break points. Is anyone else having this trouble?

Thanks
ClamXav - the free virus scanner for Mac OS X | Geobunny learns to fly
     
Mac Elite
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status: Offline
Reply With Quote
Aug 31, 2004, 08:36 PM
 
Forgot to add this.

How to make it happen:
Create a new Xcode project and choose "Cocoa-Java Application" type from the "Application" section.

Double click the Interface Builder nib file from within the Xcode project window.
Add a button (or anything else which will send an event to a class) to the main window
Create a new class, with an action.
Connect the button to the action so that the action method gets called when the button is pressed.
Instantiate the class and add it to the project.
Close the Interface Builder nib file.
Put a few lines of simple code ( such as System.out.println("foo") etc ) inside the new method of the newly instantiated class file, and enable a breakpoint on one of these new lines.

Click "build and debug". When the app launches, click the button and the output you're expecting will appear ... but the debugger will not be entered. ie. The program execution will not pause at the breakpoint.

Makes it almost impossible to find/fix bugs!
ClamXav - the free virus scanner for Mac OS X | Geobunny learns to fly
     
Mac Enthusiast
Join Date: Apr 2001
Location: 127.0.0.1
Status: Offline
Reply With Quote
Sep 2, 2004, 07:04 AM
 
Yep, I've got the same problem here.

I quickly scanned Apple's java-dev list for a solution but came up empty.
     
Mac Elite
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status: Offline
Reply With Quote
Sep 2, 2004, 02:39 PM
 
Hmm, there's no answer on Apple's discussions pages either (discussions.info.apple.com) however, someone else has mentioned the problem. I've sent a full bug report so hopefully something will come of that.
ClamXav - the free virus scanner for Mac OS X | Geobunny learns to fly
     
Fresh-Faced Recruit
Join Date: Dec 2003
Location: Montreal, Canada
Status: Offline
Reply With Quote
Sep 5, 2004, 11:31 PM
 
The problem is that by default the debugger is set to be gdb instead of the java debugger. Do a Get Info on the executable in xcode and somewhere there is the option to specify which debugger to use. Change it to java debugger and you will be back in business.
     
Mac Elite
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status: Offline
Reply With Quote
Sep 6, 2004, 02:48 AM
 
Originally posted by froodq:
The problem is that by default the debugger is set to be gdb instead of the java debugger. Do a Get Info on the executable in xcode and somewhere there is the option to specify which debugger to use. Change it to java debugger and you will be back in business.
Tried that, but I can't seem to see where to change it. Plus, this is an old project, so it should already have the correct debugger set.
ClamXav - the free virus scanner for Mac OS X | Geobunny learns to fly
     
Fresh-Faced Recruit
Join Date: Dec 2003
Status: Offline
Reply With Quote
Sep 7, 2004, 01:56 PM
 
Real programmers don't document.
If it was hard to write, it should also be hard to understand.

Well what happens if your the one trying to understand the code you wrote a year ago?
     
Mac Elite
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status: Offline
Reply With Quote
Sep 7, 2004, 03:59 PM
 
Originally posted by steve1341:

Well what happens if your the one trying to understand the code you wrote a year ago?
Umm, it's a joke! ...unless you're a sh*t-hot programmer in which case you'll either remember it all or understand it on your first re-read. Unfortunately I'm not one said programmers and I do have to document a lot of my code.
ClamXav - the free virus scanner for Mac OS X | Geobunny learns to fly
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:12 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2