|
@@ -224,7 +224,7 @@ interface
|
|
function def_dwarf_class_struct_lab(def:tobjectdef) : tasmsymbol;
|
|
function def_dwarf_class_struct_lab(def:tobjectdef) : tasmsymbol;
|
|
function get_file_index(afile: tinputfile): Integer;
|
|
function get_file_index(afile: tinputfile): Integer;
|
|
procedure write_symtable_syms(st:TSymtable);
|
|
procedure write_symtable_syms(st:TSymtable);
|
|
- function clean_dwarf_path(const s:tcmdstr):tcmdstr;
|
|
|
|
|
|
+ function relative_dwarf_path(const s:tcmdstr):tcmdstr;
|
|
protected
|
|
protected
|
|
// set if we should use 64bit headers (dwarf3 and up)
|
|
// set if we should use 64bit headers (dwarf3 and up)
|
|
_use_64bit_headers: Boolean;
|
|
_use_64bit_headers: Boolean;
|
|
@@ -626,11 +626,11 @@ implementation
|
|
TDebugInfoDwarf
|
|
TDebugInfoDwarf
|
|
****************************************************************************}
|
|
****************************************************************************}
|
|
|
|
|
|
- function TDebugInfoDwarf.clean_dwarf_path(const s:tcmdstr):tcmdstr;
|
|
|
|
|
|
+ function TDebugInfoDwarf.relative_dwarf_path(const s:tcmdstr):tcmdstr;
|
|
begin
|
|
begin
|
|
{ Make a clean path for gdb. Remove trailing / and ./ prefixes and
|
|
{ Make a clean path for gdb. Remove trailing / and ./ prefixes and
|
|
- use always a / }
|
|
|
|
- result:=BsToSlash(ExcludeTrailingPathDelimiter(ExtractRelativePath('.',s)));
|
|
|
|
|
|
+ use always a / }
|
|
|
|
+ result:=BsToSlash(ExcludeTrailingPathDelimiter(ExtractRelativePath(GetCurrentDir,FixFileName(ExpandFileName(s)))));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -781,7 +781,6 @@ implementation
|
|
dirname := '.'
|
|
dirname := '.'
|
|
else
|
|
else
|
|
dirname := afile.path^;
|
|
dirname := afile.path^;
|
|
-
|
|
|
|
diritem := TDirIndexItem(dirlist.Find(dirname));
|
|
diritem := TDirIndexItem(dirlist.Find(dirname));
|
|
if diritem = nil then
|
|
if diritem = nil then
|
|
diritem := TDirIndexItem.Create(dirlist,dirname, dirlist.Count);
|
|
diritem := TDirIndexItem.Create(dirlist,dirname, dirlist.Count);
|
|
@@ -2281,7 +2280,7 @@ implementation
|
|
if ditem.Name = '.' then
|
|
if ditem.Name = '.' then
|
|
Continue;
|
|
Continue;
|
|
{ Write without trailing path delimiter and also don't prefix with ./ for current dir }
|
|
{ Write without trailing path delimiter and also don't prefix with ./ for current dir }
|
|
- linelist.concat(tai_string.create(clean_dwarf_path(ditem.Name)+#0));
|
|
|
|
|
|
+ linelist.concat(tai_string.create(relative_dwarf_path(ditem.Name)+#0));
|
|
end;
|
|
end;
|
|
linelist.concat(tai_const.create_8bit(0));
|
|
linelist.concat(tai_const.create_8bit(0));
|
|
|
|
|
|
@@ -2404,9 +2403,9 @@ implementation
|
|
|
|
|
|
{ first manadatory compilation unit TAG }
|
|
{ first manadatory compilation unit TAG }
|
|
append_entry(DW_TAG_compile_unit,true,[
|
|
append_entry(DW_TAG_compile_unit,true,[
|
|
- DW_AT_name,DW_FORM_string,clean_dwarf_path(FixFileName(current_module.sourcefiles.get_file(1).path^+current_module.sourcefiles.get_file(1).name^))+#0,
|
|
|
|
|
|
+ DW_AT_name,DW_FORM_string,relative_dwarf_path(current_module.sourcefiles.get_file(1).path^+current_module.sourcefiles.get_file(1).name^)+#0,
|
|
DW_AT_producer,DW_FORM_string,'Free Pascal '+full_version_string+' '+date_string+#0,
|
|
DW_AT_producer,DW_FORM_string,'Free Pascal '+full_version_string+' '+date_string+#0,
|
|
- DW_AT_comp_dir,DW_FORM_string,clean_dwarf_path(FixPath(GetCurrentDir,false))+#0,
|
|
|
|
|
|
+ DW_AT_comp_dir,DW_FORM_string,BSToSlash(FixPath(GetCurrentDir,false))+#0,
|
|
DW_AT_language,DW_FORM_data1,DW_LANG_Pascal83,
|
|
DW_AT_language,DW_FORM_data1,DW_LANG_Pascal83,
|
|
DW_AT_identifier_case,DW_FORM_data1,DW_ID_case_insensitive]);
|
|
DW_AT_identifier_case,DW_FORM_data1,DW_ID_case_insensitive]);
|
|
|
|
|