From 4eb628b862856c760efd415b9ac2ec06ade70cf8 Mon Sep 17 00:00:00 2001 From: Alvaro Sanchez-Leon Date: Fri, 27 Sep 2013 09:07:48 -0400 Subject: [PATCH] Bug 418176 - Register view does not refresh register names per process Change-Id: I656593bb655d3a384fbcc179ca77e81c9f804f8a Signed-off-by: Alvaro Sanchez-Leon Reviewed-on: https://git.eclipse.org/r/16837 Reviewed-by: Marc Khouzam IP-Clean: Marc Khouzam Tested-by: Marc Khouzam --- .../cdt/dsf/mi/service/MIRegisters.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java index 817438db480..e0239b89425 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java @@ -10,12 +10,15 @@ * Ericsson - Modified for additional features in DSF Reference Implementation * Roland Grunberg (RedHat) - Refresh all registers once one is changed (Bug 400840) * Alvaro Sanchez-Leon (Ericsson) - Make Registers View specific to a frame (Bug 323552) + * Alvaro Sanchez-Leon (Ericsson) - Register view does not refresh register names per process (Bug 418176) *******************************************************************************/ package org.eclipse.cdt.dsf.mi.service; import java.util.ArrayList; +import java.util.HashMap; import java.util.Hashtable; import java.util.List; +import java.util.Map; import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; import org.eclipse.cdt.dsf.concurrent.ImmediateDataRequestMonitor; @@ -175,7 +178,8 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach private CommandFactory fCommandFactory; - private MIRegisterGroupDMC fGeneralRegistersGroupDMC; + //One Group per container process + private final Map fContainerToGroupMap = new HashMap(); private CommandCache fRegisterNameCache; // Cache for holding the Register Names in the single Group private CommandCache fRegisterValueCache; // Cache for holding the Register Values @@ -519,10 +523,16 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach return; } - if (fGeneralRegistersGroupDMC == null) { - fGeneralRegistersGroupDMC = new MIRegisterGroupDMC( this , contDmc, 0 , "General Registers" ) ; //$NON-NLS-1$ + //Bug 418176 + //Only one group per Process (container) is supported for the time being + MIRegisterGroupDMC registerGroup = fContainerToGroupMap.get(contDmc); + + if (registerGroup == null) { + registerGroup = new MIRegisterGroupDMC( this , contDmc, 0 , "General Registers" ) ; //$NON-NLS-1$ + fContainerToGroupMap.put(contDmc, registerGroup); } - MIRegisterGroupDMC[] groupDMCs = new MIRegisterGroupDMC[] { fGeneralRegistersGroupDMC }; + + MIRegisterGroupDMC[] groupDMCs = new MIRegisterGroupDMC[] { registerGroup }; rm.setData(groupDMCs) ; rm.done() ; }