1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 336888: Method breakpoints are not set as actual method breakpoints

This commit is contained in:
Marc Khouzam 2011-02-18 11:18:35 +00:00
parent 87ab55e0f9
commit 8f44836698

View file

@ -574,11 +574,20 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints, I
fileName = "\"" + fileName + "\""; //$NON-NLS-1$//$NON-NLS-2$ fileName = "\"" + fileName + "\""; //$NON-NLS-1$//$NON-NLS-2$
} }
// GDB seems inconsistent about allowing parentheses so we must remove them.
// Bug 336888
int paren = function.indexOf('(');
if (paren != -1) {
function = function.substring(0, paren);
}
if (!fileName.equals(NULL_STRING)) { if (!fileName.equals(NULL_STRING)) {
if (lineNumber != -1) { // If the function is set it means we want a function breakpoint
location = fileName + ":" + lineNumber; //$NON-NLS-1$ // We must check it first because the line number is still set in this case.
if (!function.equals(NULL_STRING)) {
location = fileName + ":" + function; //$NON-NLS-1$
} else { } else {
location = fileName + ":" + function; //$NON-NLS-1$ location = fileName + ":" + lineNumber; //$NON-NLS-1$
} }
} else if (!function.equals(NULL_STRING)) { } else if (!function.equals(NULL_STRING)) {
// function location without source // function location without source