Community
Participate
Working Groups
I've noticed that the 'gdb traces' are no longer automatically being shown on Windows. I traced the issue to the fact that TracingConsoleManager.startup reads the preference before that same preferences are defaulted in GdbPreferenceInitializer. I don't know why this is happening now, and why on Windows.
This is happening on Linux too!
I've traced this bug to the changes for the "non-stop default preference" of bug 347245. To reproduce: 1- have the gdb traces enabled in Preferences->C/C++->Debug->GDB 2- restart eclipse 3- launch a DSF-GDB debug session without doing anything else before. This launch will will call LaunchUtils.getIsNonStopMode() which now calls LaunchUtils.getIsNonStopModeDefault(); this last method accesses the dsf.gdb.ui preferences. At the same time the dsf.gdb.ui plugin isbeing started which will call TracingConsoleManager.startup() which will also access the dsf.gdb.ui preferences. It seems the the first access to the preferences is planning on calling GdbPreferenceInitializer() but has not done so yet; for some reason, TracingConsoleManager.startup() now thinks everything is already initialized and gets the wrong preference. Could this be a bug in the platform?
Created attachment 197322 [details] Temporary hack to fix the bigger issue This patch removes the call to getIsNonStopModeDefault() to avoid this race condition. The consequence is that: if the non-stop default preference is set to true AND the user right-clicks on a project and chooses Debug As->C/C++ application AND there is no existing debug launch for this project THEN that launch will use non-stop but without the NonStop RunControl service. Basically, that launch instance will be bad. To me, this is a much lesser problem than not having the 'gdb traces' enabled by default. Since we are running out of time, I committing this and we'll see if we can fix the bad side effect in time.
*** cdt cvs genie on behalf of mkhouzam *** Bug 348159: Tracing console is not shown automatically. Hack to get it working in time for Indigo. Needs to be revisited. [*] LaunchUtils.java 1.25 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java?root=Tools_Project&r1=1.24&r2=1.25
The reason for the problem is that: we currently read a preference in the start() method of the dsf.gdb.ui plugin, by calling TracingConsoleManager.startup(). 1- The dsf.gdb plugin calls pref.getBoolean("dsf.gdb.ui", nonStopPref) in LaunchUtils.getIsNonStopModeDefault() 2- The dsf.gdb.UI plugin has to be started to get that preference, and will need to call the preferenceInitializer 3- But dsf.gdb.ui.start() actually calls pref.getBoolean("dsf.gdb.ui", tracingPref) At this time, the prefInitializer has not been called yet, I assume because it is waiting for the plugin startup to be finished, so we get the wrong preference value (it does not try to call the prefInitializer itself). I thought about putting the call to the preference store into a job so it will allow the plugin to finish its startup. However I think that can lead to a race condition because that new job is on another thread and could still be run before the prefInitializer is run (the start() of a plugin is not on the UI thread). It was suggested to move the entire preferences to dsf.gdb, as code does: http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg22107.html
Created attachment 197640 [details] Move preferences to dsf.gdb plugin and remove hack This patch moves the preferences to the dsf.gdb plugin, which allows them to be initialized without having to start the dsf.gdb.ui plugin. The patch also removes the "Temporary hack to fix the bigger issue". It will need to wait for Juno.
Created attachment 198686 [details] Git patch to move preferences to dsf.gdb plugin and remove hack This is the git patch that moves the preference store for dsf.gdb.ui to dsf.gdb and removes the hack that I had to put to get the tracing console to show up. I committed it to master and to 8_0
Sergey, can you review?
Looks good to me.