iansjack wrote:
It just works!
TBH, I don't see the need to use the disassemble command. I have the source of code I wrote and/or I use objdump to produce a source listing.
But you said:
iansjack wrote:
the qemu/gdb combination works just fine, using qemu-x86_64, for instruction- or source-level debugging
What is "instruction level debugging" if not viewing the individual instructions (which doesn't "just work"). Also see the post at the head of this topic, by Je06. It doesn't just work for them, either, and I get the same issue, unless I explicitly set architecture to "i386:x86-64" before connecting.
iansjack wrote:
It's always possible that the gdb you use wasn't compiled with 32-bit support.
As I already said, it works fine for debugging 16-bit code, 32-bit code and 64-bit code. But for 16/32 bit code, it only works if using qemu-i386 and not qemu-x86_64.
iansjack wrote:
One other possible difference is that the code I am debugging is an elf file.
I have debugged 32-bit and 64-bit ELF files no worries, except for the limitation already discussed.
Octocontrabass wrote:
... the QEMU manual explains how to use GDB to debug real-mode code
Yes, it says:
"Use set architecture i8086 to dump 16 bit code. Then use x/10i $cs*16+$eip to dump the code at the PC position."
But as I said earlier (also see the gdb output I included to demonstrate it), "set architecture i8086" doesn't allow dumping 16-bit code when using qemu-x86_64; it continues to dump code as if it were long mode code. It works fine with qemu-i386.