I was informed that GDB recently broke for tracing 32bit applications in 64bit debugger on 64bit kernel. There are at least 3 issues over here: 1. mknative does not include i386 files for x86_64 mode _initialize_i386nbsd_tdep() and associated i386 GDB files are not includes in the build 2. i386 C files are not buildable for amd64 environment as they pull headers from machine/ and that is amd64/, not i386/. If we manually include i386/ headers, they still pick machine/ files. Including these files on amd64/ certainly never worked. And passing types like void* cannot work as-is anyway. 3. There is not supported a translation between amd64 host registers and i386 guest. I've addressed locally 1 and 2, with the following scratch patch: http://netbsd.org/~kamil/patch-00130-32bit-tracee-64bit-gdb.txt For 3, I'm still unaware where is the root cause of invalid translation between 64 and 32bit registers. I've checked NetBSD 8.1 and its base GDB and this mode of tracing wasn't supported either.. going backward in history predating 8.0 is not promising at all due to a large number of ptrace(2) issues that were addressed. The conclusion is that there are several issues before getting it to work and it doesn't look like any recent fallout. Once we will cleanly handle 32bit files for 64bit debuggers in GDB (patch mknative) and address 1. + 2. problems, I will resume this process of investigation.
Attachment:
signature.asc
Description: OpenPGP digital signature