Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] Zylin Embedded CDT 4.0 for Eclipse 3.3M5eh status

I've ported over my patches to CDT 4.0 and I'm using CDT 4.0 + Eclipse
3.3 latest integration build + the Zylin Embedded CDT plugin:

- I'd like to see https://bugs.eclipse.org/bugs/show_bug.cgi?id=135250
fixed in CDT 4.0 CVS HEAD. 1 year anniversary for this bug is coming
up soon! :-)
- Suspend is broken, probably handled by a fix to this bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=176353
- Eclipse 3.3 seems relatively early days yet and CDT 4.0 CVS HEAD
does not work against the latest integration build while 3.3M5eh has
an annoying problem that saved editors are still marked as dirty. CDT
4.0 & Eclipse 3.3 are due 1. July'ish?

Other than that things are actually looking pretty good.



--
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA  developer kit
### Eclipse Workspace Patch 1.0
#P org.eclipse.cdt.debug.core
Index: src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java,v
retrieving revision 1.65
diff -u -r1.65 CBreakpointManager.java
--- src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java	15 Feb 2007 20:47:11 -0000	1.65
+++ src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java	6 Mar 2007 07:14:14 -0000
@@ -745,8 +745,11 @@
 		try {
 			ICDILocator location = cdiBreakpoint.getLocator();
 			String file = location.getFile();
-			if ( !isEmpty( file ) ) {
-				Object sourceElement = getSourceElement( file );
+			// priority to function & address breakpoints as that might be
+			// what the user typed in the GDB console and we shouldn't try to
+			// second guess him then.
+			 if (cdiBreakpoint instanceof ICDILineBreakpoint) {
+				Object sourceElement = getSourceElement(file);
 				String sourceHandle = file;
 				IResource resource = getProject();
 				if ( sourceElement instanceof IFile ) {
@@ -758,17 +761,11 @@
 					resource = ResourcesPlugin.getWorkspace().getRoot();
 				}
 				breakpoint = createLineBreakpoint( sourceHandle, resource, cdiBreakpoint );
-//				else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) {
-//					breakpoint = createFunctionBreakpoint( cdiBreakpoint );
-//				}
-//				else if ( ! cdiBreakpoint.getLocation().getAddress().equals( BigInteger.ZERO ) ) {
-//					breakpoint = createAddressBreakpoint( cdiBreakpoint );
-//				}
 			}
-			else if ( !isEmpty( location.getFunction() ) ) {
+			else if ( cdiBreakpoint instanceof ICDIFunctionBreakpoint ) {
 				breakpoint = createFunctionBreakpoint( cdiBreakpoint );
 			}
-			else if ( !location.getAddress().equals( BigInteger.ZERO ) ) {
+			else if ( cdiBreakpoint instanceof ICDIAddressBreakpoint ) {
 				breakpoint = createAddressBreakpoint( cdiBreakpoint );
 			}
 		}
@@ -957,18 +954,12 @@
 		if ( breakpoint instanceof ICAddressBreakpoint )
 			return supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint );
 		if ( breakpoint instanceof ICLineBreakpoint ) {
-			try {
-				String handle = breakpoint.getSourceHandle();
-				ISourceLocator sl = getSourceLocator();
-				if ( sl instanceof ICSourceLocator )
-					return ( ((ICSourceLocator)sl).findSourceElement( handle ) != null );
-				else if ( sl instanceof CSourceLookupDirector ) {
-					return ( ((CSourceLookupDirector)sl).contains( breakpoint ) );
-				}
-			}
-			catch( CoreException e ) {
-				return false;
-			}
+			/* if this isn't a valid line breakpoint, then GDB will produce an
+			 * error message, which is sufficient handling of the problem.
+			 * 
+			 * Also second guessing GDB is fraught with problems.
+			 */
+			return true;
 		}
 		else {
 			IProject project = resource.getProject();
Index: .project
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.core/.project,v
retrieving revision 1.9
diff -u -r1.9 .project
--- .project	2 Dec 2005 20:43:14 -0000	1.9
+++ .project	6 Mar 2007 07:14:13 -0000
@@ -3,6 +3,7 @@
 	<name>org.eclipse.cdt.debug.core</name>
 	<comment></comment>
 	<projects>
+		<project>org.eclipse.cdt.debug.mi.core</project>
 	</projects>
 	<buildSpec>
 		<buildCommand>
#P org.eclipse.cdt.debug.mi.core
Index: cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java,v
retrieving revision 1.41
diff -u -r1.41 BreakpointManager.java
--- cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java	16 Feb 2007 04:30:03 -0000	1.41
+++ cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java	6 Mar 2007 07:14:17 -0000
@@ -435,14 +435,10 @@
 					String addr = allMIBreakpoints[i].getAddress();
 					boolean enabled = allMIBreakpoints[i].isEnabled();
 
-					if (file != null && file.length() > 0 && line > 0) {
-						LineLocation location = createLineLocation (allMIBreakpoints[i].getFile(),
-								allMIBreakpoints[i].getLine());
-						// By default new breakpoint are LineBreakpoint
-						Breakpoint newBreakpoint = new LineBreakpoint(target, type, location, condition, enabled);
-						newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
-						bList.add(newBreakpoint);
-					} else if (function != null && function.length() > 0) {
+					/* Give priority to function & address breakpoints as they may have been
+					 * entered manually by the user in the GDB console.
+					 */
+					if (function != null && function.length() > 0) {
 						FunctionLocation location = createFunctionLocation(file, function);
 						// By default new breakpoint are LineBreakpoint
 						Breakpoint newBreakpoint = new FunctionBreakpoint(target, type, location, condition, enabled);
@@ -455,7 +451,14 @@
 						Breakpoint newBreakpoint = new AddressBreakpoint(target, type, location, condition, enabled);
 						newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
 						bList.add(newBreakpoint);
-					}
+					} else if (file != null && file.length() > 0 && line > 0) {
+						LineLocation location = createLineLocation (allMIBreakpoints[i].getFile(),
+								allMIBreakpoints[i].getLine());
+						// By default new breakpoint are LineBreakpoint
+						Breakpoint newBreakpoint = new LineBreakpoint(target, type, location, condition, enabled);
+						newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
+						bList.add(newBreakpoint);
+					} 
 				}
 				eventList.add(new MIBreakpointCreatedEvent(miSession, no)); 
 			}
@@ -946,9 +949,12 @@
 					if (colon != -1) {
 						line.append(function);
 					} else {
-						if (file != null && file.length() > 0) {
-							line.append(file).append(':');
-						}
+						// FIX!!! sometimes the file can be the name of the binary(foo.elf)
+						// in which case this does not work.
+						//						if (file != null && file.length() > 0) {
+						//							line.append(file).append(':');
+						//						}
+						
 						// GDB does not seem to accept function arguments when
 						// we use file name:
 						// (gdb) break file.c:Test(int)

Back to the top