[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-patches
Subject:    [Mono-patches] r45276 - in trunk/debugger: . backends frontend
From:       "Peter Williams" <peterw () mono-cvs ! ximian ! com>
Date:       2005-05-31 23:45:46
Message-ID: 20050531234546.4BDFF94765 () mono-cvs ! ximian ! com
[Download RAW message or body]

Author: peterw
Date: 2005-05-31 19:45:45 -0400 (Tue, 31 May 2005)
New Revision: 45276

Modified:
   trunk/debugger/ChangeLog
   trunk/debugger/backends/Makefile.am
   trunk/debugger/configure.in
   trunk/debugger/frontend/CSharpTokenizer.cs
   trunk/debugger/frontend/Interpreter.cs
   trunk/debugger/frontend/Main.cs
Log:
2005-05-31  Peter Williams  <peter@newton.cx>

	* frontend/CSharpTokenizer.cs (ReadDigit): Return Token.ERROR on
	parse errors to actually get the parse error reported. Add new
	code to parse hex numbers as unsigned ints always; it's illegal to
	try and parse a double with hex digits as we were trying before.

	* configure.in (AC_OUTPUT): Reflect the rename of backends/mono
	from backends/mono-csharp.

	* backends/Makefile.am (SUBDIRS): Same here.

	* frontend/Interpreter.cs (Initialize): Compile fix for removal
	of TargetOutputEvent from ThreadManager

	* frontend/Main.cs (SetupEngine): Add 'k' as an alias for
	'kill' a la gdb.



Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog	2005-05-31 23:26:49 UTC (rev 45275)
+++ trunk/debugger/ChangeLog	2005-05-31 23:45:45 UTC (rev 45276)
@@ -1,3 +1,21 @@
+2005-05-31  Peter Williams  <peter@newton.cx>
+
+	* frontend/CSharpTokenizer.cs (ReadDigit): Return Token.ERROR on
+	parse errors to actually get the parse error reported. Add new
+	code to parse hex numbers as unsigned ints always; it's illegal to
+	try and parse a double with hex digits as we were trying before.
+
+	* configure.in (AC_OUTPUT): Reflect the rename of backends/mono
+	from backends/mono-csharp.
+
+	* backends/Makefile.am (SUBDIRS): Same here.
+
+	* frontend/Interpreter.cs (Initialize): Compile fix for removal
+	of TargetOutputEvent from ThreadManager
+
+	* frontend/Main.cs (SetupEngine): Add 'k' as an alias for
+	'kill' a la gdb.
+
 2005-05-31  Raja R Harinath  <rharinath@novell.com>
 
 	* test/mdb.exp (mdb_start): Find the 'start-mdb.sh' script in

Modified: trunk/debugger/backends/Makefile.am
===================================================================
--- trunk/debugger/backends/Makefile.am	2005-05-31 23:26:49 UTC (rev 45275)
+++ trunk/debugger/backends/Makefile.am	2005-05-31 23:45:45 UTC (rev 45276)
@@ -1,4 +1,4 @@
-SUBDIRS = classes server ptrace mono-csharp native
+SUBDIRS = classes server ptrace mono native
 
 EXTRA_DIST = BreakpointManager.cs Debugger.cs ILanguageBackend.cs \
 	Inferior.cs MonoThreadManager.cs Process.cs SingleSteppingEngine.cs StepFrame.cs \

Modified: trunk/debugger/configure.in
===================================================================
--- trunk/debugger/configure.in	2005-05-31 23:26:49 UTC (rev 45275)
+++ trunk/debugger/configure.in	2005-05-31 23:45:45 UTC (rev 45276)
@@ -214,7 +214,7 @@
 backends/classes/Makefile
 backends/server/Makefile
 backends/ptrace/Makefile
-backends/mono-csharp/Makefile
+backends/mono/Makefile
 backends/native/Makefile
 frontend/Makefile
 arch/Makefile

Modified: trunk/debugger/frontend/CSharpTokenizer.cs
===================================================================
--- trunk/debugger/frontend/CSharpTokenizer.cs	2005-05-31 23:26:49 UTC (rev 45275)
+++ trunk/debugger/frontend/CSharpTokenizer.cs	2005-05-31 23:45:45 UTC (rev 45276)
@@ -346,7 +346,7 @@
 					error_details = String.Format("Can't parse float {0}", digit);
 
 					val = 0f;
-					return Token.FLOAT;
+					return Token.ERROR;
 				}
 			}
 			if (isdecimal) {
@@ -358,7 +358,7 @@
 				} catch (Exception) {
 					error_details = String.Format("Can't parse decimal {0}", digit);
 					val = 0m;
-					return Token.DECIMAL;
+					return Token.ERROR;
 				}
 			}
 			if (isdouble) {
@@ -370,16 +370,40 @@
 				} catch (Exception) {
 					error_details = String.Format("Can't parse double {0}", digit);
 					val = 0d;
-					return Token.DOUBLE;
+					return Token.ERROR;
 				}
 			}
