Debugger: Process ressource watch should not crash anymore when the process is dead.

[DEVELOPMENT ENVIRONMENT]
* BUG: Debugger: Process ressource watch should not crash anymore when the process is dead.
This commit is contained in:
gambas 2021-10-29 02:46:05 +02:00
parent fe27af0ddb
commit 1c2063cbec

View file

@ -1774,17 +1774,18 @@ Public Sub TimerWatch_Timer()
Try ProcessFiles = Dir(sDir &/ "fd").Count
If Error Then ProcessFiles = -1
aMaps = Split(Trim(File.Load(sDir &/ "smaps_rollup")), "\n")
ProcessMemory = 0
For Each sMap In aMaps
If sMap Begins "Pss:" Then
sMap = LTrim(Mid$(sMap, 5))
iPos = InStr(sMap, " ")
ProcessMemory = CInt(Left(sMap, iPos - 1)) * 1024
Break
Endif
Next
Try aMaps = Split(Trim(File.Load(sDir &/ "smaps_rollup")), "\n")
If aMaps Then
For Each sMap In aMaps
If sMap Begins "Pss:" Then
sMap = LTrim(Mid$(sMap, 5))
iPos = InStr(sMap, " ")
ProcessMemory = CInt(Left(sMap, iPos - 1)) * 1024
Break
Endif
Next
Endif
FDebugInfo.UpdateProcessInfo()