mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 12:09:30 +02:00
* win32 profiling updates
git-svn-id: trunk@1059 -
This commit is contained in:
parent
af3b2f28ca
commit
35ac5f133e
@ -1595,25 +1595,6 @@ implementation
|
|||||||
{ call startup helpers from main program }
|
{ call startup helpers from main program }
|
||||||
if (current_procinfo.procdef.proctypeoption=potype_proginit) then
|
if (current_procinfo.procdef.proctypeoption=potype_proginit) then
|
||||||
begin
|
begin
|
||||||
{ initialize profiling for win32 }
|
|
||||||
if (target_info.system in [system_i386_win32,system_i386_wdosx]) and
|
|
||||||
(cs_profile in aktmoduleswitches) then
|
|
||||||
begin
|
|
||||||
reference_reset_symbol(href,objectlibrary.newasmsymbol('etext',AB_EXTERNAL,AT_DATA),0);
|
|
||||||
paramanager.getintparaloc(pocall_default,1,paraloc1);
|
|
||||||
paramanager.getintparaloc(pocall_default,2,paraloc2);
|
|
||||||
paramanager.allocparaloc(list,paraloc2);
|
|
||||||
cg.a_paramaddr_ref(list,href,paraloc2);
|
|
||||||
reference_reset_symbol(href,objectlibrary.newasmsymbol('__image_base__',AB_EXTERNAL,AT_DATA),0);
|
|
||||||
paramanager.allocparaloc(list,paraloc1);
|
|
||||||
cg.a_paramaddr_ref(list,href,paraloc1);
|
|
||||||
paramanager.freeparaloc(list,paraloc2);
|
|
||||||
paramanager.freeparaloc(list,paraloc1);
|
|
||||||
cg.allocallcpuregisters(list);
|
|
||||||
cg.a_call_name(list,'_monstartup');
|
|
||||||
cg.deallocallcpuregisters(list);
|
|
||||||
end;
|
|
||||||
|
|
||||||
if (target_info.system = system_powerpc_darwin) then
|
if (target_info.system = system_powerpc_darwin) then
|
||||||
begin
|
begin
|
||||||
{ the parameters are already in the right registers }
|
{ the parameters are already in the right registers }
|
||||||
|
@ -985,9 +985,8 @@ begin
|
|||||||
LinkRes.Add('GROUP(');
|
LinkRes.Add('GROUP(');
|
||||||
if (cs_profile in aktmoduleswitches) then
|
if (cs_profile in aktmoduleswitches) then
|
||||||
begin
|
begin
|
||||||
|
LinkRes.Add('-lc');
|
||||||
LinkRes.Add('-lgcc');
|
LinkRes.Add('-lgcc');
|
||||||
LinkRes.Add('-lmoldname');
|
|
||||||
LinkRes.Add('-lmsvcrt');
|
|
||||||
LinkRes.Add('-lgmon');
|
LinkRes.Add('-lgmon');
|
||||||
LinkRes.Add('-lkernel32');
|
LinkRes.Add('-lkernel32');
|
||||||
end;
|
end;
|
||||||
|
@ -1,29 +1,46 @@
|
|||||||
// Startup code for WIN32 port of Free Pascal
|
//Startup code for WIN32 port of Free Pascal
|
||||||
// with profiling enabled.
|
//Written by P.Ozerski 1998
|
||||||
|
// modified by Pierre Muller
|
||||||
.text
|
.text
|
||||||
.globl _mainCRTStartup
|
.globl _mainCRTStartup
|
||||||
_mainCRTStartup:
|
_mainCRTStartup:
|
||||||
movb $1,U_SYSTEM_ISCONSOLE
|
movb $1,U_SYSTEM_ISCONSOLE
|
||||||
call _FPC_EXE_Entry
|
jmp _start
|
||||||
|
|
||||||
.globl _WinMainCRTStartup
|
.globl _WinMainCRTStartup
|
||||||
_WinMainCRTStartup:
|
_WinMainCRTStartup:
|
||||||
movb $0,U_SYSTEM_ISCONSOLE
|
movb $0,U_SYSTEM_ISCONSOLE
|
||||||
|
_start:
|
||||||
|
subl $0x8,%esp
|
||||||
|
andl $0xfffffff0,%esp
|
||||||
|
push $_cmain
|
||||||
|
call _cygwin_crt0
|
||||||
|
|
||||||
|
.globl _cmain
|
||||||
|
_cmain:
|
||||||
|
subl $0x8,%esp
|
||||||
|
andl $0xfffffff0,%esp
|
||||||
|
pushl etext
|
||||||
|
pushl __image_base__
|
||||||
|
call _monstartup
|
||||||
|
call ___main
|
||||||
call _FPC_EXE_Entry
|
call _FPC_EXE_Entry
|
||||||
|
ret
|
||||||
|
|
||||||
.globl asm_exit
|
.globl asm_exit
|
||||||
asm_exit:
|
asm_exit:
|
||||||
pushl %eax
|
pushl %eax
|
||||||
call __mcleanup
|
call __mcleanup
|
||||||
popl %eax
|
popl %eax
|
||||||
pushl %eax
|
pushl %eax
|
||||||
call exitprocess
|
call exitprocess
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.globl exitprocess
|
.globl exitprocess
|
||||||
exitprocess:
|
exitprocess:
|
||||||
jmp *.L10
|
jmp *.L10
|
||||||
.balign 4,144
|
.balign 4,144
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.balign 4,144
|
.balign 4,144
|
||||||
|
|
||||||
@ -40,7 +57,7 @@ exitprocess:
|
|||||||
|
|
||||||
.section .idata$5
|
.section .idata$5
|
||||||
.L8:
|
.L8:
|
||||||
|
|
||||||
|
|
||||||
.section .idata$5
|
.section .idata$5
|
||||||
.L10:
|
.L10:
|
||||||
@ -56,12 +73,3 @@ exitprocess:
|
|||||||
.section .idata$7
|
.section .idata$7
|
||||||
.L6:
|
.L6:
|
||||||
.ascii "kernel32.dll\000"
|
.ascii "kernel32.dll\000"
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
// Revision 1.1 2002/11/30 18:17:35 carl
|
|
||||||
// + profiling support
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
Loading…
Reference in New Issue
Block a user