فهرست منبع

improved disassembly (course syscon)

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7383 8c9fc860-2736-0410-a75d-ab315db34111
felixf 7 سال پیش
والد
کامیت
a3e5eaf3d8
3فایلهای تغییر یافته به همراه10 افزوده شده و 4 حذف شده
  1. 8 2
      source/FoxDisassembler.Mod
  2. 1 1
      source/StdIOShell.Mod
  3. 1 1
      source/Win32.Traps.Mod

+ 8 - 2
source/FoxDisassembler.Mod

@@ -3,7 +3,7 @@ MODULE FoxDisassembler; (** AUTHOR ""; PURPOSE ""; *)
 IMPORT Streams, ObjectFile, Scanner := FoxScanner, Basic := FoxBasic, BitSets, D := Debugging, Files, Commands;
 
 
-CONST Trace = TRUE;
+CONST Trace = FALSE;
 TYPE
 	Block*= POINTER TO RECORD (ObjectFile.Section)
 		to-: LONGINT;
@@ -54,12 +54,18 @@ TYPE
 			WHILE (b # NIL) & ((adr < b.alignment-offset) OR (adr > b.to - offset) OR (ObjectFile.IsCode(b.type)#isCode)) DO
 				b := b.next;
 			END;
+			IF b = NIL THEN 
+				(* try to find any matching section *)
+				WHILE (b # NIL) & ((adr < b.alignment-offset) OR (adr > b.to - offset))  DO
+					b := b.next;
+				END;
+			END;
 			IF (b # NIL) & (b # block) THEN
 				Basic.SegmentedNameToString(b.identifier.name, name);
 				w.String(" [");
 				w.String(name);
 				IF adr # b.alignment THEN
-					w.String("+"); w.Int(adr-b.alignment,1)
+					w.String("+"); w.Int(adr-b.alignment+offset,1)
 				END;
 				w.String("]");
 			END;

+ 1 - 1
source/StdIOShell.Mod

@@ -70,7 +70,7 @@ Command line shell: (Windows):
 StaticLinker.Link  --fileFormat=PE32CUI --fileName=oberon.exe --extension=GofW --displacement=401000H Runtime Trace Kernel32 Machine Heaps Modules Objects Kernel KernelLog Streams Commands Files  WinFS Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader WinTrace StdIO  Traps RelativeFileSystem WMDefaultFont SystemTools Shell StdIOShell ~
 
 Command line shell including compiler (and linker)
-StaticLinker.Link  --fileFormat=PE32CUI --fileName=oberon.exe --extension=GofW --displacement=401000H Runtime Trace Kernel32 Machine Heaps Modules Objects Kernel KernelLog Streams Commands Files  WinFS Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader WinTrace StdIO  Traps RelativeFileSystem WMDefaultFont SystemTools StdIOShell 
+StaticLinker.Link  --fileFormat=PE32CUI --fileName=oberon.exe --extension=GofW --displacement=401000H Runtime Trace Kernel32 Machine Heaps Modules Objects Kernel KernelLog Streams Commands Files  WinFS Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader WinTrace StdIO  Traps RelativeFileSystem SystemTools FSTools StdIOShell 
 Shell StaticLinker Compiler FoxOberonFrontend FoxARMBackend FoxAMDBackend
 ~
 

+ 1 - 1
source/Win32.Traps.Mod

@@ -405,7 +405,7 @@ VAR
 		END;
 
 		IF TestTrap & (s[0] = "2") THEN HALT( 99 ) END;
-		Objects.InstallExceptionHandler( Exception );  KernelLog.String( "Traps: TrapHandler installed" );  KernelLog.Ln;
+		Objects.InstallExceptionHandler( Exception );  
 	END Init;
 
 	PROCEDURE Install*; (* for loading this module *)