فهرست منبع

Added command for reporting the reflection info of a loaded module

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7988 8c9fc860-2736-0410-a75d-ab315db34111
eth.negelef 7 سال پیش
والد
کامیت
a198911222
1فایلهای تغییر یافته به همراه19 افزوده شده و 0 حذف شده
  1. 19 0
      source/Debugging.Mod

+ 19 - 0
source/Debugging.Mod

@@ -229,6 +229,25 @@ VAR
 		END;
 	END ReportProcedureDescriptors;
 
+	PROCEDURE ReportModule* (context: Commands.Context);
+	VAR m: Modules.Module; name: Modules.Name;
+	BEGIN
+		IF ~context.arg.GetString (name) THEN
+			context.result := Commands.CommandParseError;
+			RETURN;
+		END;
+		m := Modules.root;
+		WHILE (m # NIL) DO
+			IF m.name = name THEN
+				Reflection.Report (context.out, m.refs, 0);
+				context.result := Commands.Ok;
+				RETURN;
+			END;
+			m := m.next;
+		END;
+		context.result := Commands.CommandError;
+	END ReportModule;
+
 BEGIN
 	Streams.OpenWriter( DefaultLog, KernelLog.Send );  Log := DefaultLog; NEW( lock );
 END Debugging.