×

Discussion Board

Results 1 to 7 of 7

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    61

    Why is debugging so hard!?

    I'm developing MIDlet with JBuilder 9 under WindowsXP (with SP1).
    JBuilder runs fine, debugging goes fine (as long as it is 'regular' java, not a MIDlet).

    But debugging a MIDlet is virtually impossible. Some of the debugging goes fine. I can step over/in/out, see variable values, etc. But I keep having these problems and they make debugging very hard:

    1. Showing the call-stack may cause my emulator to hang, sometimes JBuilder hangs or sometimes I can not properly close the emulator (when i close JBuilder, it says the MIDlet is still running, although no processes are shown in the windows' Task Manager...)

    2. Setting break-points will cause the midlet to stop at these break-points, but there is no visual feedback. I can't see where the current execution line is. Also, the call-stack (if working properly) shows me either i'm in the function 'obsolete()' (what is that!?) or inside runCustomCode() (???? I'm already in my midlet code, just calling a method). Stepping over seems to do nothing until the code is suddenly done with the method i was trying to debug and all works well again.

    3. Debugging code that is executed within a paint() event handler is almost impossible. Sooner or later the debugger will hang or crash.

    Has anyone else had these problems? If so, how did you solve them.

    Thank you very much!
    -- Anton Spaans.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    3
    I use an external debugger called bugseeker. Works great.

    I found the instructions for using it here.. http://discussion.forum.nokia.com/fo...threadid=29318

  3. #3
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    61
    Thanks Rab_UK!

    I never heard of this debugger. I'll be downloading a trial version and I'll test it out.

    -- Anton.

  4. #4
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    61
    Works nice.
    Here is my first impression:

    I use this batch file to start the emulator of my debug-session (the SET commands establish the right environment):

    debugCasio.bat:
    =========================================
    @echo off
    REM set DEVICE=Series_60_MIDP_SDK_for_Symbian_OS_v_1_2_1
    set DEVICE=Series_60_MIDP_Concept_SDK_Beta_0_3_Nokia_edition

    set DEVICE_HOME=C:\Nokia\Devices\%DEVICE%
    set DEBUG_PORT=3999

    set PROJECT_DIR=C:\Nokia\forumnokia\Projects\Casio
    set JADFILE=Casio.jad

    cmd /k %DEVICE_HOME%\bin\emulator.exe -Xdevice:%DEVICE% -Xdebug -Xrunjdwp:transport=dt_socket,address=%DEBUG_PORT%,server=y -Xdescriptor:%PROJECT_DIR%\%JADFILE%
    ===========================================


    Using the Series_60_MIDP_Concept_SDK_Beta_0_3_Nokia_edition device goes really well. Debugging is fast and works well.

    Using Series_60_MIDP_SDK_for_Symbian_OS_v_1_2_1 device works well too, but is very sluggish. Each step-over takes about 5 seconds (sometimes longer). When starting the batch file with this device, you'd better remotely attach the BugSeeker fast, otherwise your desktop may get VEEERRRRYYY slow (i had to do a hard reset of my computer at some point). It does not behave well when a remote debugger is not attached (yet).

    After the emulator is running, attach the BugSeeker's debugger to port 3044. Wait a little and then hit the 'Continue' button.

    Again, Thanks Rab_UK!

    PS: I use "cmd /k" because i'd like to view the console output later.

    BTW: It works (much) better with JBuilder as well, as long as you start the emulator outside of JBuilder and debug remotely.
    Last edited by aspaans; 2004-02-10 at 03:30.

  5. #5
    Registered User
    Join Date
    Apr 2005
    Posts
    4
    and what if DEBUG_PORT=3999, and you're connecting bugseeker to port 3044? Does it really work? Or am i severely missing something?

  6. #6
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Earth
    Posts
    105
    Give Eclipse a go - this works like a dream for me -I use the J2ME module and sun wireless toolkit 2.2 I can debug easily

  7. #7
    Regular Contributor
    Join Date
    May 2003
    Posts
    58
    try NetBeans 4.1 + Mobility Pack
    http://www.netbeans.org/kb/41/mobility.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •