Display an accurate error message if the compiler crashes.

[DEVELOPMENT ENVIRONMENT]
* NEW: Display an accurate error message if the compiler crashes.
This commit is contained in:
gambas 2021-02-04 04:06:10 +01:00
parent 7bcdef0ad5
commit cad1af706f
4 changed files with 27 additions and 36 deletions

View file

@ -31,7 +31,7 @@ Component=gb.signal
Description="Integrated Development Environment for Gambas"
Authors="Benoît Minisini\nFabien Bodard\nCharlie Reinl\nJosé Luis Redrejo\nRobert Rowe\nTobias Boege"
Arguments=[["-L"],["-t","/home/benoit/gambas/git/master/app/src/gambas3"],["--help"]]
Environment="GB_GUI=gb.qt5\n GTK_DEBUG=interactive"
Environment="GB_GUI=gb.gtk3\n GTK_DEBUG=interactive"
TabSize=2
Translate=1
Language=en

View file

@ -2543,6 +2543,12 @@ Public Function Compile(Optional bAll As Boolean, Optional bNoDebug As Boolean,
Shell sExec Wait
Endif
If Process.LastState = Process.Crashed Or If Process.LastValue > 128 Then
UnlockIt()
Message.Error(("<h3>The compiler has crashed!</h3>\nPlease report it to the Gambas bugtracker at:\n\n<u>https://gambaswiki.org/bugtracker</u>\n\nDo not forget to provide the full project so that the crash can be reproduced."))
Return True
Endif
bGotError = Process.LastValue
sOutput = Trim(File.Load(OUTPUT_FILE))

View file

@ -15,33 +15,19 @@ Public (Highlight) As String
Public RichText As String
Public Location As String
'Private $sWhere As String
Public Sub InitFromLine(sLine As String) As Boolean
' Public Sub GetLocation() As String
'
' Dim hFile As Object
' Dim sPath As String
'
' sPath = Project.Dir &/ Path
'
' If Not Project.IsSourcePath(sPath) Then Return
' If $sWhere Then Return $sWhere
'
' $sWhere = "-"
' Try hFile = Project.LoadFile(sPath)
' If hFile Then
' If hFile Is FEditor Or If hFile Is FTextEditor Then
' $sWhere = hFile.GetProcAt({Line})
' If Not $sWhere Then $sWhere = ("(Declarations)")
' Else If hFile Is FForm Then
' $sWhere = hFile.GetLocation({Line})
' Endif
' Endif
' Return $sWhere
'
' Catch
'
' $sWhere = "?"
' Return $sWhere
'
' End
Dim aResult As String[]
aResult = Split(sLine, ":")
{Line} = CInt(aResult[0])
Pos = CInt(aResult[1])
Bytes = CInt(aResult[2])
Length = CInt(aResult[3])
Catch
Return True
End

View file

@ -1360,7 +1360,6 @@ Public Sub timFillList_Timer()
Dim sLine As String
Dim hResult As CSearchResult
Dim aResult As String[]
Dim hFile As Object
Dim fTimer As Float
Dim iPos As Integer
@ -1428,13 +1427,13 @@ Public Sub timFillList_Timer()
If Not hFile Then Continue
hResult = New CSearchResult
aResult = Split(sLine, ":")
hResult.Path = $sTaskPath
hResult.File = hFile.Name
hResult.Line = CInt(aResult[0])
hResult.Pos = CInt(aResult[1])
hResult.Bytes = CInt(aResult[2])
hResult.Length = CInt(aResult[3])
If hResult.InitFromLine(sLine) Then
Error "gambas3: warning: incorrect search result: "; sLine
Continue
Endif
If hFile.SetPosition(hResult, True) Then Continue