+ profiling support

This commit is contained in:
carl 2002-11-30 18:17:35 +00:00
parent 2c57646d2a
commit 7769191263
4 changed files with 172 additions and 5 deletions

67
rtl/win32/gprt0.as Normal file
View File

@ -0,0 +1,67 @@
// Startup code for WIN32 port of Free Pascal
// with profiling enabled.
.text
.globl _mainCRTStartup
_mainCRTStartup:
movb $1,U_SYSTEM_ISCONSOLE
call _FPC_EXE_Entry
.globl _WinMainCRTStartup
_WinMainCRTStartup:
movb $0,U_SYSTEM_ISCONSOLE
call _FPC_EXE_Entry
.globl asm_exit
asm_exit:
pushl %eax
call __mcleanup
popl %eax
pushl %eax
call exitprocess
.text
.globl exitprocess
exitprocess:
jmp *.L10
.balign 4,144
.text
.balign 4,144
.section .idata$2
.rva .L7
.long 0,0
.rva .L6
.rva .L8
.section .idata$4
.L7:
.rva .L9
.long 0
.section .idata$5
.L8:
.section .idata$5
.L10:
.rva .L9
.long 0
.section .idata$6
.L9:
.short 0
.ascii "ExitProcess\000"
.balign 2,0
.section .idata$7
.L6:
.ascii "kernel32.dll\000"
//
// $Log$
// Revision 1.1 2002-11-30 18:17:35 carl
// + profiling support
//
//
//

View File

@ -874,6 +874,7 @@ end;
procedure PascalMain;external name 'PASCALMAIN';
procedure fpc_do_exit;external name 'FPC_DO_EXIT';
Procedure ExitDLL(Exitcode : longint); forward;
procedure asm_exit; external name 'asm_exit';
Procedure system_exit;
begin
@ -889,7 +890,12 @@ begin
{ what about Input and Output ?? PM }
end;
remove_exception_handlers;
ExitProcess(ExitCode);
{ call exitprocess, with cleanup as required }
asm
xorl %eax, %eax
movw exitcode,%ax
call asm_exit
end;
end;
var
@ -1499,7 +1505,10 @@ end.
{
$Log$
Revision 1.36 2002-10-31 15:17:58 carl
Revision 1.37 2002-11-30 18:17:35 carl
+ profiling support
Revision 1.36 2002/10/31 15:17:58 carl
* always allocate argument even if its empty (bugfix web bug 2202)
Revision 1.35 2002/10/14 20:40:22 florian

View File

@ -11,9 +11,57 @@ _WinMainCRTStartup:
movb $0,U_SYSTEM_ISCONSOLE
call _FPC_EXE_Entry
//
.globl asm_exit
asm_exit:
pushl %eax
call exitprocess
.text
.globl exitprocess
exitprocess:
jmp *.L10
.balign 4,144
.text
.balign 4,144
.section .idata$2
.rva .L7
.long 0,0
.rva .L6
.rva .L8
.section .idata$4
.L7:
.rva .L9
.long 0
.section .idata$5
.L8:
.section .idata$5
.L10:
.rva .L9
.long 0
.section .idata$6
.L9:
.short 0
.ascii "ExitProcess\000"
.balign 2,0
.section .idata$7
.L6:
.ascii "kernel32.dll\000"
// $Log$
// Revision 1.3 2002-07-28 20:43:51 florian
// Revision 1.4 2002-11-30 18:17:35 carl
// + profiling support
//
// Revision 1.3 2002/07/28 20:43:51 florian
// * several fixes for linux/powerpc
// * several fixes to MT
//

View File

@ -12,3 +12,46 @@ _WinMainCRTStartup:
movb $0,U_SYSWIN32_ISCONSOLE
call _FPC_EXE_Entry
.globl asm_exit
asm_exit:
pushl %eax
call exitprocess
.text
.globl exitprocess
exitprocess:
jmp *.L10
.balign 4,144
.text
.balign 4,144
.section .idata$2
.rva .L7
.long 0,0
.rva .L6
.rva .L8
.section .idata$4
.L7:
.rva .L9
.long 0
.section .idata$5
.L8:
.section .idata$5
.L10:
.rva .L9
.long 0
.section .idata$6
.L9:
.short 0
.ascii "ExitProcess\000"
.balign 2,0
.section .idata$7
.L6:
.ascii "kernel32.dll\000"