Author: toshok
Date: 2005-05-08 14:56:38 -0400 (Sun, 08 May 2005)
New Revision: 44222
Modified:
trunk/debugger/ChangeLog
trunk/debugger/frontend/Command.cs
trunk/debugger/frontend/Interpreter.cs
trunk/debugger/frontend/Main.cs
Log:
2005-05-08 Chris Toshok <[EMAIL PROTECTED]>
* frontend/Command.cs (EventHandleCommand.DoResolve): allow zero
arguments.
(BreakpointEnableCommand.DoExecute): if we have no handle, enable
all breakpoints/catchpoints.
(BreakpointDisableCommand.DoExecute): if we have no handle,
disable all breakpoints/catchpoints.
(BreakpointDeleteCommand.DoExecute): if we have no handle, delete
all breakpoints/catchpoints (after prompting the user).
(BreakCommand.DoExecute): change message printed from "Inserted
breakpoint..." to "Breakpoint..."
* frontend/Interpreter.cs (Interpreter.ShowBreakpoints): display
"No breakpoints or catchpoints." if there are non registered.
(Interpreter.get_Events): provide a way to get at a list (in this
case an array) of all breakpoints/catchpoints. used by the bulk
disable/enable/delete commands.
* frontend/Main.cs (CommandLineInterpreter.SetupEngine): add "fin"
as an alias for "finish".
(CommandLineInterpreter.ParseOption): fix handling of "-script",
which shouldn't have an argument.
Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog 2005-05-08 18:44:24 UTC (rev 44221)
+++ trunk/debugger/ChangeLog 2005-05-08 18:56:38 UTC (rev 44222)
@@ -1,3 +1,40 @@
+2005-05-08 Chris Toshok <[EMAIL PROTECTED]>
+
+ * frontend/Command.cs (EventHandleCommand.DoResolve): allow zero
+ arguments.
+ (BreakpointEnableCommand.DoExecute): if we have no handle, enable
+ all breakpoints/catchpoints.
+ (BreakpointDisableCommand.DoExecute): if we have no handle,
+ disable all breakpoints/catchpoints.
+ (BreakpointDeleteCommand.DoExecute): if we have no handle, delete
+ all breakpoints/catchpoints (after prompting the user).
+ (BreakCommand.DoExecute): change message printed from "Inserted
+ breakpoint..." to "Breakpoint..."
+
+ * frontend/Interpreter.cs (Interpreter.ShowBreakpoints): display
+ "No breakpoints or catchpoints." if there are non registered.
+ (Interpreter.get_Events): provide a way to get at a list (in this
+ case an array) of all breakpoints/catchpoints. used by the bulk
+ disable/enable/delete commands.
+
+ * frontend/Main.cs (CommandLineInterpreter.SetupEngine): add "fin"
+ as an alias for "finish".
+ (CommandLineInterpreter.ParseOption): fix handling of "-script",
+ which shouldn't have an argument.
+
+2005-05-08 Chris Toshok <[EMAIL PROTECTED]>
+
+ * backends/mono/MonoClassObject.cs (MonoClassObject.PrintObjcet):
+ fix unitialized use of "func".
+
+ * frontend/Expression.cs
+ (MemberAccessExpression.ResolveMemberAccess): try to resolve left
+ as a regular expression first, falling back to treating it as a
+ type if that fails (reverse the way the code worked previously).
+ This allows things like "print foo.a" when you've defined foo as
+ "struct foo foo" in C. This also points out that type names (in C
+ at least), should include the "struct ".
+
2005-05-02 Chris Toshok <[EMAIL PROTECTED]>
* wrapper/Makefile.am: more mcs quieting.
Modified: trunk/debugger/frontend/Command.cs
===================================================================
--- trunk/debugger/frontend/Command.cs 2005-05-08 18:44:24 UTC (rev 44221)
+++ trunk/debugger/frontend/Command.cs 2005-05-08 18:56:38 UTC (rev 44222)
@@ -1626,6 +1626,9 @@
protected override bool DoResolve (ScriptingContext context)
{
+ if (Args == null || Args.Count == 0)
+ return true;
+
int id;
try {
id = (int) UInt32.Parse (Argument);
@@ -1643,7 +1646,14 @@
{
protected override void DoExecute (ScriptingContext context)
{
- handle.Enable (context.CurrentProcess.Process);
+ if (handle != null) {
+ handle.Enable (context.CurrentProcess.Process);
+ }
+ else {
+ // enable all breakpoints
+ foreach (IEventHandle h in
context.Interpreter.Events)
+ h.Enable
(context.CurrentProcess.Process);
+ }
}
// IDocumentableCommand
@@ -1656,7 +1666,14 @@
{
protected override void DoExecute (ScriptingContext context)
{
- handle.Disable (context.CurrentProcess.Process);
+ if (handle != null) {
+ handle.Disable (context.CurrentProcess.Process);
+ }
+ else {
+ // enable all breakpoints
+ foreach (IEventHandle h in
context.Interpreter.Events)
+ h.Disable
(context.CurrentProcess.Process);
+ }
}
// IDocumentableCommand
@@ -1669,7 +1686,22 @@
{
protected override void DoExecute (ScriptingContext context)
{
- context.Interpreter.DeleteEvent
(context.CurrentProcess, handle);
+ if (handle != null) {
+ context.Interpreter.DeleteEvent
(context.CurrentProcess, handle);
+ }
+ else {
+ IEventHandle[] hs = context.Interpreter.Events;
+
+ if (hs.Length == 0)
+ return;
+
+ if (!context.Interpreter.Query ("Delete all
breakpoints?"))
+ return;
+
+ // delete all breakpoints
+ foreach (IEventHandle h in
context.Interpreter.Events)
+ context.Interpreter.DeleteEvent
(context.CurrentProcess, h);
+ }
}
// IDocumentableCommand
@@ -1938,7 +1970,7 @@
int index =
context.Interpreter.InsertBreakpoint (
process,
tgroup, location);
- context.Print ("Inserted
breakpoint {0} at {1}",
+ context.Print ("Breakpoint {0}
at {1}",
index,
location.Name);
}
return;
@@ -1946,7 +1978,7 @@
else {
int index =
context.Interpreter.InsertBreakpoint (
process,
tgroup, location);
- context.Print ("Inserted breakpoint {0}
at {1}",
+ context.Print ("Breakpoint {0} at {1}",
index, location.Name);
}
#if PENDING_BREAKPOINTS
Modified: trunk/debugger/frontend/Interpreter.cs
===================================================================
--- trunk/debugger/frontend/Interpreter.cs 2005-05-08 18:44:24 UTC (rev
44221)
+++ trunk/debugger/frontend/Interpreter.cs 2005-05-08 18:56:38 UTC (rev
44222)
@@ -462,6 +462,11 @@
public void ShowBreakpoints ()
{
+ if (events.Values.Count == 0) {
+ Print ("No breakpoints or catchpoints.");
+ return;
+ }
+
Print ("Breakpoints:");
Print ("{0,3} {1,6} {2,3} {3,12} {4}", "Id", "Type",
"En", "ThreadGroup", "What");
foreach (IEventHandle handle in events.Values) {
@@ -480,6 +485,14 @@
}
}
+ public IEventHandle[] Events {
+ get {
+ IEventHandle[] ret = new IEventHandle
[events.Values.Count];
+ events.Values.CopyTo (ret, 0);
+ return ret;
+ }
+ }
+
public IEventHandle GetEvent (int index)
{
IEventHandle handle = (IEventHandle) events [index];
Modified: trunk/debugger/frontend/Main.cs
===================================================================
--- trunk/debugger/frontend/Main.cs 2005-05-08 18:44:24 UTC (rev 44221)
+++ trunk/debugger/frontend/Main.cs 2005-05-08 18:56:38 UTC (rev 44222)
@@ -66,6 +66,7 @@
e.RegisterCommand ("nexti", typeof
(NextInstructionCommand));
e.RegisterAlias ("t", typeof
(NextInstructionCommand));
e.RegisterCommand ("finish", typeof (FinishCommand));
+ e.RegisterAlias ("fin", typeof (FinishCommand));
e.RegisterCommand ("backtrace", typeof
(BacktraceCommand));
e.RegisterAlias ("bt", typeof (BacktraceCommand));
e.RegisterAlias ("where", typeof (BacktraceCommand));
@@ -243,8 +244,7 @@
return true;
case "-script":
- value = GetValue (ref args, ref i, ms_value);
- if (value != null) {
+ if (ms_value != null) {
Usage ();
Environment.Exit (1);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches