Add a debugger menu option to toggle debugging inside components. Allow profiling into components.

[DEVELOPMENT ENVIRONMENT]
* NEW: Debugger: Debugger options are now stored in the project local settings, and not in the project configuration anymore.
* NEW: Debugger: Add a debugger menu option to toggle debugging inside components.
* NEW: Debugger: Disable debugger menu entries that are not relevant during debugging.
* NEW: Profiler: Profiling inside components is possible now.
* OPT: Project tree: Tree refresh is a bit faster now.
This commit is contained in:
gambas 2022-02-05 00:19:20 +01:00
parent d2eebaf136
commit f62e791f74
10 changed files with 7569 additions and 7295 deletions

File diff suppressed because it is too large Load diff

View file

@ -77,7 +77,7 @@ Private Sub Synchronize()
End End
Public Sub GetCommands() As String Public Sub GetCommands() As String[]
Dim aResult As New String[] Dim aResult As New String[]
Dim aBreakpoints As Integer[] Dim aBreakpoints As Integer[]
@ -90,12 +90,12 @@ Public Sub GetCommands() As String
sClass = $cBreakpoints.Key sClass = $cBreakpoints.Key
For Each iLine In aBreakpoints For Each iLine In aBreakpoints
aResult.Add("+" & sClass & "." & CStr(iLine + 1) & "\n") aResult.Add("+" & sClass & "." & CStr(iLine + 1))
Next Next
Next Next
Return aResult.Join("") Return aResult
End End

View file

