Community
Participate
Working Groups
In Bug 335528 I created a sequence called StartOrRestartSequence_7_0. This sequence was meant to be used for GDB >= 7.0. This is what I did for the restart case. However, when I got to the 'start' case, I mistakenly made DebugNewProcessSequence call StartOrRestartSequence_7_0. This is wrong because DebugNewProcessSequence is used for older GDBs. My first idea to fix this was to have a StartOrRestartSequence for older GDBs. However, this also required a DebugNewProcessSequence_7_0 version to call StartOrRestartSequence_7_0, and things started to be really confusing because of two things: 1- versioning a sequence, even with the new ReflectionSequence, is not as clean as versioning a service. 2- StartOrRestartSequence_7_0 is being called from two distinct places: DebugNewProcessSequence for the 'start' case, and GDBProcesses_7_0 for the 'restart' case. This is not a good idea because if we need to override the sequence, we must override it in two places. I think a cleaner approach is to add IGDBProcesses#start to match IGDBProcesses#restart (which is what we used to do in IGDBControl), which would allow us to call StartOrRestartSequence_7_0 from a single location, which is the IGDBProcesses services. Attached, for reference only, is the (untested) patch for the first approach which I'm not going to use. I will attach the second approach soon.
Created attachment 189766 [details] Duplicating StartOrRestartSequence (for reference only)
Created attachment 189767 [details] Fix Here is the fix using IGDBProcesses#start, which is a much simpler solution (patch is almost 3 times smaller). I also noticed that IGDBProcesses#restart should return (in the requestMonitor) the newly formed IContainerDMContext. Committed to HEAD.
Mikhail, can you review?
*** cdt cvs genie on behalf of mkhouzam *** Bug 338171: StartOrRestartSequence_7_0 is being called for older GDBs [*] GdbRestartCommand.java 1.5 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbRestartCommand.java?root=Tools_Project&r1=1.4&r2=1.5 [*] DebugNewProcessSequence.java 1.4 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/DebugNewProcessSequence.java?root=Tools_Project&r1=1.3&r2=1.4 [*] GDBProcesses.java 1.13 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java?root=Tools_Project&r1=1.12&r2=1.13 [*] GDBProcesses_7_0.java 1.36 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java?root=Tools_Project&r1=1.35&r2=1.36 [*] IGDBProcesses.java 1.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBProcesses.java?root=Tools_Project&r1=1.6&r2=1.7 [*] SyncUtil.java 1.18 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java?root=Tools_Project&r1=1.17&r2=1.18
Code looks good. What do I need to do to try it?
(In reply to comment #5) > Code looks good. What do I need to do to try it? Did I not answer you? Sorry, I just noticed. If you launch a debug session with GDB 6.8, it should no longer call StartOrRestartSequence_7_0 but should instead call GDBProcesses#startOrRestart()