freemint / m68k-atari-mint-binutils-gdb

Fork of sourceware's binutils-gdb with support for the m68k-atari-mint target.
https://github.com/freemint/m68k-atari-mint-binutils-gdb/wiki
GNU General Public License v2.0
10 stars 4 forks source link

FPU not seen on ColdFire? #10

Open mfro0 opened 7 months ago

mfro0 commented 7 months ago

I have played a little with gdb on my Firebee and it seems to be working well (thanks to all of you make that possible).

Except one thing: it appears the ColdFire FPU ist not recognized:

(gdb) info float
fp0            <unavailable>
fp1            <unavailable>
fp2            <unavailable>
fp3            <unavailable>
fp4            <unavailable>
fp5            <unavailable>
fp6            <unavailable>
fp7            <unavailable>

(gdb) info all-registers
d0             0x1769f7c           24551292
d1             0x1769fa0           24551328
d2             0x1769fac           24551340
d3             0x3b                59
d4             0x2c                44
d5             0x3d                61
d6             0xffffffff          -1
d7             0x0                 0
a0             0x0                 0x0
a1             0x1769fac           0x1769fac
a2             0x179c077           0x179c077
a3             0x4cf8f38           0x4cf8f38
a4             0x3e                0x3e
a5             0x1769fac           0x1769fac
fp             0x4d08ed8           0x4d08ed8
sp             0x4d08ec4           0x4d08ec4
ps             0x14                [ Z X ]
pc             0x4cdc27c           0x4cdc27c <main+4>
fp0            <unavailable>
fp1            <unavailable>
fp2            <unavailable>
fp3            <unavailable>
fp4            <unavailable>
fp5            <unavailable>
fp6            <unavailable>
fp7            <unavailable>
fpcontrol      <unavailable>
fpstatus       <unavailable>
fpiaddr        <unavailable>
(gdb) 

Is this just a configuration problem or something more involved?

vinriviere commented 7 months ago

Ahem, IIRC Ptrace() isn't fully implemented in the FreeMiNT kernel, regarding to FPU registers. This is still to be done. EDIT: Wrong assumption.

vinriviere commented 7 months ago

Ah it's properly implemented in the FreeMiNT kernel. https://github.com/freemint/freemint/blob/56defdeda741b4283701504f73ffb65e74e05340/sys/ptrace.c#L514-L527 https://github.com/freemint/freemint/blob/56defdeda741b4283701504f73ffb65e74e05340/sys/arch/process_reg.c#L141-L150

Even if I'm unsure if those p->ctxt[SYSCALL].fctrl values are properly set on ColdFire.

Anyway, a call to ptrace() with PT_GETFPREGS is missing in GDB: https://github.com/vinriviere/m68k-atari-mint-binutils-gdb/blob/e6591b01a2c24dfa6e861a31f6ef9e2c7749216a/gdb/mintelf-nat.c#L72-L88