瀏覽代碼

* fixed the stack traces under i8086-msdos (StackTop wasn't initialized)

git-svn-id: trunk@25863 -
nickysn 11 年之前
父節點
當前提交
8066d12c87
共有 2 個文件被更改,包括 5 次插入1 次删除
  1. 2 0
      rtl/msdos/prt0stm.asm
  2. 3 1
      rtl/msdos/system.pp

+ 2 - 0
rtl/msdos/prt0stm.asm

@@ -25,6 +25,7 @@
         extern _end    ; defined by WLINK, indicates end of BSS
 
         extern __stklen
+        extern __stktop
         extern __stkbottom
 
         extern __nearheap_start
@@ -141,6 +142,7 @@ skip_mem_realloc:
         sub bx, 2
         mov sp, bx
 
+        mov word [__stktop], sp
         add bx, 2
         sub bx, word [__stklen]
         and bl, 0FEh

+ 3 - 1
rtl/msdos/system.pp

@@ -95,6 +95,7 @@ type
   PFarWord = ^Word;far;
 
 var
+  __stktop : pointer;public name '__stktop';
   __stkbottom : pointer;public name '__stkbottom';
   __nearheap_start: pointer;public name '__nearheap_start';
   __nearheap_end: pointer;public name '__nearheap_end';
@@ -329,8 +330,9 @@ begin
 end;
 
 begin
-  StackLength := CheckInitialStkLen(InitialStkLen);
+  StackTop := __stktop;
   StackBottom := __stkbottom;
+  StackLength := __stktop - __stkbottom;
   if DetectFPU then
     SysInitFPU;
   { To be set if this is a GUI or console application }