@ -2,6 +2,14 @@
Private Const DEBUG_REMOTE As Boolean = False Private Const DEBUG_REMOTE As Boolean = False
Public UseTerminal As Boolean
Public RedirectStderr As Boolean
Public UseHttpServer As Boolean
Public Profiling As Boolean
Public DebugInside As Boolean
Private $iProfileIndex As Integer
Public Startup As String Public Startup As String
Public ProcessId As Integer Public ProcessId As Integer
@ -26,8 +34,7 @@ Private $iPosLine As Integer
Private $sError As String Private $sError As String
Private $bStart As Boolean Private $bStart As Boolean
Private $sCmdStart As String Private $aCmdStart As String[]
'PRIVATE $sCmdStartRun AS String
Private $sAddBreakpoint As String Private $sAddBreakpoint As String
Private $sRemoveBreakpoint As String Private $sRemoveBreakpoint As String
@ -550,7 +557,7 @@ Public Sub Process_Kill()
$hProcess = Null $hProcess = Null
If Project.Profiling Then If Profiling Then
FProfile.Open($sProfilePath) FProfile.Open($sProfilePath)
Endif Endif
@ -1076,23 +1083,8 @@ Private Sub Start(sCmd As String)
'PRINT "EXEC "; "gbx -gs " & File.Dir(Project.Path) & " -- " & Project.Arguments 'PRINT "EXEC "; "gbx -gs " & File.Dir(Project.Path) & " -- " & Project.Arguments
ProcessId = 0 ProcessId = 0
$sCmdStart = ""
ReadDebugSettings()
$sCmdStart &= Breakpoints.GetCommands()
If $sAddBreakpoint Then MakeInitialCommands(sCmd)
$sCmdStart &= $sAddBreakpoint & "\n"
$sAddBreakpoint = ""
Endif
$sCmdStart &= FDebugInfo.GetWatches()
'If Project.BreakOnError Then $sCmdStart &= "b+\n"
$sCmdStart &= sCmd
'$sCmdStartRun = sCmd
$bStart = True $bStart = True
Project.Running = True Project.Running = True
@ -1134,7 +1126,7 @@ Private Sub Start(sCmd As String)
Else Else
If Project.Profiling Then FProfile.CleanProfileFiles If Profiling Then FProfile.CleanProfileFiles
If $bRemote Then If $bRemote Then
aExec = ["gbr" & System.Version] aExec = ["gbr" & System.Version]
@ -1142,7 +1134,10 @@ Private Sub Start(sCmd As String)
aExec = [System.Path &/ "bin/gbx" & System.Version] aExec = [System.Path &/ "bin/gbx" & System.Version]
Endif Endif
aExec.Insert(["-g", "-f", sFifo]) aExec.Add("-g")
aExec.Add("-f")
aExec.Add(sFifo)
If Startup Then If Startup Then
aExec.Add("-s") aExec.Add("-s")
@ -1150,7 +1145,7 @@ Private Sub Start(sCmd As String)
Endif Endif
If Project.CanUseHttpServer() Then If Project.CanUseHttpServer() Then
If Project.UseHttpServer Or If Project.Components.Exist("gb.httpd") Then If UseHttpServer Or If Project.Components.Exist("gb.httpd") Then
aExec.Add("-H") aExec.Add("-H")
iPos = aEnv.Find("GB_HTTPD_PORT=*", gb.Like) iPos = aEnv.Find("GB_HTTPD_PORT=*", gb.Like)
sPort = "8080" sPort = "8080"
@ -1163,12 +1158,12 @@ Private Sub Start(sCmd As String)
Endif Endif
Endif Endif
If Project.Profiling Then If Profiling Then
aExec.Add("-p") aExec.Add("-p")
Inc Project.ProfileIndex Inc $iProfileIndex
sFile = "." & CStr(Project.ProfileIndex) & ".prof" sFile = "." & CStr($iProfileIndex) & ".prof"
If Project.ReadOnly Then If Project.ReadOnly Then
$sProfilePath = File.Dir(Temp$) &/ sFile $sProfilePath = File.Dir(Temp$) &/ sFile
@ -1204,7 +1199,7 @@ Private Sub Start(sCmd As String)
Endif Endif
If Project.UseTerminal Then If UseTerminal Then
sTitle = Project.Name & " (" & ("Output terminal") & ")" sTitle = Project.Name & " (" & ("Output terminal") & ")"
@ -1245,7 +1240,7 @@ Private Sub Start(sCmd As String)
Endif Endif
If Project.RedirectStderr Then If RedirectStderr Then
$sPipeError = Temp$() $sPipeError = Temp$()
aExec.Add("-r") aExec.Add("-r")
aExec.Add($sPipeError) aExec.Add($sPipeError)
@ -1366,20 +1361,7 @@ Public Sub RunExtern()
ClearOutput ClearOutput
ProcessId = 0 ProcessId = 0
$sCmdStart = "" MakeInitialCommands("g")
ReadDebugSettings()
$sCmdStart &= Breakpoints.GetCommands()
If $sAddBreakpoint Then
$sCmdStart &= $sAddBreakpoint & "\n"
$sAddBreakpoint = ""
Endif
$sCmdStart &= FDebugInfo.GetWatches()
$sCmdStart &= "g"
$bExtern = True $bExtern = True
$bStart = True $bStart = True
@ -1499,7 +1481,7 @@ Private Sub Signal()
If $bStart Then If $bStart Then
If $bExtern Then FDebugInfo.StopWaitForRemote If $bExtern Then FDebugInfo.StopWaitForRemote
'PRINT "START Debug.Write: "; $sCmdStart 'PRINT "START Debug.Write: "; $sCmdStart
WriteCommand($sCmdStart) If $aCmdStart.Count Then WriteCommand($aCmdStart.Join("\n") & "\n")
$bStart = False $bStart = False
'Command("w", TRUE) 'Command("w", TRUE)
'Command($sCmdStartRun, FALSE, STATE_RUNNING) 'Command($sCmdStartRun, FALSE, STATE_RUNNING)
@ -1598,20 +1580,47 @@ End
' '
' END ' END
Private Sub ReadSettings()
UseTerminal = Project.Config["/Debug/UseTerminal"]
RedirectStderr = Project.Config["/Debug/RedirectStderr"]
UseHttpServer = Project.Config["/Debug/UseHttpServer"]
Profiling = Project.Config["/Debug/Profiling"]
DebugInside = Project.Config["/Debug/DebugInside"]
End
Public Sub ReadDebugSettings() Public Sub ReadDebugSettings()
ReadSettings
FDebugInfo.ReadWatchSettings() FDebugInfo.ReadWatchSettings()
FDebugExpr.ReadSettings() FDebugExpr.ReadSettings()
End End
Public Sub WriteSettings()
Project.Config["/Debug/UseTerminal"] = UseTerminal
Project.Config["/Debug/RedirectStderr"] = RedirectStderr
Project.Config["/Debug/UseHttpServer"] = UseHttpServer
Project.Config["/Debug/Profiling"] = Profiling
Project.Config["/Debug/DebugInside"] = DebugInside
End
Public Sub WriteDebugSettings() Public Sub WriteDebugSettings()
WriteSettings
FDebugInfo.WriteWatchSettings() FDebugInfo.WriteWatchSettings()
FDebugExpr.WriteSettings() FDebugExpr.WriteSettings()
End End
Public Sub OnProjectChange()
ReadSettings
End
Public Sub SetBreakpoint(sClass As String, iLine As Integer, bOn As Boolean) Public Sub SetBreakpoint(sClass As String, iLine As Integer, bOn As Boolean)
@ -1771,3 +1780,35 @@ Private Sub CreateDebuggerHelper() As String
Return $sRemoteDebuggerHelper Return $sRemoteDebuggerHelper
End End
Public Sub SetDebugInside(bVal As Boolean)
DebugInside = bVal
WriteSettings
If Project.Running Then WriteCommand("og" & If(bVal, "+", "-"))
End
Private Sub MakeInitialCommands(sCmd As String)
$aCmdStart = New String[]
ReadDebugSettings()
If DebugInside Then $aCmdStart.Add("og+")
$aCmdStart.Insert(Breakpoints.GetCommands())
If $sAddBreakpoint Then
$aCmdStart.Add($sAddBreakpoint)
$sAddBreakpoint = ""
Endif
$aCmdStart.Insert(FDebugInfo.GetWatches())
'If Project.BreakOnError Then $aCmdStart.Add("o+")
$aCmdStart.Add(sCmd)
End

