Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2016-05

.long values in DWARF Symbols

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Ring

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

Reply by email

Florian Klämpfl
to Michael Ring
Michael Ring wrote 29 lines
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?

Please try with r33782.

Reply by email

Michael Ring
to Florian Klämpfl

Looking very good, I could load and debug a small app with a rtl built with -gw2

Thank you very much for the fix!

I have now reduced the filesize of the embedded-units so that they should be small enough to be included in fpc:

-rw-r--r-- 1 ring staff 33568 22 Mai 17:55 pic32mx1x0fxxxb.pp -rw-r--r-- 1 ring staff 33614 22 Mai 17:55 pic32mx1x0fxxxc.pp -rw-r--r-- 1 ring staff 33719 22 Mai 17:55 pic32mx1x0fxxxd.pp -rw-r--r-- 1 ring staff 40189 22 Mai 17:55 pic32mx1x0fxxxh.pp -rw-r--r-- 1 ring staff 40325 22 Mai 17:55 pic32mx1x0fxxxl.pp -rw-r--r-- 1 ring staff 39039 22 Mai 17:55 pic32mx2x0fxxxb.pp -rw-r--r-- 1 ring staff 39085 22 Mai 17:55 pic32mx2x0fxxxc.pp -rw-r--r-- 1 ring staff 39085 22 Mai 17:55 pic32mx2x0fxxxd.pp -rw-r--r-- 1 ring staff 45550 22 Mai 17:55 pic32mx2x0fxxxh.pp -rw-r--r-- 1 ring staff 45686 22 Mai 17:55 pic32mx2x0fxxxl.pp

So I will have something to play with when traveling to Maker Faire in Hannover this weekend ;-)

Michael

Florian Klämpfl wrote 35 lines
Am 23.05.2016 um 17:51 schrieb Michael Ring: > 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? Please try with r33782. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email