Browse Source

Added trace info in case GC traps here -- need to know the stack frame where the problem originates or at least the caller.

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7289 8c9fc860-2736-0410-a75d-ab315db34111
felixf 8 years ago
parent
commit
a0418ee9f8
1 changed files with 8 additions and 0 deletions
  1. 8 0
      source/Win32.Objects.Mod

+ 8 - 0
source/Win32.Objects.Mod

@@ -167,6 +167,9 @@ TYPE
 			context: Kernel32.Wow64Context;
 			a0,a1, obp, osb, osbp, opc, gbp: ADDRESS;
 			O: ANY; ID: LONGINT;
+			mod {UNTRACED}: Modules.Module;
+			proc {UNTRACED}: Modules.ProcedureDescPointer;
+			modName: ARRAY 128 OF CHAR;
 		BEGIN
 			O := obj; ID := id;
 			IF (handle = 0) OR (mode = Terminated) OR (mode < Ready) (* procedure Wrapper not yet started *)
@@ -198,6 +201,11 @@ TYPE
 				ASSERT(res # 0);
 				sp := context.SP; bp := context.BP; pc := context.PC;
 				
+				mod := Modules.ThisModuleByAdr0(pc);
+				IF mod # NIL THEN
+					COPY(mod.name, modName);
+					proc := Modules.FindProc(pc,mod.procTable);
+				END;
 				
 				obp := bp; osb := stackBottom; opc := pc;
 				osbp := state.BP;