View file

@ -169,7 +169,7 @@ Public Sub UpdateProfile()
aProf = FProfile.FindAll() aProf = FProfile.FindAll()
panProfile.Children.Clear panProfile.Children.Clear
If aProf.Count = 0 Then If aProf.Count = 0 Then
panProfile.Hide panProfile.Hide
Return Return

View file

@ -1712,21 +1712,21 @@ Public Sub IsWatch(sExpr As String) As Boolean
End End
Public Sub GetWatches() As String Public Sub GetWatches() As String[]
Dim sCmd As String Dim aCmd As New String[]
Dim sExpr As String Dim sExpr As String
If cvwVariable.MoveTo("@") Then Return If cvwVariable.MoveTo("@") Then Return aCmd
If cvwVariable.MoveChild() Then Return If cvwVariable.MoveChild() Then Return aCmd
Repeat Repeat
sExpr = cvwVariable.Item.Text sExpr = cvwVariable.Item.Text
sCmd &= "?W" & sExpr & "\t" & sExpr & "\n" aCmd.Add("?W" & sExpr & "\t" & sExpr)
If $cTrack.Exist("@" & sExpr) Then sCmd &= "w" & $cTrack["@" & sExpr] & "\t" & sExpr & "\n" If $cTrack.Exist("@" & sExpr) Then aCmd.Add("w" & $cTrack["@" & sExpr] & "\t" & sExpr)
Until cvwVariable.MoveNext() Until cvwVariable.MoveNext()
Return sCmd Return aCmd
End End

View file

