I have started again to work on pic32 (mipsel-embedded) target and found an issue in the Dwarf Debug Info:
(Please also refer to this old discussion on the problem: http://lists.freepascal.org/fpc-devel/2013-July/032447.html )
The problem is that .long should be replaced with .4byte for debug symbols to be correctly interpreted on mips. I manually replaced all .long with .4bytes in system.s and can now do symbolic debugging of the startup code
There wrong entries always follow the pattern that they include an offset the the varname:
Example:
# Symbol THREADID
.long U_$SYSTEM_$$_THREADID+4
--> wrong, offset is "+4"
# Symbol UTF8COMPARELOCALE
.4byte U_$SYSTEM_$$_UTF8COMPARELOCALE
--> no offset, correct
Can anybody help?
Michael
# Symbol UTF8COMPARELOCALE
.uleb128 3
.ascii "UTF8COMPARELOCALE\000"
.byte 1
.byte 5
.byte 3
.4byte U_$SYSTEM_$$_UTF8COMPARELOCALE
.4byte DBG_$SYSTEM_$$_WORD
# Symbol THREADID
.uleb128 3
.ascii "THREADID\000"
.byte 1
.byte 5
.byte 3
.long U_$SYSTEM_$$_THREADID+4
.4byte DBG_$SYSTEM_$$_LONGINT
# Symbol ERROUTPUT
.uleb128 3
.ascii "ERROUTPUT\000"
.byte 1
.byte 5
.byte 3
.long U_$SYSTEM_$$_ERROUTPUT+4
.4byte DBG_$SYSTEM_$$_TEXT
