瀏覽代碼

* use a gdb/mi command for adding source directories

git-svn-id: trunk@29732 -
nickysn 10 年之前
父節點
當前提交
9eeef2581b
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      ide/fpdebug.pas

+ 8 - 2
ide/fpdebug.pas

@@ -724,6 +724,12 @@ begin
 end;
 end;
 
 
 procedure TDebugController.SetSourceDirs;
 procedure TDebugController.SetSourceDirs;
+  const
+{$ifdef GDBMI}
+    AddSourceDirCommand = '-environment-directory';
+{$else GDBMI}
+    AddSourceDirCommand = 'dir';
+{$endif GDBMI}
   var f,s: ansistring;
   var f,s: ansistring;
       i : longint;
       i : longint;
       Dir : SearchRec;
       Dir : SearchRec;
@@ -740,7 +746,7 @@ begin
       end;
       end;
     DefaultReplacements(s);
     DefaultReplacements(s);
     if (pos('*',s)=0) and ExistsDir(s) then
     if (pos('*',s)=0) and ExistsDir(s) then
-      Command('dir '+GDBFileName(GetShortName(s)))
+      Command(AddSourceDirCommand+' '+GDBFileName(GetShortName(s)))
     { we should also handle the /* cases of -Fu option }
     { we should also handle the /* cases of -Fu option }
     else if pos('*',s)>0 then
     else if pos('*',s)>0 then
       begin
       begin
@@ -750,7 +756,7 @@ begin
         while Dos.DosError=0 do
         while Dos.DosError=0 do
           begin
           begin
             if ((Dir.attr and Directory) <> 0) and ExistsDir(s+Dir.Name) then
             if ((Dir.attr and Directory) <> 0) and ExistsDir(s+Dir.Name) then
-              Command('dir '+GDBFileName(GetShortName(s+Dir.Name)));
+              Command(AddSourceDirCommand+' '+GDBFileName(GetShortName(s+Dir.Name)));
             Dos.FindNext(Dir);
             Dos.FindNext(Dir);
           end;
           end;
         Dos.FindClose(Dir);
         Dos.FindClose(Dir);