* Fix lineinfo problems for BeOS/Haiku

git-svn-id: trunk@19760 -
This commit is contained in:
pierre 2011-12-05 16:29:43 +00:00
parent 040c846fa1
commit ceffd8b8cc
2 changed files with 21 additions and 8 deletions

View File

@ -815,6 +815,7 @@ const
B_LIBRARY_IMAGE = 2; B_LIBRARY_IMAGE = 2;
B_ADD_ON_IMAGE = 3; B_ADD_ON_IMAGE = 3;
B_SYSTEM_IMAGE = 4; B_SYSTEM_IMAGE = 4;
B_OK = 0;
type type
image_info = packed record image_info = packed record
@ -848,13 +849,20 @@ var
begin begin
// The only BeOS specific part is setting the processaddress // The only BeOS specific part is setting the processaddress
cookie := 0; cookie := 0;
OpenElf32Beos:=false;
fillchar(info, sizeof(image_info), 0); fillchar(info, sizeof(image_info), 0);
get_next_image_info(0,cookie,info,sizeof(info)); while get_next_image_info(0,cookie,info,sizeof(info))=B_OK do
if (info._type = B_APP_IMAGE) then begin
e.processaddress := cardinal(info.text) if e.filename=String(pchar(@info.name)) then
else begin
e.processaddress := 0; if (info._type = B_APP_IMAGE) then
OpenElf32Beos := OpenElf(e); e.processaddress := cardinal(info.text)
else
e.processaddress := 0;
OpenElf32Beos := OpenElf(e);
exit;
end;
end;
end; end;
{$endif beos} {$endif beos}

View File

@ -96,7 +96,12 @@ begin
if not OpenExeFile(e,dbgfn) then if not OpenExeFile(e,dbgfn) then
exit; exit;
end; end;
e.processaddress:=ptruint(baseaddr)-e.processaddress; {$ifdef BeOS}
{ Do not change ProcessAddress field for BeOS/Haiku
if baseAddr is lower than ProcessAdress }
if ptruint(baseaddr)>ptruint(e.processaddress) then
{$endif BeOS}
e.processaddress:=ptruint(baseaddr)-e.processaddress;
StabsFunctionRelative := E.FunctionRelative; StabsFunctionRelative := E.FunctionRelative;
if FindExeSection(e,'.stab',stabofs,stablen) and if FindExeSection(e,'.stab',stabofs,stablen) and
FindExeSection(e,'.stabstr',stabstrofs,stabstrlen) then FindExeSection(e,'.stabstr',stabstrofs,stabstrlen) then