Community
Participate
Working Groups
Build Identifier: I20101208-1300 When attaching several processes using GDB 7.2 and GDB's DSF plugin the disassembly window is not aware that there are several processes. The thread ID of the user-selected thread is not specified in the MI command to disassemble code. Consequenlty, if several processes are debugged altogether the disassembly window might display the code for the wrong process. Example of a typical diassembly command issued by Eclipse: 83-data-disassemble -s 247506561616 -e 247506561696 -- 0 To avoid this problem, GDB 7.2's thread option should be added: 83-data-disassemble --thread 2 -s 247506561616 -e 247506561696 -- 0 Note that other windows such as the variable window and the memory window already use this option. Example: 85-var-create --thread 4 --frame 2 - * i Reproducible: Always Steps to Reproduce: 1.Create a new debug configuration "C/C++ Attach to Application" using the DSF laucher. 2. Use gdb v7.2 as the debugger. 3. Attach two different applications using the same debug session. 4. Switch among the two processes and inspect the content of the disassembly window. The disassembly window does not switch its content correctly.
Thanks for reporting this. It is a big deal. The reason is that the IDisassemblyDMContext is still implemented by GDBControlDMContext which represents GDB, instead of being implemented by MIContainerDMC. We have to move that interface is the same fashion as for bug 335324 and bug 335325.
Created attachment 194458 [details] Proposed fix This simple patch moves the IDisassemblyDMContext to MIContainerDMC. Things seem to work better and the JUnit tests for Disassembly pass. But then I ran into Bug 344408 which prevents from properly showing the source code in the disassembly view, which affects the second process we add to the multi-process session. This patch is still an improvement and I think it is ok even before we fix Bug 344408. I'll try to get others that know Disassembly better than myself to review the patch fast since we are so close to the M7 build.
Toni, this patch is very simple but makes a serious change. I was hoping to get your opinion on it
John, your opinion would be valuable as well.
A note on the API changes. The fix still works even if we don't remove IDisassemblyDMContext from GDBControlDMContext. So, if you guys feel that part of the change impacts API too much, we could leave GDBControlDMContext as is (with a comment).
Created attachment 194459 [details] Fix for JUnit tests only I committed the fix for the JUnit tests only, which works with or without the full fix.
Created attachment 194460 [details] Proposed fix (no Junit) This is the fix itself, without the JUnit change. 3-line change.
*** cdt cvs genie on behalf of mkhouzam *** Bug 344298: JUnit support for Disassembly in case of multi-process. [*] MIDisassemblyTest.java 1.5 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/tests/MIDisassemblyTest.java?root=Tools_Project&r1=1.4&r2=1.5
Makes sense, +1 for the API change. I don't think this would break existing code.
(In reply to comment #9) > Makes sense, +1 for the API change. I don't think this would break existing > code. Thanks Toni! Committed to HEAD.
I think I messed up the review flags by re-using an already-open webpage. Toni, if you can try to re-mark it as approved, that would be nice. Thanks.
*** cdt cvs genie on behalf of mkhouzam *** Bug 344298: Support for Disassembly in case of multi-process. [*] GDBControlDMContext.java 1.5 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControlDMContext.java?root=Tools_Project&r1=1.4&r2=1.5 [*] MIProcesses.java 1.15 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIProcesses.java?root=Tools_Project&r1=1.14&r2=1.15 [*] GDBProcesses_7_0.java 1.49 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.48&r2=1.49
Bug 344408 has been fixed, but it was not sufficient for the multi-process case. I opened Bug 344471 for the multi-process case.