Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359783 - [run control] SteppingController step timeout doesn't work when container is resumed
Summary: [run control] SteppingController step timeout doesn't work when container is ...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0.2   Edit
Assignee: Pawel Piech CLA
QA Contact: Pawel Piech CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-03 23:48 EDT by Pawel Piech CLA
Modified: 2012-02-08 14:38 EST (History)
3 users (show)

See Also:
aleherb+eclipse: review+


Attachments
Patch with fix. (6.71 KB, patch)
2011-10-04 00:07 EDT, Pawel Piech CLA
pawel.1.piech: iplog-
Details | Diff
Updated fix. (5.86 KB, patch)
2011-10-05 01:29 EDT, Pawel Piech CLA
pawel.1.piech: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Piech CLA 2011-10-03 23:48:04 EDT
The user-visible effect is that the stepping control actions do not become disabled when stepping over a long-running operation.

We found a bug in the SteppingController in cases where the whole process/container is resumed in response to a step request.  The occurs when the IResumedEvent.getReason() != StateChangeReason.STEP.

There's probably a few different methods to fix this behavior.  My fix changes the handling of the timeout timer to start when the step command is executed successfully instead of when the resume event is received (I'll submit a patch in a bit).
Comment 1 Pawel Piech CLA 2011-10-04 00:07:33 EDT
Created attachment 204485 [details]
Patch with fix.
Comment 2 Pawel Piech CLA 2011-10-04 00:11:38 EDT
Toni, could you please review my fix attempt.  I tested it and it works but I'm not sure about potential side effects.
Comment 3 Anton Leherbauer CLA 2011-10-04 03:06:08 EDT
(In reply to comment #2)
> Toni, could you please review my fix attempt.  I tested it and it works but I'm
> not sure about potential side effects.

Looks good. There is just one subtle difference in

    public void eventDispatched(final ISuspendedDMEvent e)

When the context has already timed out, the step queue was not processed immediately. I guess this makes sense to give a user the chance to stop stepping early enough. To avoid any surprises, I think this should be kept the same.
Comment 4 Martin Oberhuber CLA 2011-10-04 04:20:58 EDT
CQ:WIND00307786
Comment 5 Pawel Piech CLA 2011-10-05 01:29:48 EDT
Created attachment 204563 [details]
Updated fix.

I've been testing and debugging the patch for most of the day.  I found a couple of issues and fixed them in this updated patch.
Comment 6 Pawel Piech CLA 2011-10-05 01:47:30 EDT
I pushed the fix to master and cdt8_0.

(In reply to comment #3)
> ...
>     public void eventDispatched(final ISuspendedDMEvent e)

I almost forgot, made an additional commit.
Comment 7 CDT Genie CLA 2011-10-05 02:23:01 EDT
*** cdt git genie on behalf of Pawel Piech ***

    Bug 359783 - [run control] SteppingController step timeout doesn't work
    when container is resumed

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d643d3b26edd27abb0bd80c4c3621f00c95277b7
Comment 8 CDT Genie CLA 2011-10-05 02:23:02 EDT
*** cdt git genie on behalf of Pawel Piech ***

    Bug 359783 - [run control] SteppingController step timeout doesn't work
    when container is resumed

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=53debd58aeaa953aa4fb7c4cdc98e4161b9fbfec
Comment 9 CDT Genie CLA 2011-10-05 02:23:03 EDT
*** cdt git genie on behalf of Pawel Piech ***

    Bug 359783 - (comment #3: Fixed handling of suspended event to match
    previous behavior)

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=93d76c18d7b1444d206bb6311120a3a34d783275
Comment 10 CDT Genie CLA 2011-10-05 02:23:05 EDT
*** cdt git genie on behalf of Pawel Piech ***

    Bug 359783 - (comment #3: Fixed handling of suspended event to match
    previous behavior)

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=2c9c30c92e08f928e6fb849265e4a2694aae12f3
Comment 11 Pawel Piech CLA 2011-10-05 18:56:55 EDT
I spent another day of testing and debugging the SteppingController, and found some more issues (this module is turning into a black hole for me... sucking up all available time-space).  I pushed out a couple more fixes.
Comment 12 CDT Genie CLA 2011-10-05 19:23:02 EDT
*** cdt git genie on behalf of Pawel Piech ***

    Bug 359783 - (Fix matching of timed-out event contexts and tracking
    timed-out flags)

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d722e5a8f615e0368a3aa35c2d4fcbefb8bbebeb
Comment 13 CDT Genie CLA 2011-10-05 19:23:03 EDT
*** cdt git genie on behalf of Pawel Piech ***

    Bug 359783 - (Avoid assertion error in case of inconsistent model
    events)

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=bdd74fd79e98c593e9e4eeba96843d278bb60ddc
Comment 14 CDT Genie CLA 2011-10-05 19:23:05 EDT
*** cdt git genie on behalf of Pawel Piech ***

    Bug 359783 - (Fix matching of timed-out event contexts and tracking
    timed-out flags)

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=8433a8acd97cc783c9de2d794df00e7f01722716
Comment 15 CDT Genie CLA 2011-10-05 19:23:06 EDT
*** cdt git genie on behalf of Pawel Piech ***

    Bug 359783 - (Avoid assertion error in case of inconsistent model
    events)

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=732b4c86abe03349b540f27fbddbf4e8405032a8