8 Replies Latest reply on Jun 23, 2009 5:12 AM by CoreyRLucier

    FB4: 'Step Over' in Debug not staying within current file

    Andy Ingham

      Hi,

       

      I'm debuggingg an application but 'Step Over' facility not working as expected. When I hit 'Step Over' in the following situation (currently on line in CategoryView.mxml).....

       

      Capture3.JPG

      ...it takes me into Container.as, which I think is part of standard Flex framework...

      Capture4.JPG

      I would really appreciate someone explaining to me how 'Step Over' should be working.

       

      Thanks,

       

      Andy

        • 1. Re: FB4: 'Step Over' in Debug not staying within current file
          Andy Ingham Level 1

          Apologies: used Snipping Tool to capture screen shots, which looked fine when posting, but seem a bit blurry now!

          • 2. Re: FB4: 'Step Over' in Debug not staying within current file
            CoreyRLucier Adobe Employee

            From the Flex Builder documentation:

             

            Breakpoints can be set on both ActionScript and MXML code.   Breakpoints on MXML code are valid only when ActionScript event handlers  exist. In cases where you set a breakpoint on an invalid MXML line, Flex  Builder will attempt to find the nearest valid breakpoint. It does so by scanning the next 10 lines of execution for points where a breakpoint  would be valid, and automatically moving the breakpoint to that location.

             

            It looks as though the break point you expected to set (for the click handler) is actually breaking when your component is being created... e.g. in the actual constructor of your custom component.

             

            I think this might be worthy of filing a Flex Builder bug.  Seems contrary to the documentation or expected behavior.

             

            If I set a breakpoint on an event handler within the body of the MXML document (say a click handler on a button), seems to be working correctly. This may only be an issue with event handlers in the root tag

            1 person found this helpful
            • 3. Re: FB4: 'Step Over' in Debug not staying within current file
              Andy Ingham Level 1

              Corey,

               

              Many thanks for getting back so soon!

               

              I have to confess that this is early days for me with Flash Builder, so not really sure that this is an issue, rather than my own understanding.

               

              As I see it though, there doesn't seem to be a problem with the Breakpoints as such; the debugger did stop at my Breakpoint and I was able to 'Step Over' a few lines of code. The problem was specifically that when I hit 'Step Over' on the click="categorySelect()"> line, it stepped into the Container.as code.

               

              I did actually fix the original bug that was causing me to be using Debug in the first place, so I'll just see how things go in future.

               

              Andy

              • 4. Re: FB4: 'Step Over' in Debug not staying within current file
                CoreyRLucier Adobe Employee

                Right but stepping *INTO* categorySelect should have ended up inside your categorySelect() method...  but looking at where you landed with step *OVER* it looks like that breakpoint was firing not as a result of the 'click' but as a result of your component being instantiated...which kinda seems astonishing and should be looked into IMHO (on Flash Builder's end)?

                 

                Can you confirm if you breakpoint landed because of an actual click, and that stepping "in" lands correctly inside categorySelect? If not, then this might be busted.

                 

                -C

                • 5. Re: FB4: 'Step Over' in Debug not staying within current file
                  Andy Ingham Level 1

                  I think that the Breakpoint is firing as a result of my Custom Component being instantiated, as you say. Shouldn't it be?

                   

                  To re-confirm what I'm doing:

                   

                  1. I've set a breakpoint at the start of my Custom Component which is called CategoryView.mxml. This is instantiated from the main application file, which is called EComm.mxml. This CategoryView.mxml component is based on <mx:HorizontalList>.
                  2. The breakpoint in CategoryView is firing before I have interacted with application at all, I think upon its instantiation. The line is as follows:

                    <mx:HorizontalList xmlns:mx="http://www.adobe.com/2006/mxml"
                        dataProvider="{cats}"
                        itemRenderer="views.ecomm.TextAndPic" 
                        horizontalScrollPolicy="off"
                        click="categorySelect()">
                  3. When I hit 'Step Over' debug goes into the specified click event handler:

                      private function categorySelect():void{
                        var e:CategoryEvent = new CategoryEvent(this.selectedItem
                        as valueObjects.Category, "categorySelect");
                        this.dispatchEvent(e);
                      }
                  4. When I hit 'step over' again it goes back to the <mx:HorizontalList> tag (as shown in [2] above).
                  5. When I hit 'step over' again it then dives into the Container.as code.

                   

                  Let me know if, given this more detailed explanation, you still think it sounds odd.

                   

                  Again, thanks for your help.

                  • 6. Re: FB4: 'Step Over' in Debug not staying within current file
                    CoreyRLucier Adobe Employee

                    This flow sounds right in the case of when your component gets constructed.

                     

                    At the time it breaks look at the call stack.  Step Over will pop a level of the stack if there are no additional lines to execute in the current context.  Since your component is being created from a component descriptor (from Container)..things look right.

                     

                    I was just commenting on the fact that...since you only had a break point on the line with the click handler... my assumption was that it should have only fired for an actual click (not construction of your component).

                     

                    e.g.

                     

                    <s:Button label="foo"

                       click="myClick()"/>  <--- BREAKPOINT

                     

                    See these old docs:  http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/js/html/wwhelp.htm?href=tutorial_de bug_025_07.html

                     

                    But evidently things have changed..and that breakpiont will now get fired for everything related to the associated tag (construction, each property initializer, and finally the click event).

                     

                    Either way, I research it for my own edification and post here with a clarification if appropriate.

                    • 7. Re: FB4: 'Step Over' in Debug not staying within current file
                      Andy Ingham Level 1

                      Yes, I checked the Call Stack and all seems to be as you say.

                       

                      Andy

                      • 8. Re: FB4: 'Step Over' in Debug not staying within current file
                        CoreyRLucier Adobe Employee

                        As to my original confusion around when that 'click' line should actually break, a bug is filed here:  http://bugs.adobe.com/jira/browse/SDK-21956.