1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 01:35:39 +02:00

2004-11-26 Alain Magloire

Final fix for PR 79452
	* cdi/org/eclipose/cdt/debug/mi/core/cdi/BreapointManager.java
This commit is contained in:
Alain Magloire 2004-11-26 21:11:53 +00:00
parent d7970bc456
commit 70b40f859c
2 changed files with 23 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2004-11-26 Alain Magloire
Final fix for PR 79452
* cdi/org/eclipose/cdt/debug/mi/core/cdi/BreapointManager.java
2004-11-26 Alain Magloire
Fix for PR 79582
* src/org/eclipse/cdt/debug/mi/core/CygwinGDBCDIDebugger.java

View file

@ -576,7 +576,25 @@ public class BreakpointManager extends Manager {
if (file != null && file.length() > 0) {
line.append(file).append(':');
if (function != null && function.length() > 0) {
line.append(function);
// GDB does not seem to accept function arguments when
// we use file name:
// (gdb) break file.c:Test(int)
// Will fail, altought it can accept this
// (gdb) break file.c:main
// so fall back to the line number or
// just the name of the function if lineno is invalid.
int paren = function.indexOf('(');
if (paren != -1) {
int no = location.getLineNumber();
if (no <= 0) {
String func = function.substring(0, paren);
line.append(func);
} else {
line.append(no);
}
} else {
line.append(function);
}
} else {
line.append(location.getLineNumber());
}