Complete
over 4 years ago

If issue is still present, please resubmit a bug report.

Debugger challenges - not able to set breakpoints

Hi,

Very frustrated over the last couple of weeks with the debugger being absolutely useless. Every time I set a breakpoint and start the code executing it tells me I can't set a breakpoint. This is a widget/glance.

I normally use prints but have hit a problem where the app storage fails to read in the simulator. I found two things: firstly the simulator was picking up another apps dataset due to some name overlap and secondly when I reset and deleted data in the app the initialisation code now fails to setup any storage according to the simulator.

The code itself has worked in other apps and also worked until I changed a class to a module as a revised version had no need for a class.

I've tried re-installing the SDK and eclipse plug-in separately and together. I've also tried previous versions of the SDK. Same crash on read of store and no debugging capability.

Almost had enough of these tools. Note the debugging doesn't work in visual studio either.

Any ideas welcome besides reverting the code (this doesn't help the debugger but might fix crash).

Regards,

David  

Parents
  • Hi Jim. 

    Thanks for the quick feedback. I had previously deleted the current widget's data and reset the app which had no effect. I also tried deleting all apps. I think the store clash previously was due to me not changing the UUID but I did do this after seeing this error.

    The store still has no values and the debugger can't set breakpoints. However, the debugger can set breakpoints and trigger them in another app. So something about the code structure/use of glance is confusing it.

    I'll try two experiments:

    1. Remove glance function and make it a widget only

    2. Revert my storage handling back to a class (code would execute but not debug previously)

    any other ideas welcome.

    Regards,

    David

Comment
  • Hi Jim. 

    Thanks for the quick feedback. I had previously deleted the current widget's data and reset the app which had no effect. I also tried deleting all apps. I think the store clash previously was due to me not changing the UUID but I did do this after seeing this error.

    The store still has no values and the debugger can't set breakpoints. However, the debugger can set breakpoints and trigger them in another app. So something about the code structure/use of glance is confusing it.

    I'll try two experiments:

    1. Remove glance function and make it a widget only

    2. Revert my storage handling back to a class (code would execute but not debug previously)

    any other ideas welcome.

    Regards,

    David

Children
  • Further update.

    1. Removing glance annotation and making this an app runs fine and debuuger works with breakpoints being triggered.

    2. Debugging on a Venu as a widget it all gets loaded as a glance as expected. Debugger fails to set any breakpoints or removes them when app is run

    3. Debugging as a widget with glance annotation means debugger removes all breakpoints as per (2)

    My conclusion is that there is a bug in the debugger when glance annotation is used

  • Further update after hours more digging. I found that the cause of the property read failure was caused by the application settings being null in memory when executing. The JSON file was correct but for some reason on loading they became null. I removed some settings and recompiled to force them to change but that didn't work. In the end a number of cycles of app data reset and delete all apps seemed to allow them to load correctly. I also took all property reads out of the glance code sequence which may or may not have had an affect. 

    The debugger briefly allowed breakpoints in the glance code sequence but NOT the main widget code. After a few runs it stopped doing this as well. The only differences I can see between this code and a fully working app are a) It uses glances and b) it uses modules (for the first time) and c) it's a widget. All the eclipse and connect settings and project attributes (nature, compiler options, manifest options) are the same.

    So I can try modules back to classes, then make it an app then widget with no glance to narrow this down. Lost as to what is causing this. 

  • further weird behaviour. Now a previous working app and the new widget give "Error: Unexpected Type Error Details: Failed when updating logger stats Stack:" twice or more as they run.

    I am using  toybox.Application.Properties; and using Properties.get/setValue to read the widget properties. If I force a write (setValue) immediately before the read then the code is successful.

    Viewing memory I can see the <application settings> are correctly at their initial values. With or without the forced write.

    Debugger now allows me to set a breakpoint but ignores it and continues. Sadly this only happened once and now it says it can't be set.

    The error on read of the application property is "Error: Unexpected Type Error Details: Failed invoking symbol" 

    Regards,.

    David

  • Understand if you use Application.Storage vs Application.Properties, they use different files in different locations (data vs settings).

    And if you use Application.getApp().get/set property, if it's the object store or settings is determined based on if you have the property defined in the xml.  If no property, data, if property, settings.  And in the case of the object store, it's a different file than Application.Storage.

    As far as storage, when things are written at different times based on using the old or new object store.

  • Would I be correct in assuming that the store is only written when the app successfully exits and hence the crash is prohibiting the initial set up of valid values? Note that I am reading using (app.)Properties.getValue() as the values I am trying to access are properties of the widget.