debugger: convert path delimiters in the debugger, not in the IDE

git-svn-id: trunk@18902 -
This commit is contained in:
paul 2009-03-06 04:41:23 +00:00
parent 2ee7e2cfc6
commit 6a38d2a91c
3 changed files with 14 additions and 3 deletions

View File

@ -54,6 +54,7 @@ type
function GetLine(var ABuffer: String): String;
function ConvertToCString(const AText: String): String;
function ConvertPathDelims(const AFileName: String): String;
function DeleteEscapeChars(const AValue: String; const AEscapeChar: Char = '\'): String;
function UnQuote(const AValue: String): String;
@ -137,6 +138,16 @@ begin
end;
end;
function ConvertPathDelims(const AFileName: String): String;
var
i: Integer;
begin
Result := AFileName;
for i := 1 to length(Result) do
if Result[i] in ['/','\'] then
Result[i] := PathDelim;
end;
function Unquote(const AValue: String): String;
var
len: Integer;

View File

@ -2017,7 +2017,7 @@ begin
Val(Frame.Values['addr'], Location.Address, e);
if e=0 then ;
Location.FuncName := Frame.Values['func'];
Location.SrcFile := Frame.Values['file'];
Location.SrcFile := ConvertPathDelims(Frame.Values['file']);
Location.SrcLine := StrToIntDef(Frame.Values['line'], -1);
Frame.Free;
@ -2255,7 +2255,7 @@ function TGDBMIDebugger.ProcessStopped(const AParams: String; const AIgnoreSigIn
if ExecuteCommand('info line * pointer(%s)', [S], [cfIgnoreError, cfNoMiCommand], R)
then begin
Result.SrcLine := StrToIntDef(GetPart('Line ', ' of', R.Values), -1);
Result.SrcFile := GetPart('\"', '\"', R.Values);
Result.SrcFile := ConvertPathDelims(GetPart('\"', '\"', R.Values));
end;
end;

View File

@ -11440,7 +11440,7 @@ begin
{$ENDIF}
if FilenameIsAbsolute(AFilename) then
begin
Result := SwitchPathDelims(AFilename, pdsSystem);
Result := AFilename;
if not FileExistsUTF8(Result) then
Result := '';
Exit;