I have Ubuntu 22.04 (64bit) running as Guest OS in VirtualBox in my Host Win10 (also 64bit).
In Ubuntu (guest) I have the following command running:
gdbserver localhost:9999 ./application
And then in Win10 (host) I try to connect using gdb, from Mingw64:
(gdb) target remote 192.168.0.24:9999
But I encounter the following error:
warning: Architecture rejected target-supplied description
Reading <ubuntu path to folder>/application from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
of GDB. Attempting to continue with the default i386:x86-64 settings.
warning: Architecture of file not recognized.
Reading <ubuntu path to folder>/application from remote target...
warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
of GDB. Attempting to continue with the default i386:x86-64 settings.
Reading symbols from target: <ubuntu path to folder>/application...
Remote register badly formatted: T0506:0000000000000000;07:80e4ffffff7f0000;10:b032fef7ff7f0000;thread:p35e0.35e0;core:0;
here: 00000000;07:80e4ffffff7f0000;10:b032fef7ff7f0000;thread:p35e0.35e0;core:0;
Both are the same architecture, so I don't understand what is going on.
The important line in the output is:
A handler for the OS ABI "GNU/Linux" is not built into this configuration of GDB. Attempting to continue with the default i386:x86-64 settings.
This is telling you that the version of GDB you are running on the Windows host was built without support for debugging GNU/Linux targets.
This is probably why you also get this warning:
warning: Architecture rejected target-supplied description
which is GDB saying it doesn't understand the target description that the remote sent through.
As a result of rejecting the target description, GDB doesn't know the correct size for the architecture registers, which, I suspect is why you run into the error:
Remote register badly formatted: T0506:0000000000000000;07:80e4ffffff7f0000;10:b032fef7ff7f0000;thread:p35e0.35e0;core:0;
here: 00000000;07:80e4ffffff7f0000;10:b032fef7ff7f0000;thread:p35e0.35e0;core:0;
Notice the here:
line starts with 00000000;07...
this is halfway through the first register in the T
packet, i.e. the remote sent 8-bytes, but GDB was expecting only 4-bytes for that register.
I suspect the solution to all your problems is to try and either install, or build yourself, a version of GDB that supports all targets, this should then include GNU/Linux support, and everything should work.