Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] Re: PalmOS Patches

On Wed, 2003-07-09 at 01:05, Daniel Thompson wrote:
> I am currently using the attached (tiny) patch to provide rudimentary
                           ^^^^^^^^

Bum!

Attached this time.

Dan
-x-
-- 
Daniel Thompson (Merlin) <daniel@xxxxxxxxxxxxxxxxxxxxx>
Digitally signed? http://www.redfelineninja.dsl.pipex.com/signature.html

If at first you don't succeed then sky diving is probably not for you.
Index: plugin.properties
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/plugin.properties,v
retrieving revision 1.6
diff -u -r1.6 plugin.properties
--- plugin.properties	6 Apr 2003 01:07:23 -0000	1.6
+++ plugin.properties	8 Jul 2003 23:58:38 -0000
@@ -4,3 +4,5 @@
 GDBDebugger.name=GDB Debugger
 CygwinGDBDebugger.name=Cygwin GDB Debugger
 GDBServer.name=GDB Server
+PalmOSGDBDebugger.name=PalmOS GDB Debugger
+EmbeddedGDBDebugger.name=Embedded GDB Debugger
\ No newline at end of file
Index: plugin.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/plugin.xml,v
retrieving revision 1.16
diff -u -r1.16 plugin.xml
--- plugin.xml	23 Apr 2003 15:02:59 -0000	1.16
+++ plugin.xml	8 Jul 2003 23:58:38 -0000
@@ -45,6 +45,14 @@
             class="org.eclipse.cdt.debug.mi.core.GDBServerDebugger"
             id="org.eclipse.cdt.debug.mi.core.GDBServerCDebugger">
       </debugger>
+     <debugger
+            platform="native"
+            name="%PalmOSGDBDebugger.name"
+            modes="run"
+            cpu="native"
+            class="org.eclipse.cdt.debug.mi.core.PalmOSGDBDebugger"
+            id="org.eclipse.cdt.debug.mi.core.CygwinCDebugger">
+      </debugger>
    </extension>
 
 </plugin>
Index: src/org/eclipse/cdt/debug/mi/core/PalmOSGDBDebugger.java
===================================================================
RCS file: src/org/eclipse/cdt/debug/mi/core/PalmOSGDBDebugger.java
diff -N src/org/eclipse/cdt/debug/mi/core/PalmOSGDBDebugger.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/cdt/debug/mi/core/PalmOSGDBDebugger.java	8 Jul 2003 23:58:39 -0000
@@ -0,0 +1,51 @@
+/*
+ * (c) Copyright Rational Software Corporation. 2002.
+ * All Rights Reserved.
+ */
+
+package org.eclipse.cdt.debug.mi.core;
+
+import org.eclipse.cdt.debug.core.cdi.CDIException;
+import org.eclipse.cdt.debug.core.cdi.ICDISession;
+import org.eclipse.cdt.debug.mi.core.cdi.Session;
+import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
+import org.eclipse.cdt.debug.mi.core.command.MITargetSelect;
+import org.eclipse.cdt.debug.mi.core.output.MIInfo;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+/**
+ * Cygwin GDB Debugger overrides the GDB Debugger to apply the Cygwin
+ * Command Factory to the MI Session.
+ */
+public class PalmOSGDBDebugger extends GDBDebugger {
+
+	/* PalmOS does not have any special initialization like solib paths etc.. */
+	protected void initializeLibraries(ILaunchConfiguration config, Session session) throws CDIException {
+	}
+
+	public ICDISession createLaunchSession(
+		ILaunchConfiguration config,
+		IFile exe)
+		throws CDIException {
+		Session session = (Session) super.createLaunchSession(config, exe);
+		// For windows we need to start the inferior in a new console window
+		// to separate the Inferior std{in,out,err} from gdb std{in,out,err}
+		MISession mi = session.getMISession();
+		try {
+			CommandFactory factory = mi.getCommandFactory();
+			String[] targetParams = new String[1];
+			targetParams[0] = "palmos";
+			MITargetSelect target = factory.createMITargetSelect(targetParams);
+			mi.postCommand(target);
+			MIInfo info = target.getMIInfo();
+			if (info == null) {
+				throw new MIException("No answer");
+			}
+		} catch (MIException e) {
+			// We ignore this exception, for example
+			// on GNU/Linux the new-console is an error.
+		}
+		return session;
+	}
+}
\ No newline at end of file

Attachment: signature.asc
Description: This is a digitally signed message part


Back to the top