Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-11173

Android: Debugger: breakpoint at global unassigned variable declaration hits next statement instead

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Invalid
    • Affects Version/s: Release 2.1.2, Release 2.1.3, Release 3.0.0
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Titanium SDK: 2.1.2.GA, 2.1.3.v20120925134611, 3.0.0.v20120925124913
      Titanium Studio: 2.1.2, 3.0.0.201209252419
      OS: Mountain Lion 10.8.2
      Device: Android Emulator 2.3.3

      Description

      Breakpoints at global unassigned variable declarations are skipped and hit at next statement instead. However, unassigned variable declarations in anonymous functions are correctly hit.

      For example:

      var deadVar1; // breakpoint
       
      Ti.API.info('Global Variables Defined!');
       
      (function(){
      	var deadVar2; // breakpoint
      	
      	Ti.API.info('Anonymous Function Called!');
      })();
       
      alert('App Exited!');
      

      Running this code in debug mode will result in the first breakpoint being hit at the next statement (e.g., 'var deadVar1' stops at 'Ti.API.info('Global Variables Defined!')').

      Steps to Reproduce:

      1. Run code in debug (manually insert breakpoints as per code comments):

      var deadVar1; // breakpoint
       
      Ti.API.info('Global Variables Defined!');
       
      (function(){
      	var deadVar2; // breakpoint
      	
      	Ti.API.info('Anonymous Function Called!');
      })();
       
      alert('App Exited!');
      

      Actual Result:

      App skips the first breakpoint, but stops at the next statement.

      Pressing 'Resume' will correctly hit the unassigned variable in the anonymous function.

      Expected Result:

      The first breakpoint should be hit and pressing 'Resume' should hit the next breakpoint.

      Here is the expected console log for the sample code:

      [INFO] Global Variables Defined!
      [INFO] Anonymous Function Called!
      

        Attachments

        1. MyProject.zip
          2.98 MB
        2. iosdebugger.log
          2 kB
        3. console-log.txt
          0.1 kB
        4. app.js
          0.2 kB
        5. androiddebugger.log
          4 kB

          Issue Links

            Activity

              People

              • Assignee:
                emerriman Eric Merriman
                Reporter:
                dhyde Dustin Hyde
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-14459
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration