Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] GDB, Terminate, and project refresh(es)

For the same reason that proejct refresh occurs at the end of a build
-- running external tools may change the underlying project on disk.

This seems to be a huge source of frustration for users.  On Linux, in
particular, Eclipse can quickly get out of sync with the filesystem --
I frequently see the "Resource is out of sync with filesystem" error
in the editor on open (and yes, I do have automatically refresh
workspace on). The fix is a manual refresh of that file -- why the
editor can't do this for me (or ignore the sync bits) is beyond me.
[I've filed & commented on bugs to this effect and the Platform guys
don't seem to get that there's a usability issue.]

What would be neat is some API to say:
Schedule a refresh of this sub-tree, it may have changed, but do the
best effort as a separate Job.  By best effort I mean don't block
anything else that may want to lock resources or run with resource
scheduling rules. And if a Job tries to run with a scheduling rule,
then let the Job preempt the refresh.

That platform already does something like this for auto-build. If an
auto-build is running when you do Workspace.run() with some scheduling
rule it will interrupt it. It would surely be possible to extend /
improve the RefreshManager to be user (ISV) driven.  (Taking a quick
look at the code, RefreshManager.refresh(IResource) already exists but
this Manager is currently internal...)

Of course there are valid reasons for running the refresh in the
current thread. For example at the end of build it's used for creating
the resource delta for the next build. [Though this might be breaking
for other reasons -- allowing builds to run with less than workspace
root scheduling rule...]

It seems that a lot of places where we do IResource.refreshLocal(...)
in the current thread, with the current locks, would be better
deferred and scheduled to the background best effort?

Does anyone have any thoughts on this?

James

2009/2/12 Pruitt, John <john.pruitt@xxxxxxxxxxxxx>:
> In
> org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
> there is a function called handleDebugEvents. If the event is a TERMINATE
> for a Process-like object, it looks like it does a refresh of the project
> associated with the process being terminated.
>
> When a simple project like hello is started with run->debug using GDB and
> then a "Terminate and Relaunch" action is chosen on this process, there
> appear to be two TERMINATE events created for Process-like objects. These
> two events are created at:
>
> RuntimeProcess.fireTerminateEvent
> GDBProcess.fireTerminateEvent
>
> I was wondering about two things.
>
> 1. Why is a project refreshed when a debug Terminate action is chosen?
> 2. Why is the project refreshed twice?
>
> Thanks.
>
> John Pruitt
> Wind River Systems
> 630-971-6430
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>


Back to the top