-			
+
+			if (ishex) {
+				// can't parse as a double because hex digits in a double
+				// format specifier are not allowed. Anyway, treat all hex
+				// numbers as unsigned because hex inputs will most likely
+				// be copy-and-pasted pointer values.
+
+				ulong l;
+
+				try {
+					l = UInt64.Parse (digit, NumberStyles.HexNumber, null);
+				} catch (Exception ex) {
+					error_details = String.Format("Can't parse hexadecimal constant {0}: {1}", digit, ex);
+					val = 0;
+					return Token.ERROR;
+				}
+
+				if (l > uint.MaxValue) {
+					val = l;
+					return Token.ULONG;
+				}
+
+				val = (uint) l;
+				return Token.UINT;
+			}
+
 			double d = 0;
-			// FIXME: http://bugzilla.ximian.com/show_bug.cgi?id=72221
 			if (!Double.TryParse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Integer, null, out d)) {
 				error_details = String.Format("Can't parse integral constant {0}", digit);
 				val = 0;
-				return Token.INT;
+				return Token.ERROR;
 			}
 			if (d < long.MinValue || d > long.MaxValue) {
 				islong = true;
@@ -399,7 +423,7 @@
 					} catch (Exception) {
 						error_details = String.Format("Can't parse unsigned long {0}", digit);
 						val = 0UL;
-						return Token.ULONG;
+						return Token.ERROR;
 					}
 				} else {
 					try {
@@ -408,7 +432,7 @@
 					} catch (Exception) {
 						error_details = String.Format("Can't parse long {0}", digit);
 						val = 0L;
-						return Token.LONG;
+						return Token.ERROR;
 					}
 				}
 			} else {
@@ -419,7 +443,7 @@
 					} catch (Exception) {
 						error_details = String.Format("Can't parse unsigned int {0}", digit);
 						val = 0U;
-						return Token.UINT;
+						return Token.ERROR;
 					}
 				} else {
 					try {
@@ -428,7 +452,7 @@
 					} catch (Exception) {
 						error_details = String.Format("Can't parse int {0}", digit);
 						val = 0;
-						return Token.INT;
+						return Token.ERROR;
 					}
 				}
 			}

Modified: trunk/debugger/frontend/Interpreter.cs
===================================================================
--- trunk/debugger/frontend/Interpreter.cs	2005-05-31 23:26:49 UTC (rev 45275)
+++ trunk/debugger/frontend/Interpreter.cs	2005-05-31 23:45:45 UTC (rev 45276)
@@ -98,7 +98,6 @@
 
 			backend = new DebuggerBackend ();
 			backend.ThreadManager.ThreadCreatedEvent += new ThreadEventHandler (thread_created);
-			backend.ThreadManager.TargetOutputEvent += new TargetOutputHandler (target_output);
 			backend.ModulesChangedEvent += new ModulesChangedHandler (modules_changed);
 			backend.ThreadManager.TargetExitedEvent += new TargetExitedHandler (target_exited);
 			backend.ThreadManager.InitializedEvent += new ThreadEventHandler (thread_manager_initialized);

Modified: trunk/debugger/frontend/Main.cs
===================================================================
--- trunk/debugger/frontend/Main.cs	2005-05-31 23:26:49 UTC (rev 45275)
+++ trunk/debugger/frontend/Main.cs	2005-05-31 23:45:45 UTC (rev 45276)
@@ -73,6 +73,7 @@
 			e.RegisterCommand ("up", typeof (UpCommand));
 			e.RegisterCommand ("down", typeof (DownCommand));
 			e.RegisterCommand ("kill", typeof (KillCommand));
+			e.RegisterAlias   ("k", typeof (KillCommand));
 			e.RegisterCommand ("set", typeof (SetCommand));
 			e.RegisterCommand ("show", typeof (ShowCommand));
 			e.RegisterCommand ("info", typeof (ShowCommand)); /* for gdb users */

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic