[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-dev] org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab
|
Hi!
At the bottom of handleDebuggerChanged() sit the following two
statements:
getDynamicTab().setDefaults(wc);
getDynamicTab().initializeFrom(wc);
Saved changes to parameters set in the launch by dynamic tabs will
never be displayed because the setDefaults instantly overwrites whatever
was in the ILaunchConfigurationWorkingCopy and intializeFrom then sets
the values visible in the dialog.
Certainly the observed behavior is that if you set the MI debugger field
from "gdb" to "my-gdb", hit apply, and close the
dialog you will see my-gdb appear in the .metadata/.plugin/.... tracking
file for the launch. You will not see my-gdb in the text panel when you
return to the dialog because it was ovewritten by the call to
setDefaults.
I can see why the call is there. The person was thinking that you need to
set some valid values the first time a page is fired up. If that behavior
is really necessary then the AbstractCDebuggerTab is going to have to put
a dynamicTab specific tag in the ILaunchConfiguration when it first sets
the defaults for a dynamicTab so that it does not do the setDefaults on
dynamicTab switches. It has to keep persistent state because you may make
some changes and return to the tab on another run of the debug panel and
you do not want the saved value overwritten the first time the panel is
pulled up.
Another choice is for the AbstractCDebuggerTab to load up all the pages
at the first and to pass all the top level calls through to all of them.
That's kind of a ugly because of the potential extra loading.
But what if you do not do the setDefaults call? In practice, getAttribute
calls into the ILCWC contain defaults that come back just fine in the
attribute is not there. As long as the defaults specified in the
getAttribute calls in initializeFrom match the defaults in setDefault, I
don't see a problem because performApply then reads these defaults out of
UI and puts them into ILaunchConfiguration.
I removed the setDefaults call and everything seems to be working
"right" over here. We do have a second contributor to
CDebuggerPage and have not removed the mi one yet. It works with both
panels, switching back and forth.
Feel free to let me know if I just took aim on my foot.
Thanks!
-Chris