diff options
author | Alain Magloire | 2002-08-14 17:20:12 +0000 |
---|---|---|
committer | Alain Magloire | 2002-08-14 17:20:12 +0000 |
commit | 43af81fb53b59b5dea8523ae0c376eb8f41dd95e (patch) | |
tree | 450c553f02a2bdbc41b2393f9ea0c53a4f01ead3 | |
parent | ad50df009deea6de9aa1906e20f89f2105d7c386 (diff) | |
download | org.eclipse.cdt-43af81fb53b59b5dea8523ae0c376eb8f41dd95e.tar.gz org.eclipse.cdt-43af81fb53b59b5dea8523ae0c376eb8f41dd95e.tar.xz org.eclipse.cdt-43af81fb53b59b5dea8523ae0c376eb8f41dd95e.zip |
Check for funtion.
-rw-r--r-- | debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java index 7c2cbf3aebc..216c1645241 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java @@ -154,7 +154,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa boolean temporary = (type == ICDIBreakpoint.TEMPORARY); String exprCond = null; int ignoreCount = 0; - String line = ""; + StringBuffer line = new StringBuffer(); if (condition != null) { exprCond = condition.getExpression(); @@ -162,24 +162,26 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa } if (location != null) { - if (location.getFile() != null && location.getFile().length() > 0) { - line = location.getFile() + ":"; - if (location.getFunction() != null && location.getFunction().length() > 0) { - line += location.getFunction(); + String file = location.getFile(); + String function = location.getFunction(); + if (file != null && file.length() > 0) { + line.append(file).append(':'); + if (function != null && function.length() > 0) { + line.append(function); } else { - line += Integer.toString(location.getLineNumber()); + line.append(location.getLineNumber()); } - } else if (location.getFunction() != null && location.getFunction().length() > 0) { - line = location.getFunction(); + } else if (function != null && function.length() > 0) { + line.append(function); } else { - line = "*" + Long.toString(location.getAddress()); + line.append('*').append(location.getAddress()); } } CSession s = getCSession(); CommandFactory factory = s.getMISession().getCommandFactory(); MIBreakInsert breakInsert = factory.createMIBreakInsert(temporary, hardware, - exprCond, ignoreCount, line); + exprCond, ignoreCount, line.toString()); MIBreakPoint[] points = null; try { s.getMISession().postCommand(breakInsert); |