bebbo / bgdbserver

Bebbo's gdbserver - remote debugging via TCP for the Amiga with m68k-amigaos-gdb
GNU General Public License v3.0
13 stars 0 forks source link

Target reported unsupported offsets #4

Open dirkwhoffmann opened 2 years ago

dirkwhoffmann commented 2 years ago

Hi Stefan,

I did some experiments with bgdbserver and got an error message which I don’t understand. This is what I did:

bgdb

GNU gdb (GDB) 10.0.50.211207-144216-git
...
This GDB was configured as "--host=x86_64-apple-darwin21.1.0 --target=m68k-amigaos".
...
Reading symbols from fibo.exe...
(gdb) target remote :8080
Remote debugging using :8080
warning: Target reported unsupported offsets: Text=00c21348;Data=00c23f78;Bss=00c240f8
0x00c21348 in ?? ()

Is it a bug or am I doing something fundamentally wrong?

bebbo commented 2 years ago

that seems still ok. what about using now:

b main
c

and then maybe

lay split
dirkwhoffmann commented 2 years ago

what about using...

Yes, that worked. I can step through my program. Awesome!

Bildschirmfoto 2021-12-22 um 13 46 15

I've noticed that it reports a wrong contents for fibo[1], most likely because fibo is a global variable. On your website you're stating "local variables and parameters are working now".

Indeed, all local variables are reported correctly:

Bildschirmfoto 2021-12-22 um 13 49 15

Background: I was trying to add a GDB server to my Amiga emulator (vAmiga) which turned out to be not so easy. At first, I canceled the project, but since I don't like failure, I am thinking of giving it another try. By using netcat I should be able to display the packages that are exchanged by m68k-amigaos-gdb on the Mac side and bgdbserver on the FS-UAE side. If I manage to mimic what your bgdserver is doing, it should be possible to connect m68k-amigaos-gdb directly to vAmiga.

bebbo commented 2 years ago

AFAIK: there are versions of fs-uae and winuae providing gdb support.

dirkwhoffmann commented 2 years ago

AFAIK: there are versions of fs-uae and winuae providing gdb support.

Yes. The original plan was to make vAmiga compatible with the VSC plugin written by @prb28 in a similar way to what has already been achieved with UAE and FS-UAE. The project progress is documented in this thread: https://github.com/dirkwhoffmann/vAmiga/issues/618

At some point I put the project on hold. I stumbled over so many obstacles that I got the feeling that it will cost too much time at the end. However, I am still hoping that the integration will be achieved eventually. Right now, I think it's best to move forward in small steps. For me, the most promising step at the moment seems to be to make vAmiga mimic what your bgdbserver is doing.

dirkwhoffmann commented 2 years ago

Quick question: This is part of my recorded log (exchanged between m68k-amigaos-gdband bgdbserver):

+$c#63
+$T051:00c21472;#22
+$p11#d2
+$00c21472#c3

I understand that in package +$T051:xxxxxxxx;#yy, xxxxxxxx is the program counter, 05 is SIGTRAP, and 1 is the register number. Shouldn't it be 11 (decimal 17) instead of 1? I guess you're transferring the PC to avoid the p11 request that is coming immediately afterwards.

BTW, a lot of conversation with vAmiga is already working. I can connect your m68-amigaos-gdb directly to my emulator and step through my test program (the values of variables are still wrong yet):

Bildschirmfoto 2021-12-23 um 18 27 32

Emulator side:

Bildschirmfoto 2021-12-23 um 18 42 03