diff options
author | eutarass | 2010-03-18 17:38:20 +0000 |
---|---|---|
committer | eutarass | 2010-03-18 17:38:20 +0000 |
commit | 088066a915f854f584e6d57baaaef8a7ecfbd9e7 (patch) | |
tree | 381a5c42144b66a7823b84cb2f2d22d37705193e /plugins | |
parent | 70cc3ec4fb52b8fe934591b78c517bd3899797ed (diff) | |
download | org.eclipse.tcf-088066a915f854f584e6d57baaaef8a7ecfbd9e7.tar.gz org.eclipse.tcf-088066a915f854f584e6d57baaaef8a7ecfbd9e7.tar.xz org.eclipse.tcf-088066a915f854f584e6d57baaaef8a7ecfbd9e7.zip |
More TCF Symbols Server code. Most services work OK.
The server still needs more work:
1. Stack trace cannot not use ELF .frame_info section.
2. TCF debugger symbols cache flushing logic is incomplete.
Diffstat (limited to 'plugins')
11 files changed, 169 insertions, 115 deletions
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/core/TransportManager.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/core/TransportManager.java index fbdda2c15..631e5ecab 100644 --- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/core/TransportManager.java +++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/core/TransportManager.java @@ -14,7 +14,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Set; @@ -151,8 +150,7 @@ public class TransportManager { public static void peerDisposed(AbstractPeer peer) { Exception error = null; Collection<AbstractChannel> bf = new ArrayList<AbstractChannel>(channels); - for (Iterator<AbstractChannel> i = bf.iterator(); i.hasNext();) { - AbstractChannel c = i.next(); + for (AbstractChannel c : bf) { if (c.getRemotePeer() != peer) continue; if (error == null) error = new Exception("Peer is disposed"); c.terminate(error); @@ -166,10 +164,12 @@ public class TransportManager { * This is internal API, TCF clients should use {@code org.eclipse.tm.tcf.protocol.Protocol}. */ public static void sendEvent(String service_name, String event_name, byte[] data) { - for (Iterator<AbstractChannel> i = channels.iterator(); i.hasNext();) { - AbstractChannel channel = i.next(); - IService s = channel.getLocalService(service_name); - if (s != null) channel.sendEvent(s, event_name, data); + for (AbstractChannel c : channels) { + // Skip channels that are executing "redirect" command - STATE_OPENNING + if (c.getState() == IChannel.STATE_OPEN) { + IService s = c.getLocalService(service_name); + if (s != null) c.sendEvent(s, event_name, data); + } } } @@ -195,10 +195,11 @@ public class TransportManager { if (set.isEmpty()) done.run(); } }; - for (Iterator<AbstractChannel> i = channels.iterator(); i.hasNext();) { - AbstractChannel channel = i.next(); - ILocator s = channel.getRemoteService(ILocator.class); - if (s != null) set.add(s.sync(done_sync)); + for (AbstractChannel c : channels) { + if (c.getState() == IChannel.STATE_OPEN) { + ILocator s = c.getRemoteService(ILocator.class); + if (s != null) set.add(s.sync(done_sync)); + } } if (set.isEmpty()) Protocol.invokeLater(done); } diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/LineNumbersProxy.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/LineNumbersProxy.java index cea1177a2..a45bb0525 100644 --- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/LineNumbersProxy.java +++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/LineNumbersProxy.java @@ -38,6 +38,23 @@ public class LineNumbersProxy implements ILineNumbers { }.token; } + public IToken mapToMemory(String context_id, String file, + int line, int column, final DoneMapToMemory done) { + return new Command(channel, this, "mapToMemory", new Object[]{ context_id, + file, line, column }) { + @Override + public void done(Exception error, Object[] args) { + CodeArea[] arr = null; + if (error == null) { + assert args.length == 2; + error = toError(args[0]); + arr = toTextAreaArray(args[1]); + } + done.doneMapToMemory(token, error, arr); + } + }.token; + } + private static int getInteger(Map<String,Object> map, String name, int def) { Number n = (Number)map.get(name); if (n == null) return def; diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/ILineNumbers.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/ILineNumbers.java index b5492e806..62e4affd8 100644 --- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/ILineNumbers.java +++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/ILineNumbers.java @@ -163,4 +163,10 @@ public interface ILineNumbers extends IService { interface DoneMapToSource { void doneMapToSource(IToken token, Exception error, CodeArea[] areas); } + + IToken mapToMemory(String context_id, String file, int line, int column, DoneMapToMemory done); + + interface DoneMapToMemory { + void doneMapToMemory(IToken token, Exception error, CodeArea[] areas); + } } diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IStackTrace.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IStackTrace.java index f86e61db1..1aae6865c 100644 --- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IStackTrace.java +++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IStackTrace.java @@ -21,18 +21,20 @@ public interface IStackTrace extends IService { static final String NAME = "StackTrace"; /** - * Context property names. + * Stack frame context property names. */ static final String - PROP_ID = "ID", - PROP_PARENT_ID = "ParentID", - PROP_PROCESS_ID = "ProcessID", - PROP_NAME = "Name", - PROP_FRAME_ADDRESS = "FP", - PROP_RETURN_ADDRESS = "RP", - PROP_INSTRUCTION_ADDRESS = "IP", - PROP_ARGUMENTS_COUNT = "ArgsCnt", - PROP_ARGUMENTS_ADDRESS = "ArgsAddr"; + PROP_ID = "ID", /** String, stack frame ID */ + PROP_PARENT_ID = "ParentID", /** String, stack frame parent ID */ + PROP_PROCESS_ID = "ProcessID", /** String, stack frame process ID */ + PROP_NAME = "Name", /** String, human readable name */ + PROP_TOP_FRAME = "TopFrame", /** Boolean, true if the frame is top frame on a stack */ + PROP_LEVEL = "Level", /** Integer, stack frame level, starting from stack bottom */ + PROP_FRAME_ADDRESS = "FP", /** Number, stack frame memory address */ + PROP_RETURN_ADDRESS = "RP", /** Number, return address */ + PROP_INSTRUCTION_ADDRESS = "IP", /** Number, instruction pointer */ + PROP_ARGUMENTS_COUNT = "ArgsCnt", /** Integer, number of function arguments */ + PROP_ARGUMENTS_ADDRESS = "ArgsAddr"; /** Number, memory address of function arguments */ /** * Retrieve context info for given context IDs. diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenSubExpressions.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenSubExpressions.java index e4ff07c43..6001ea1b2 100644 --- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenSubExpressions.java +++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenSubExpressions.java @@ -93,21 +93,9 @@ public class TCFChildrenSubExpressions extends TCFChildren { if (exp instanceof TCFNodeExpression) break; exp = exp.parent; } - final TCFDataCache<IExpressions.Value> value_cache = ((TCFNodeExpression)exp).getValue(); - if (!value_cache.validate(this)) return false; - final IExpressions.Value value_data = value_cache.getData(); - final ISymbols syms = node.model.getLaunch().getService(ISymbols.class); - if (value_data == null || syms == null) { - set(null, null, new HashMap<String,TCFNode>()); - return true; - } - final TCFDataCache<ISymbols.Symbol> type_cache = node.model.getSymbolInfoCache(value_data.getTypeID()); - if (type_cache == null) { - set(null, null, new HashMap<String,TCFNode>()); - return true; - } + TCFDataCache<ISymbols.Symbol> type_cache = ((TCFNodeExpression)exp).getType(); if (!type_cache.validate(this)) return false; - final ISymbols.Symbol type_data = type_cache.getData(); + ISymbols.Symbol type_data = type_cache.getData(); if (type_data == null) { set(null, null, new HashMap<String,TCFNode>()); return true; diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java index d93504c53..cd019fab4 100644 --- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java +++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java @@ -902,15 +902,7 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider, if (locator instanceof ISourceLookupDirector) { source_element = ((ISourceLookupDirector)locator).getSourceElement(area); } - if (source_element == null) { - ILaunchConfiguration cfg = launch.getLaunchConfiguration(); - editor_input = editor_not_found.get(cfg); - if (editor_input == null) { - editor_not_found.put(cfg, editor_input = new CommonSourceNotFoundEditorInput(cfg)); - } - editor_id = IDebugUIConstants.ID_COMMON_SOURCE_NOT_FOUND_EDITOR; - } - else { + if (source_element != null) { ISourcePresentation presentation = TCFModelPresentation.getDefault(); if (presentation != null) { editor_input = presentation.getEditorInput(source_element); @@ -922,6 +914,15 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider, } if (cnt != display_source_cnt) return; } + if (area != null && (editor_input == null || editor_id == null)) { + ILaunchConfiguration cfg = launch.getLaunchConfiguration(); + editor_id = IDebugUIConstants.ID_COMMON_SOURCE_NOT_FOUND_EDITOR; + editor_input = editor_not_found.get(cfg); + if (editor_input == null) { + editor_input = new CommonSourceNotFoundEditorInput(cfg); + editor_not_found.put(cfg, editor_input); + } + } ITextEditor text_editor = null; IRegion region = null; if (editor_input != null && editor_id != null && page != null) { diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelPresentation.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelPresentation.java index 355295120..274bdac3d 100644 --- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelPresentation.java +++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelPresentation.java @@ -113,6 +113,7 @@ public class TCFModelPresentation implements IDebugModelPresentation { if (element instanceof IFile) { return new FileEditorInput((IFile)element); } + // TODO: files outside workspace (e.g. LocalFileStorage) return null; } } diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java index 29cecd7fb..ff6ec41c5 100644 --- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java +++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java @@ -14,7 +14,6 @@ import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate; import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate; @@ -171,8 +170,10 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru private void post() { assert Protocol.isDispatchThread(); if (!posted) { - long idle_time = System.currentTimeMillis() - last_update_time; + long time_now = System.currentTimeMillis(); + long idle_time = time_now - last_update_time; Protocol.invokeLater(MIN_IDLE_TIME - idle_time, this); + last_update_time = time_now; posted = true; } } @@ -215,7 +216,11 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru ModelDelta delta = node2delta.get(node); if (delta == null) { if (node.parent == null) { - delta = root.addNode(model.getLaunch(), -1, flags, getNodeChildren(node).length); + if (root.getElement() instanceof TCFNode) return null; + delta = root.addNode(model.getLaunch(), -1, flags, -1); + } + else if (node == root.getElement()) { + delta = root; } else { int parent_flags = 0; @@ -249,19 +254,22 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru pending_node = null; node2children.clear(); node2delta.clear(); - ModelDelta root = new ModelDelta(DebugPlugin.getDefault().getLaunchManager(), IModelDelta.NO_CHANGE); + Object input = getViewer().getInput(); + int flags = 0; + if (node2flags.containsKey(input)) flags = node2flags.get(input); + ModelDelta root = new ModelDelta(input, flags); for (TCFNode node : node2flags.keySet()) makeDelta(root, node, node2flags.get(node)); if (pending_node == null) { node2flags.clear(); - if (!node2delta.isEmpty()) { + if ((root.getFlags() != 0 || node2delta.size() > 0) && (root.getFlags() & IModelDelta.REMOVED) == 0) { fireModelChanged(root); - node2delta.clear(); } + node2delta.clear(); if (selection != null) { - ModelDelta root1 = new ModelDelta(DebugPlugin.getDefault().getLaunchManager(), IModelDelta.NO_CHANGE); + ModelDelta root1 = new ModelDelta(input, IModelDelta.NO_CHANGE); makeDelta(root1, selection, IModelDelta.REVEAL); node2delta.clear(); - ModelDelta root2 = new ModelDelta(DebugPlugin.getDefault().getLaunchManager(), IModelDelta.NO_CHANGE); + ModelDelta root2 = new ModelDelta(input, IModelDelta.NO_CHANGE); makeDelta(root2, selection, IModelDelta.SELECT); node2delta.clear(); if (pending_node == null) { @@ -273,7 +281,6 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru } if (pending_node == null) { - last_update_time = System.currentTimeMillis(); } else if (pending_node.getData(children_count_update, this)) { assert false; diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java index e22275f17..fd80d6575 100644 --- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java +++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java @@ -249,13 +249,20 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT type = new TCFDataCache<ISymbols.Symbol>(channel) { @Override protected boolean startDataRetrieval() { + String type_id = null; if (!value.validate(this)) return false; IExpressions.Value val = value.getData(); - if (val == null) { + if (val != null) type_id = val.getTypeID(); + if (type_id == null) { + if (!expression.validate(this)) return false; + Expression exp = expression.getData(); + if (exp != null) type_id = exp.expression.getTypeID(); + } + if (type_id == null) { set(null, value.getError(), null); return true; } - TCFDataCache<ISymbols.Symbol> type_cache = model.getSymbolInfoCache(val.getTypeID()); + TCFDataCache<ISymbols.Symbol> type_cache = model.getSymbolInfoCache(type_id); if (type_cache == null) { set(null, null, null); return true; @@ -433,7 +440,7 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT get_base_type = true; break; case array: - s = "[]"; + s = "[" + type_symbol.getLength() + "]"; get_base_type = true; break; case composite: @@ -834,16 +841,19 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT if (data == null) return true; ISymbols.Symbol type_data = null; if (type_id != null) { - TCFDataCache<ISymbols.Symbol> type_cahce = model.getSymbolInfoCache(type_id); - if (!type_cahce.validate(done)) return false; - type_data = type_cahce.getData(); + TCFDataCache<ISymbols.Symbol> type_cache = model.getSymbolInfoCache(type_id); + if (!type_cache.validate(done)) return false; + type_data = type_cache.getData(); } if (type_data == null) { if (level == 0) { + bf.append("Type: not available\n"); + bf.append("Size: "); + bf.append(data.length); + bf.append(data.length == 1 ? " byte\n" : " bytes\n"); bf.append("Hex: "); bf.append(toNumberString(16, type_data, data, 0, data.length, big_endian)); bf.append("\n"); - bf.append("Value type is not available\n"); } else { bf.append(toNumberString(16, type_data, data, 0, data.length, big_endian)); @@ -870,58 +880,67 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT bf.append("\n"); } } - switch (type_data.getTypeClass()) { - case enumeration: - case integer: - case cardinal: - case real: - if (level == 0) { - bf.append("Size: "); - bf.append(type_data.getSize()); - bf.append(type_data.getSize() == 1 ? " byte\n" : " bytes\n"); - if (type_data.getSize() == 0) break; - bf.append("Dec: "); - bf.append(toNumberString(10, type_data, data, offs, size, big_endian)); - bf.append("\n"); - bf.append("Oct: "); - bf.append(toNumberString(8, type_data, data, offs, size, big_endian)); - bf.append("\n"); - bf.append("Hex: "); - bf.append(toNumberString(16, type_data, data, offs, size, big_endian)); - bf.append("\n"); - } - else if (type_data.getTypeClass() == ISymbols.TypeClass.cardinal) { - bf.append("0x"); - bf.append(toNumberString(16, type_data, data, offs, size, big_endian)); - } - else { - bf.append(toNumberString(10, type_data, data, offs, size, big_endian)); + if (type_data.getSize() > 0) { + switch (type_data.getTypeClass()) { + case enumeration: + case integer: + case cardinal: + case real: + if (level == 0) { + bf.append("Dec: "); + bf.append(toNumberString(10, type_data, data, offs, size, big_endian)); + bf.append("\n"); + bf.append("Oct: "); + bf.append(toNumberString(8, type_data, data, offs, size, big_endian)); + bf.append("\n"); + bf.append("Hex: "); + bf.append(toNumberString(16, type_data, data, offs, size, big_endian)); + bf.append("\n"); + } + else if (type_data.getTypeClass() == ISymbols.TypeClass.cardinal) { + bf.append("0x"); + bf.append(toNumberString(16, type_data, data, offs, size, big_endian)); + } + else { + bf.append(toNumberString(10, type_data, data, offs, size, big_endian)); + } + break; + case pointer: + case function: + if (level == 0) { + bf.append("Oct: "); + bf.append(toNumberString(8, type_data, data, offs, size, big_endian)); + bf.append("\n"); + bf.append("Hex: "); + bf.append(toNumberString(16, type_data, data, offs, size, big_endian)); + bf.append("\n"); + } + else { + bf.append("0x"); + bf.append(toNumberString(16, type_data, data, offs, size, big_endian)); + } + break; + case array: + if (!appendArrayValueText(bf, level, type_data, data, offs, size, big_endian, done)) return false; + if (level == 0) bf.append("\n"); + break; + case composite: + if (!appendCompositeValueText(bf, level, type_data, data, offs, size, big_endian, done)) return false; + if (level == 0) bf.append("\n"); + break; } - break; - case pointer: - case function: - if (level == 0) { - bf.append("Oct: "); - bf.append(toNumberString(8, type_data, data, offs, size, big_endian)); - bf.append("\n"); - bf.append("Hex: "); - bf.append(toNumberString(16, type_data, data, offs, size, big_endian)); + } + if (level == 0) { + if (!type_name.validate(done)) return false; + String nm = type_name.getData(); + if (nm != null) { + bf.append("Type: "); + bf.append(nm); bf.append("\n"); } - else { - bf.append("0x"); - bf.append(toNumberString(16, type_data, data, offs, size, big_endian)); - } - break; - case array: - if (!appendArrayValueText(bf, level, type_data, data, offs, size, big_endian, done)) return false; - break; - case composite: - if (!appendCompositeValueText(bf, level, type_data, data, offs, size, big_endian, done)) return false; - break; - default: - bf.append('?'); - break; + bf.append("Size: "); + bf.append(type_data.getSize()); + bf.append(type_data.getSize() == 1 ? " byte\n" : " bytes\n"); } return true; } diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestExpressions.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestExpressions.java index 2dfbe5176..58d7075bd 100644 --- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestExpressions.java +++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestExpressions.java @@ -126,7 +126,7 @@ class TestExpressions implements ITCFTest, public void run() { if (!test_suite.isActive(TestExpressions.this)) return; cnt++; - if (cnt < 10) { + if (cnt < 60) { Protocol.invokeLater(1000, this); } else if (test_suite.cancel) { diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java index 2d7d2fe8e..12f4e3ec4 100644 --- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java +++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java @@ -227,7 +227,7 @@ class TestRCBP1 implements ITCFTest, @SuppressWarnings("unchecked") private void iniBreakpoints() { assert !bp_set_done; - Map<String,Object> m[] = new Map[4]; + Map<String,Object> m[] = new Map[6]; for (int i = 0; i < m.length; i++) { m[i] = new HashMap(); m[i].put(IBreakpoints.PROP_ID, "TcfTestBP" + i + "" + channel_id); @@ -235,21 +235,33 @@ class TestRCBP1 implements ITCFTest, switch (i) { case 0: m[i].put(IBreakpoints.PROP_LOCATION, func0.getValue().toString()); + // Condition is always true m[i].put(IBreakpoints.PROP_CONDITION, "$thread!=\"\""); break; case 1: + m[i].put(IBreakpoints.PROP_LOCATION, func0.getValue().toString()); + // Condition is always false + m[i].put(IBreakpoints.PROP_CONDITION, "$thread==\"\""); + break; + case 2: + // Second breakpoint at same address + m[i].put(IBreakpoints.PROP_LOCATION, "tcf_test_func0"); + break; + case 3: + // Location is an expression m[i].put(IBreakpoints.PROP_LOCATION, "(31+1)/16+tcf_test_func1-2"); + // Condition is always true m[i].put(IBreakpoints.PROP_CONDITION, "tcf_test_func0!=tcf_test_func1"); break; - case 2: + case 4: // Disabled breakpoint m[i].put(IBreakpoints.PROP_LOCATION, "tcf_test_func2"); m[i].put(IBreakpoints.PROP_ENABLED, Boolean.FALSE); break; - case 3: + case 5: // Breakpoint that will be enabled with "enable" command - m[i].put(IBreakpoints.PROP_ENABLED, Boolean.FALSE); m[i].put(IBreakpoints.PROP_LOCATION, "tcf_test_func2"); + m[i].put(IBreakpoints.PROP_ENABLED, Boolean.FALSE); break; } bp_list.put((String)m[i].get(IBreakpoints.PROP_ID), m[i]); @@ -370,7 +382,7 @@ class TestRCBP1 implements ITCFTest, assert !bp_change_done; if (threads.size() == 0) return; done_starting_test_process = true; - final String bp_id = "TcfTestBP3" + channel_id; + final String bp_id = "TcfTestBP5" + channel_id; final Map<String,Object> m = new HashMap<String,Object>(); m.put(IBreakpoints.PROP_ID, bp_id); m.put(IBreakpoints.PROP_ENABLED, Boolean.FALSE); |