Hi Fredrik, > > Notice the different BFD target, `elf32-tradlittlemips-freebsd'. You're > > supposed to be able to override it with `set gnutarget', but that doesn't > > seem to impress GDB, e.g.: > > > > (gdb) show gnutarget > > The current BFD target is "auto". > > (gdb) set gnutarget elf32-tradlittlemips > > (gdb) show gnutarget > > The current BFD target is "elf32-tradlittlemips". > > (gdb) info files > > Local core dump file: > > `/home/mjr/src/kcore', file type elf32-tradlittlemips-freebsd. > > 0xffffffffc0000000 - 0xfffffffffff94000 is load1 > > 0xffffffff80000000 - 0xffffffff90000000 is load2 > > (gdb) > > > > I'll see if I can track down what is going on here. > > Thank you for taking a closer look at GDB! You are welcome, however it's my duty as a MIPS/GDB port maintainer. > However, I don't observe the > "freebsd" BFD target with a cross-GDB version 8.1 (via v9fs in this case): The likely cause is my development GDB builds use `--enable-targets=all' and your GDB configuration probably does not include secondary targets. Still I find it wrong that an incorrect BFD target is chosen, and then that an override does not work either (and especially that accessing memory in a core file seems completely broken in recent GDB versions). > By the way, what about presenting misaligned SQ instructions like > > # mipsel-linux-gdb -q busybox > Reading symbols from busybox...(no debugging symbols found)...done. > (gdb) set architecture mips:5900 > The target architecture is assumed to be mips:5900 > (gdb) x /i 0x4036b0 > 0x4036b0: sq v1,-6085(zero) > > as RDHWR, which is the interpretation with Linux? Hmm, I have mixed feelings about it as RDHWR is not an R5900 instruction. Likewise we don't disassemble it, and neither we do LL, SC, SYNC, etc. say with `mips:3000' even though Linux will emulate them. I feel this kind of stuff does not belong to instruction aliases either (compare `objdump' disassembly of any serious program with and without `-M no-aliases'). I do recognize value for users here though, so perhaps an extra `-M' option would be due here, such as `-M linux-emulation' or suchlike, to cover all emulated instructions. I'll think about it. Please file an enhancement request in sourceware.org Bugzilla if it's something you are keen having (feel free to cc me; I'm <macro@xxxxxxxxxxxxxx> there). Maciej