@ -36,7 +36,9 @@ Static Public Sub Open(sPath As String)
If Not Exist(sPath) Then Return If Not Exist(sPath) Then Return
hProf = New FProfile hProf = New FProfile
Project.SetMessage(("Loading profiling file..."))
hProf.Init(sPath) hProf.Init(sPath)
Project.SetMessage(("OK"), True)
End End
@ -396,14 +398,29 @@ Fast Public Sub Init(sPath As String)
iOldTime = iTime iOldTime = iTime
Dec iLastLine Dec iLastLine
Try aLine[iLastLine] += iTime - iLastTime
If Not Error Then If iLastLine < 0 Then
Inc aCount[iLastLine]
Else
If iLastLine >= 0 Then Debug hCurrent.Name; "."; iLastLine + 1; " ("; aLine.Count; ")"
hCurrent.FirstTime += iTime - iLastTime hCurrent.FirstTime += iTime - iLastTime
Else
If iLastLine >= aLine.Count Then
aLine.Resize((iLastLine + 128) And Not 127)
aCount.Resize(aLine.Count)
Endif
aLine[iLastLine] += iTime - iLastTime
Inc aCount[iLastLine]
Endif Endif
' If Not Error Then
' Else
' If iLastLine >= 0 Then Debug hCurrent.Name; "."; iLastLine + 1; " ("; aLine.Count; ")"
' hCurrent.FirstTime += iTime - iLastTime
' Endif
iLastLine = iLine iLastLine = iLine
Next Next
@ -441,7 +458,7 @@ Fast Public Sub Init(sPath As String)
Catch Catch
Dec Application.Busy Dec Application.Busy
FMain.ShowErrorWith(Subst(("Unable to load profile file: &1"), File.Name(sPath))) FMain.ShowErrorWith(Subst(("Unable to load profile file: &1"), File.Name(sPath)), "*")
End End

View file

