mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 01:49:11 +02:00
--- Merging r40843 into '.':
U rtl/haiku/si_c.pp U rtl/haiku/si_dllc.pp U rtl/haiku/system.pp --- Recording mergeinfo for merge of r40843 into '.': U . --- Merging r40844 into '.': G rtl/haiku/system.pp --- Recording mergeinfo for merge of r40844 into '.': G . --- Merging r40845 into '.': U rtl/inc/exeinfo.pp --- Recording mergeinfo for merge of r40845 into '.': G . --- Merging r42083 into '.': U rtl/haiku/Makefile U rtl/haiku/Makefile.fpc --- Recording mergeinfo for merge of r42083 into '.': G . # revisions: 40843,40844,40845,42083 git-svn-id: branches/fixes_3_2@42117 -
This commit is contained in:
parent
d5027fceeb
commit
39a12910ef
@ -3427,7 +3427,7 @@ strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
|
|||||||
$(SYSTEMUNIT)$(PPUEXT)
|
$(SYSTEMUNIT)$(PPUEXT)
|
||||||
unixtype$(PPUEXT) : $(UNIXINC)/unixtype.pp ptypes.inc $(UNIXINC)/ctypes.inc $(SYSTEMUNIT)$(PPUEXT)
|
unixtype$(PPUEXT) : $(UNIXINC)/unixtype.pp ptypes.inc $(UNIXINC)/ctypes.inc $(SYSTEMUNIT)$(PPUEXT)
|
||||||
$(COMPILER) $(UNIXINC)/unixtype.pp
|
$(COMPILER) $(UNIXINC)/unixtype.pp
|
||||||
baseunix$(PPUEXT) : $(UNIXINC)/unixtype.pp $(SYSTEMUNIT)$(PPUEXT)
|
baseunix$(PPUEXT) : baseunix.pp $(UNIXINC)/unixtype.pp $(SYSTEMUNIT)$(PPUEXT)
|
||||||
$(COMPILER) -Fi$(UNIXINC) -Fu$(UNIXINC) baseunix.pp
|
$(COMPILER) -Fi$(UNIXINC) -Fu$(UNIXINC) baseunix.pp
|
||||||
syscall$(PPUEXT) : $(UNIXINC)/syscall.pp $(SYSNRINC) $(SYSTEMUNIT)$(PPUEXT)
|
syscall$(PPUEXT) : $(UNIXINC)/syscall.pp $(SYSNRINC) $(SYSTEMUNIT)$(PPUEXT)
|
||||||
$(COMPILER) $(UNIXINC)/syscall.pp
|
$(COMPILER) $(UNIXINC)/syscall.pp
|
||||||
|
@ -137,7 +137,7 @@ strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
|
|||||||
unixtype$(PPUEXT) : $(UNIXINC)/unixtype.pp ptypes.inc $(UNIXINC)/ctypes.inc $(SYSTEMUNIT)$(PPUEXT)
|
unixtype$(PPUEXT) : $(UNIXINC)/unixtype.pp ptypes.inc $(UNIXINC)/ctypes.inc $(SYSTEMUNIT)$(PPUEXT)
|
||||||
$(COMPILER) $(UNIXINC)/unixtype.pp
|
$(COMPILER) $(UNIXINC)/unixtype.pp
|
||||||
|
|
||||||
baseunix$(PPUEXT) : $(UNIXINC)/unixtype.pp $(SYSTEMUNIT)$(PPUEXT)
|
baseunix$(PPUEXT) : baseunix.pp unixtype$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
|
||||||
$(COMPILER) -Fi$(UNIXINC) -Fu$(UNIXINC) baseunix.pp
|
$(COMPILER) -Fi$(UNIXINC) -Fu$(UNIXINC) baseunix.pp
|
||||||
|
|
||||||
syscall$(PPUEXT) : $(UNIXINC)/syscall.pp $(SYSNRINC) $(SYSTEMUNIT)$(PPUEXT)
|
syscall$(PPUEXT) : $(UNIXINC)/syscall.pp $(SYSNRINC) $(SYSTEMUNIT)$(PPUEXT)
|
||||||
|
@ -21,6 +21,7 @@ implementation
|
|||||||
|
|
||||||
{ Bindings to RTL }
|
{ Bindings to RTL }
|
||||||
var
|
var
|
||||||
|
initialstkptr: pointer; public name '__stkptr';
|
||||||
argc: longint; public name 'operatingsystem_parameter_argc';
|
argc: longint; public name 'operatingsystem_parameter_argc';
|
||||||
argv: pointer; public name 'operatingsystem_parameter_argv';
|
argv: pointer; public name 'operatingsystem_parameter_argv';
|
||||||
envp: pointer; public name 'operatingsystem_parameter_envp';
|
envp: pointer; public name 'operatingsystem_parameter_envp';
|
||||||
@ -43,6 +44,7 @@ procedure __exit(status: longint); cdecl; external libc name 'exit';
|
|||||||
|
|
||||||
function _FPC_proc_start(_argc: longint; _argv: pointer; _envp: pointer): longint; cdecl; public name '_start';
|
function _FPC_proc_start(_argc: longint; _argv: pointer; _envp: pointer): longint; cdecl; public name '_start';
|
||||||
begin
|
begin
|
||||||
|
initialstkptr:=get_frame;
|
||||||
argc:=_argc;
|
argc:=_argc;
|
||||||
argv:=_argv;
|
argv:=_argv;
|
||||||
envp:=_envp;
|
envp:=_envp;
|
||||||
|
@ -22,6 +22,7 @@ implementation
|
|||||||
|
|
||||||
{ Bindings to RTL }
|
{ Bindings to RTL }
|
||||||
var
|
var
|
||||||
|
initialstkptr: pointer; public name '__stkptr';
|
||||||
argc: longint; public name 'operatingsystem_parameter_argc';
|
argc: longint; public name 'operatingsystem_parameter_argc';
|
||||||
argv: pointer; public name 'operatingsystem_parameter_argv';
|
argv: pointer; public name 'operatingsystem_parameter_argv';
|
||||||
envp: pointer; public name 'operatingsystem_parameter_envp';
|
envp: pointer; public name 'operatingsystem_parameter_envp';
|
||||||
@ -42,6 +43,7 @@ procedure __exit(status: longint); cdecl; external libc name 'exit';
|
|||||||
|
|
||||||
procedure _FPC_shared_lib_start; cdecl; public name 'initialize_after';
|
procedure _FPC_shared_lib_start; cdecl; public name 'initialize_after';
|
||||||
begin
|
begin
|
||||||
|
initialstkptr:=get_frame;
|
||||||
argc:=__libc_argc;
|
argc:=__libc_argc;
|
||||||
argv:=__libc_argv;
|
argv:=__libc_argv;
|
||||||
envp:=environ;
|
envp:=environ;
|
||||||
|
@ -24,6 +24,9 @@ interface
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
var
|
||||||
|
initialstkptr : Pointer; external name '__stkptr';
|
||||||
|
|
||||||
procedure debugger(s : PChar); cdecl; external 'root' name 'debugger';
|
procedure debugger(s : PChar); cdecl; external 'root' name 'debugger';
|
||||||
function disable_debugger(state : integer): integer; cdecl; external 'root' name 'disable_debugger';
|
function disable_debugger(state : integer): integer; cdecl; external 'root' name 'disable_debugger';
|
||||||
|
|
||||||
@ -228,7 +231,7 @@ begin
|
|||||||
{ initialize handler }
|
{ initialize handler }
|
||||||
act.sa_mask[0] := 0;
|
act.sa_mask[0] := 0;
|
||||||
act.sa_handler := SigActionHandler(@SignalToRunError);
|
act.sa_handler := SigActionHandler(@SignalToRunError);
|
||||||
act.sa_flags := SA_ONSTACK;
|
act.sa_flags := SA_ONSTACK or SA_SIGINFO;
|
||||||
FpSigAction(signum,@act,@oldact);
|
FpSigAction(signum,@act,@oldact);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -272,7 +275,11 @@ end;
|
|||||||
begin
|
begin
|
||||||
IsConsole := TRUE;
|
IsConsole := TRUE;
|
||||||
StackLength := CheckInitialStkLen(InitialStkLen);
|
StackLength := CheckInitialStkLen(InitialStkLen);
|
||||||
|
{$if FPC_FULLVERSION >= 30301}
|
||||||
|
StackBottom := initialstkptr - StackLength;
|
||||||
|
{$else}
|
||||||
StackBottom := Sptr - StackLength;
|
StackBottom := Sptr - StackLength;
|
||||||
|
{$endif}
|
||||||
ReturnNilIfGrowHeapFails := False;
|
ReturnNilIfGrowHeapFails := False;
|
||||||
|
|
||||||
{ Set up signals handlers }
|
{ Set up signals handlers }
|
||||||
|
@ -67,7 +67,7 @@ implementation
|
|||||||
uses
|
uses
|
||||||
strings{$ifdef windows},windows{$endif windows};
|
strings{$ifdef windows},windows{$endif windows};
|
||||||
|
|
||||||
{$if defined(unix)}
|
{$if defined(unix) and not defined(beos) and not defined(haiku)}
|
||||||
|
|
||||||
procedure GetModuleByAddr(addr: pointer; var baseaddr: pointer; var filename: string);
|
procedure GetModuleByAddr(addr: pointer; var baseaddr: pointer; var filename: string);
|
||||||
begin
|
begin
|
||||||
@ -129,6 +129,37 @@ uses
|
|||||||
filename:=ParamStr(0);
|
filename:=ParamStr(0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$elseif defined(beos) or defined(haiku)}
|
||||||
|
|
||||||
|
{$i ptypes.inc}
|
||||||
|
{$i ostypes.inc}
|
||||||
|
|
||||||
|
function get_next_image_info(team: team_id; var cookie:longint; var info:image_info; size: size_t) : status_t;cdecl; external 'root' name '_get_next_image_info';
|
||||||
|
|
||||||
|
procedure GetModuleByAddr(addr: pointer; var baseaddr: pointer; var filename: string);
|
||||||
|
const
|
||||||
|
B_OK = 0;
|
||||||
|
var
|
||||||
|
cookie : longint;
|
||||||
|
info : image_info;
|
||||||
|
begin
|
||||||
|
filename:='';
|
||||||
|
baseaddr:=nil;
|
||||||
|
|
||||||
|
cookie:=0;
|
||||||
|
fillchar(info, sizeof(image_info), 0);
|
||||||
|
|
||||||
|
while get_next_image_info(0,cookie,info,sizeof(info))=B_OK do
|
||||||
|
begin
|
||||||
|
if (info._type = B_APP_IMAGE) and
|
||||||
|
(addr >= info.text) and (addr <= (info.text + info.text_size)) then
|
||||||
|
begin
|
||||||
|
baseaddr:=info.text;
|
||||||
|
filename:=PChar(@info.name);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{$else}
|
{$else}
|
||||||
|
|
||||||
{$ifdef CPUI8086}
|
{$ifdef CPUI8086}
|
||||||
@ -161,6 +192,14 @@ uses
|
|||||||
{$endif}
|
{$endif}
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
{$if defined(beos) or defined(haiku)}
|
||||||
|
{$ifdef cpu64}
|
||||||
|
{$define ELF64}
|
||||||
|
{$else}
|
||||||
|
{$define ELF32}
|
||||||
|
{$endif}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
{$if defined(morphos)}
|
{$if defined(morphos)}
|
||||||
{$define ELF32}
|
{$define ELF32}
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -746,7 +785,7 @@ end;
|
|||||||
ELF
|
ELF
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
{$if defined(ELF32) or defined(BEOS)}
|
{$if defined(ELF32)}
|
||||||
type
|
type
|
||||||
telfheader=packed record
|
telfheader=packed record
|
||||||
magic0123 : longint;
|
magic0123 : longint;
|
||||||
@ -790,7 +829,7 @@ type
|
|||||||
p_flags : longword;
|
p_flags : longword;
|
||||||
p_align : longword;
|
p_align : longword;
|
||||||
end;
|
end;
|
||||||
{$endif ELF32 or BEOS}
|
{$endif ELF32}
|
||||||
{$ifdef ELF64}
|
{$ifdef ELF64}
|
||||||
type
|
type
|
||||||
telfheader=packed record
|
telfheader=packed record
|
||||||
@ -840,7 +879,7 @@ type
|
|||||||
{$endif ELF64}
|
{$endif ELF64}
|
||||||
|
|
||||||
|
|
||||||
{$if defined(ELF32) or defined(ELF64) or defined(BEOS)}
|
{$if defined(ELF32) or defined(ELF64)}
|
||||||
|
|
||||||
{$ifdef FIND_BASEADDR_ELF}
|
{$ifdef FIND_BASEADDR_ELF}
|
||||||
var
|
var
|
||||||
@ -1044,75 +1083,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$endif ELF32 or ELF64 or BEOS}
|
{$endif ELF32 or ELF64}
|
||||||
|
|
||||||
|
|
||||||
{$ifdef beos}
|
|
||||||
|
|
||||||
{$i ptypes.inc}
|
|
||||||
|
|
||||||
type
|
|
||||||
// Descriptive formats
|
|
||||||
status_t = Longint;
|
|
||||||
team_id = Longint;
|
|
||||||
image_id = Longint;
|
|
||||||
|
|
||||||
{ image types }
|
|
||||||
const
|
|
||||||
B_APP_IMAGE = 1;
|
|
||||||
B_LIBRARY_IMAGE = 2;
|
|
||||||
B_ADD_ON_IMAGE = 3;
|
|
||||||
B_SYSTEM_IMAGE = 4;
|
|
||||||
B_OK = 0;
|
|
||||||
|
|
||||||
type
|
|
||||||
image_info = packed record
|
|
||||||
id : image_id;
|
|
||||||
_type : longint;
|
|
||||||
sequence: longint;
|
|
||||||
init_order: longint;
|
|
||||||
init_routine: pointer;
|
|
||||||
term_routine: pointer;
|
|
||||||
device: dev_t;
|
|
||||||
node: ino_t;
|
|
||||||
name: array[0..MAXPATHLEN-1] of char;
|
|
||||||
{ name: string[255];
|
|
||||||
name2: string[255];
|
|
||||||
name3: string[255];
|
|
||||||
name4: string[255];
|
|
||||||
name5: string[5];
|
|
||||||
}
|
|
||||||
text: pointer;
|
|
||||||
data: pointer;
|
|
||||||
text_size: longint;
|
|
||||||
data_size: longint;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function get_next_image_info(team: team_id; var cookie:longint; var info:image_info; size: size_t) : status_t;cdecl; external 'root' name '_get_next_image_info';
|
|
||||||
|
|
||||||
function OpenElf32Beos(var e:TExeFile):boolean;
|
|
||||||
var
|
|
||||||
cookie : longint;
|
|
||||||
info : image_info;
|
|
||||||
begin
|
|
||||||
// The only BeOS specific part is setting the processaddress
|
|
||||||
cookie := 0;
|
|
||||||
OpenElf32Beos:=false;
|
|
||||||
fillchar(info, sizeof(image_info), 0);
|
|
||||||
while get_next_image_info(0,cookie,info,sizeof(info))=B_OK do
|
|
||||||
begin
|
|
||||||
if e.filename=String(pchar(@info.name)) then
|
|
||||||
begin
|
|
||||||
if (info._type = B_APP_IMAGE) then
|
|
||||||
e.processaddress := cardinal(info.text)
|
|
||||||
else
|
|
||||||
e.processaddress := 0;
|
|
||||||
OpenElf32Beos := OpenElf(e);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
{$endif beos}
|
|
||||||
|
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
@ -1281,10 +1252,6 @@ const
|
|||||||
openproc : @OpenElf;
|
openproc : @OpenElf;
|
||||||
findproc : @FindSectionElf;
|
findproc : @FindSectionElf;
|
||||||
{$endif ELF32 or ELF64}
|
{$endif ELF32 or ELF64}
|
||||||
{$ifdef BEOS}
|
|
||||||
openproc : @OpenElf32Beos;
|
|
||||||
findproc : @FindSectionElf;
|
|
||||||
{$endif BEOS}
|
|
||||||
{$ifdef darwin}
|
{$ifdef darwin}
|
||||||
openproc : @OpenMachO32PPC;
|
openproc : @OpenMachO32PPC;
|
||||||
findproc : @FindSectionMachO32PPC;
|
findproc : @FindSectionMachO32PPC;
|
||||||
|
Loading…
Reference in New Issue
Block a user