From c4e7d4729116850e599eb37461b48f54dd2ea674 Mon Sep 17 00:00:00 2001 From: Eugene Tarassov Date: Wed, 13 May 2015 13:25:22 -0700 Subject: TCF Debugger: added added support for updating the Registers view while the context is running - if the context supports reading registers "on fly". --- .../internal/services/remote/RunControlProxy.java | 7 ++++++- .../src/org/eclipse/tcf/services/IRunControl.java | 23 ++++++++++++++++++++-- .../internal/debug/ui/model/TCFNodeRegister.java | 12 +++++++---- 3 files changed, 35 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/RunControlProxy.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/RunControlProxy.java index e751712cd..f11e562ce 100644 --- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/RunControlProxy.java +++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/RunControlProxy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others. + * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -115,6 +115,11 @@ public class RunControlProxy implements IRunControl { return (String)props.get(PROP_SYMBOLS_GROUP); } + @SuppressWarnings("unchecked") + public Collection getRegAccessTypes() { + return (Collection)props.get(PROP_REG_ACCESS_TYPES); + } + public IToken getState(final DoneGetState done) { return new Command(channel, RunControlProxy.this, "getState", new Object[]{ getID() }) { @SuppressWarnings("unchecked") diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IRunControl.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IRunControl.java index f9bd63003..5c53acaa8 100644 --- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IRunControl.java +++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IRunControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others. + * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.tcf.services; +import java.util.Collection; import java.util.Map; import org.eclipse.tcf.protocol.IService; @@ -77,7 +78,12 @@ public interface IRunControl extends IService { /** Context ID of a symbols group that contains the context. * Members of a symbols group share same symbol reader configuration settings, * like user defined memory map entries and source lookup info */ - PROP_SYMBOLS_GROUP = "SymbolsGroup"; + PROP_SYMBOLS_GROUP = "SymbolsGroup", + + /** Array of String, the access types allowed for this context + * when accessing context registers. + */ + PROP_REG_ACCESS_TYPES = "RegAccessTypes"; /** * Context resume modes. @@ -222,6 +228,13 @@ public interface IRunControl extends IService { REASON_ERROR = "Error"; + /** + * Values of "RegAccessTypes". + */ + static final String + REG_ACCESS_RD_RUNNING = "rd-running", /** Context supports reading registers while running */ + REG_ACCESS_WR_RUNNUNG = "wr-running"; /** Context supports writing registers while running */ + /* Optional parameters of context state -------------------------------- */ /** @@ -494,6 +507,12 @@ public interface IRunControl extends IService { */ String getSymbolsGroup(); + /** + * Get the register access types allowed for this context. + * @return collection of access type names. + */ + Collection getRegAccessTypes(); + /** * Send a command to retrieve current state of a context. * @param done - command result call back object. diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeRegister.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeRegister.java index 2e6ea9601..015f69202 100644 --- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeRegister.java +++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeRegister.java @@ -13,6 +13,7 @@ package org.eclipse.tcf.internal.debug.ui.model; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -234,10 +235,13 @@ public class TCFNodeRegister extends TCFNode implements IElementEditor, IWatchIn if (!ctx_cache.validate(done)) return null; IRunControl.RunControlContext ctx_data = ctx_cache.getData(); if (ctx_data != null && ctx_data.hasState()) { - TCFDataCache state_cache = exe.getState(); - if (!state_cache.validate(done)) return null; - TCFContextState state_data = state_cache.getData(); - if (state_data == null || !state_data.is_suspended) return true; + Collection access_types = ctx_data.getRegAccessTypes(); + if (access_types == null || !access_types.contains(IRunControl.REG_ACCESS_RD_RUNNING)) { + TCFDataCache state_cache = exe.getState(); + if (!state_cache.validate(done)) return null; + TCFContextState state_data = state_cache.getData(); + if (state_data == null || !state_data.is_suspended) return true; + } } } return false; -- cgit v1.2.3