@ -1273,7 +1273,14 @@ Public Sub UpdateMenu()
Action[sAction].Enabled = bEnabled Action[sAction].Enabled = bEnabled
Next Next
Action["run-with"].Enabled = bEnabled For Each sAction In ["run-extern", "terminal", "redirect", "httpserver", "gui", "profile", "open-profile", "run-with", "run-remote"]
Action[sAction].Enabled = bEnabled
Next
mnuEnvDbDebug.Enabled = bEnabled
mnuEnvJitDebug.Enabled = bEnabled
mnuEnvNoJit.Enabled = bEnabled
mnuEnvReverse.Enabled = bEnabled
sText = If(Project.Running, ("Continue"), ("Run")) sText = If(Project.Running, ("Continue"), ("Run"))
mnuRun.Text = sText mnuRun.Text = sText
@ -1415,10 +1422,11 @@ Public Sub OnProjectChange()
mnuFilterModified.Visible = VersionControl.Enabled mnuFilterModified.Visible = VersionControl.Enabled
txtSearchProject.Clear txtSearchProject.Clear
mnuUseTerminal.Value = Project.UseTerminal mnuUseTerminal.Value = Design.UseTerminal
mnuRedirectStderr.Value = Project.RedirectStderr mnuRedirectStderr.Value = Design.RedirectStderr
mnuUseHttpServer.Value = Project.UseHttpServer mnuUseHttpServer.Value = Design.UseHttpServer
mnuProfile.Value = Project.Profiling mnuProfile.Value = Design.Profiling
mnuDebugInside.Value = Design.DebugInside
OnRefreshComponents OnRefreshComponents
@ -1620,20 +1628,23 @@ Public Sub Action_Activate((Key) As String) As Boolean
CPosition.MoveNext CPosition.MoveNext
Case "terminal" Case "terminal"
Project.UseTerminal = Action["terminal"].Value Design.UseTerminal = Action["terminal"].Value
Project.WriteProject(True) Design.WriteSettings
Case "redirect" Case "redirect"
Project.RedirectStderr = Action["redirect"].Value Design.RedirectStderr = Action["redirect"].Value
Project.WriteProject(True) Design.WriteSettings
Case "httpserver" Case "httpserver"
Project.UseHttpServer = Action["httpserver"].Value Design.UseHttpServer = Action["httpserver"].Value
Project.WriteProject(True) Design.WriteSettings
Case "profile" Case "profile"
Project.Profiling = Action["profile"].Value Design.Profiling = Action["profile"].Value
Project.WriteProject(True) Design.WriteSettings
Case "debug-inside"
Design.SetDebugInside(Action["debug-inside"].Value)
' Case "breakerr" ' Case "breakerr"
' Project.BreakOnError = Action["breakerr"].Value ' Project.BreakOnError = Action["breakerr"].Value
@ -2294,7 +2305,7 @@ Public Sub ShowErrorWith(sTitle As String, Optional sMsg As String, Optional sKe
Dim sBacktrace As String Dim sBacktrace As String
If Not sMsg Or If sMsg = "*" Then If Not sMsg Or If sMsg = "*" Then
If sMsg = "*" Then sBacktrace = Error.Backtrace.Join(" ") If sMsg = "*" Then Try sBacktrace = Error.Backtrace.Join(" ")
sMsg = Tr(Error.Text) sMsg = Tr(Error.Text)
If sMsg Not Ends "." Then sMsg &= "." If sMsg Not Ends "." Then sMsg &= "."
If sBacktrace Then sMsg &= "\n<font size=\"-1\"><tt>" & sBacktrace & "</tt></font>" If sBacktrace Then sMsg &= "\n<font size=\"-1\"><tt>" & sBacktrace & "</tt></font>"

View file

@ -270,18 +270,6 @@
Text = ("Debug extern process") & "..." Text = ("Debug extern process") & "..."
Picture = Picture["icon:/small/connect"] Picture = Picture["icon:/small/connect"]
} }
{ Menu49 Menu
}
{ Menu45 Menu
Action = "run-with"
Text = ("Program arguments") & "..."
Picture = Picture["icon:/small/text-list-order"]
}
{ mnuDebugRemote Menu
Action = "run-remote"
Text = ("Remote debugging") & "..."
Picture = Picture["icon:/small/network"]
}
{ Menu14 Menu { Menu14 Menu
} }
{ mnuPause Menu { mnuPause Menu
@ -395,7 +383,7 @@
} }
{ mnuProfile Menu { mnuProfile Menu
Action = "profile" Action = "profile"
Text = Shortcut(("Activate profiling"), "g") Text = ("Activate profiling")
Toggle = True Toggle = True
} }
{ mnuOpenProfile Menu { mnuOpenProfile Menu
@ -407,12 +395,29 @@
} }
{ mnuClearBreakpoints Menu { mnuClearBreakpoints Menu
Action = "clear-break" Action = "clear-break"
Text = Shortcut(("Clear all breakpoints"), "a") Text = ("Clear all breakpoints")
} }
{ mnuClearDebugWindows Menu { mnuClearDebugWindows Menu
Action = "close-all-debug" Action = "close-all-debug"
Text = Shortcut(("Close all debug windows"), "d") Text = Shortcut(("Close all debug windows"), "d")
} }
{ Menu49 Menu
}
{ mnuDebugInside Menu
Action = "debug-inside"
Text = ("Debug inside components")
Toggle = True
}
{ Menu45 Menu
Action = "run-with"
Text = ("Program arguments") & "..."
Picture = Picture["icon:/small/text-list-order"]
}
{ mnuDebugRemote Menu
Action = "run-remote"
Text = ("Remote debugging") & "..."
Picture = Picture["icon:/small/network"]
}
} }
{ mnuView Menu { mnuView Menu
Action = "menu-view" Action = "menu-view"
@ -1272,15 +1277,6 @@
Menu = "mnuVersionControl" Menu = "mnuVersionControl"
MenuOnly = True MenuOnly = True
} }
{ btnRunWith ToolButton
MoveScaled(89,4,15,4)
Visible = False
ToolTip = ("Run with arguments")
Action = "run-with"
AutoResize = True
Text = ("Run with") & "..."
Picture = Picture["icon:/small/play"]
}
{ btnRunRemote ToolButton { btnRunRemote ToolButton
MoveScaled(104,4,4,4) MoveScaled(104,4,4,4)
Visible = False Visible = False
@ -1630,6 +1626,10 @@
Shortcut = "Ctrl+X" Shortcut = "Ctrl+X"
Picture = "icon:/small/cut" Picture = "icon:/small/cut"
} }
{ Action debug-inside
Text = "Debug inside components"
Shortcut = ""
}
{ Action delete { Action delete
Text = "Delete" Text = "Delete"
Shortcut = "Del" Shortcut = "Del"
@ -1870,9 +1870,9 @@
Picture = "icon:/small/play" Picture = "icon:/small/play"
} }
{ Action run-with { Action run-with
Text = "Run with" Text = "Program arguments"
Shortcut = "" Shortcut = ""
Picture = "icon:/small/play" Picture = "icon:/small/text-list-order"
} }
{ Action save-project { Action save-project
Text = "Save project" Text = "Save project"
@ -1985,7 +1985,7 @@
{ Toolbars { Toolbars
{ Toolbar main { Toolbar main
Text = "" Text = ""
List = "new-project,open-project,save-project,save-project-as,project-property,refresh-project,option,shortcut,exec,translate,archive,install,project,property,control,console,find,help,compile,compile-all,test,start,pause,stop,step,forward,return,until,find-project,go-back,go-forward,browse-project,open-terminal,send-mail,publish,farm,gui,menu-file,menu-edit,menu-project,menu-debug,menu-view,menu-tool,menu-help,version-control,run-with,run-extern" List = "new-project,open-project,save-project,save-project-as,project-property,refresh-project,option,shortcut,exec,translate,archive,install,project,property,control,console,find,help,compile,compile-all,test,start,pause,stop,step,forward,return,until,find-project,go-back,go-forward,browse-project,open-terminal,send-mail,publish,farm,gui,menu-file,menu-edit,menu-project,menu-debug,menu-view,menu-tool,menu-help,version-control,run-extern"
Default = "new-project,open-project,save-project,save-project-as,project-property,option,|,exec,translate,|,compile,compile-all,test,start,pause,stop,step,forward,return,until,-,find-project,go-back,go-forward,version-control" Default = "new-project,open-project,save-project,save-project-as,project-property,option,|,exec,translate,|,compile,compile-all,test,start,pause,stop,step,forward,return,until,-,find-project,go-back,go-forward,version-control"
} }
} }

View file

@ -105,11 +105,6 @@ Public DefaultLanguage As String
Public Type As Integer Public Type As Integer
Public Authors As String Public Authors As String
Public VersionFile As Boolean Public VersionFile As Boolean
Public UseTerminal As Boolean
Public RedirectStderr As Boolean
Public UseHttpServer As Boolean
Public Profiling As Boolean
Public ProfileIndex As Integer
Public DoNotTranslate As String[] Public DoNotTranslate As String[]
Public CompressFiles As Boolean Public CompressFiles As Boolean
Public CompressedFiles As String[] Public CompressedFiles As String[]
@ -801,19 +796,20 @@ _INIT_AGAIN:
If Not bIsFake Then CRecentProject.Add(sDir) If Not bIsFake Then CRecentProject.Add(sDir)
If Not $bTesting If Not $bTesting Then
If Not bIsFake Then
Design.OnProjectChange
Breakpoints.OnProjectChange
FDebugInfo.OnProjectChange
Endif
FMain.OnProjectChange FMain.OnProjectChange
FSearch.OnProjectChange FSearch.OnProjectChange
If Class.IsLoaded("FHelpBrowser") Then FHelpBrowser.OnProjectChange If Class.IsLoaded("FHelpBrowser") Then FHelpBrowser.OnProjectChange
FProfile.OnProjectChange FProfile.OnProjectChange
'FOpenProject.OnUpdateRecent 'FOpenProject.OnUpdateRecent
If Not bIsFake Then
Breakpoints.OnProjectChange
FDebugInfo.OnProjectChange
'FDebugButton.OnProjectChange
Endif
Endif Endif
$hLock = hLock $hLock = hLock
@ -3434,11 +3430,6 @@ Public Sub ReadProject(Optional bConvert As Boolean)
RunAfterMakingExec = "" RunAfterMakingExec = ""
DefaultLanguage = "" DefaultLanguage = ""
VersionFile = False VersionFile = False
UseTerminal = False
RedirectStderr = False
UseHttpServer = False
Profiling = False
ProfileIndex = 0
Maintainer = "" Maintainer = ""
Vendor = "" Vendor = ""
VendorPrefix = "" VendorPrefix = ""
@ -3722,18 +3713,6 @@ Public Sub ReadProject(Optional bConvert As Boolean)
Case "sourcepath" Case "sourcepath"
SourcePath = sVal SourcePath = sVal
Case "useterminal"
UseTerminal = CInt(sVal) <> 0
Case "redirectstderr"
RedirectStderr = CInt(sVal) <> 0
Case "usehttpserver"
UseHttpServer = CInt(sVal) <> 0
Case "profiling"
Profiling = CInt(sVal) <> 0
' Case "breakonerror" ' Case "breakonerror"
' BreakOnError = CInt(sVal) <> 0 ' BreakOnError = CInt(sVal) <> 0
' '
@ -3876,13 +3855,6 @@ Public Sub WriteProject(Optional bComponentDoNotChange As Boolean, Optional bMak
If Title Then Print #hFile, "Title="; Title If Title Then Print #hFile, "Title="; Title
If Startup Then Print #hFile, "Startup="; Startup If Startup Then Print #hFile, "Startup="; Startup
'If Stack Then Print #hFic, "Stack="; Stack
'If StackTrace Then Print #hFic, "StackTrace=1"
If UseTerminal Then Print #hFile, "UseTerminal=1"
If RedirectStderr Then Print #hFile, "RedirectStderr=1"
If UseHttpServer Then Print #hFile, "UseHttpServer=1"
If Profiling Then Print #hFile, "Profiling=1"
'If BreakOnError Then Print #hFic, "BreakOnError=1"
If Icon Then Print #hFile, "Icon="; Icon If Icon Then Print #hFile, "Icon="; Icon
GetVersion() GetVersion()

View file

@ -318,21 +318,23 @@ End
Private Procedure AddDir(Optional sDir As String) Private Procedure AddDir(Optional sDir As String)
Dim cDir As New String[] Dim aDir As New String[]
Dim sFile As String Dim sFile As String
Dim aFile As New String[] Dim aFile As New String[]
If sDir Then If sDir Then
cDir.Add(sDir) aDir.Add(sDir)
Else Else
cDir.Add($sDir) aDir.Add($sDir)
If $sDir <> $sSourceDir Then cDir.Add($sSourceDir) If $sDir <> $sSourceDir Then aDir.Add($sSourceDir)
Endif Endif
$hTree._Begin()
Repeat Repeat
sDir = cDir[0] sDir = aDir[0]
cDir.Remove(0) aDir.Remove(0)
If Not IsDir(sDir) Then Continue If Not IsDir(sDir) Then Continue
@ -355,14 +357,16 @@ Private Procedure AddDir(Optional sDir As String)
For Each sFile In aFile For Each sFile In aFile
sFile = Mid$(sFile, 2) sFile = Mid$(sFile, 2)
If AddFile(sDir, sFile, True) Then cDir.Add(sDir &/ sFile)
'AddFile(sDir, sFile, True) 'AddFile(sDir, sFile, True)
If AddFile(sDir, sFile) Then aDir.Add(sDir &/ sFile)
Next Next
DoRefreshAfter DoRefreshAfter
Until cDir.Count = 0 Until aDir.Count = 0
$hTree._End()
End End