* Re: [RFA]: Convert the last FP opcode saved by FSAVE into a full opcode [not found] <200102081828.NAA25535@indy.delorie.com> @ 2001-02-09 5:27 ` Mark Kettenis 2001-02-09 6:58 ` Eli Zaretskii 2001-02-13 13:55 ` Andrew Cagney 0 siblings, 2 replies; 3+ messages in thread From: Mark Kettenis @ 2001-02-09 5:27 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches Eli Zaretskii <eliz@delorie.com> writes: > This patch restores the 5 bits of the last FP opcode which are not > delivered by FSAVE/FXSAVE. This shows the full opcode in "info > float", and may be used to display the opcode as a mnemonic, or look > it up in a list of instructions. Hmm, right now, in i387-tdep.c:i387_float_info() we have the following code: printf_filtered ("Opcode: %s\n", local_hex_string_custom (fop ? (fop | 0xd800) : 0, "04")); So I don't understand why you're missing those bits in the output of "info float". I guess that you want "p $fop" to print the full opcode too (without the missing bits). Back when I wrote the code I deliberately chose to let GDB's registers contain the raw register contents, and let the "info float" command interpret those things. That's why I didn't include those bits. I'm also somewhat concerned about consistency between the various x86 targets. If we apply your patch, targets that don't use the functions from i387-nat.c still won't include the extra bits. That said, I'm open to discussion. If other x86 maintainers prefer $fop to contain the full opcode your change would in principle be fine with me. But even then, there still might be something wrong with your patch. On UNIX, the kernel typically returns a dummy FSAVE/FXSAVE state if the program didn't use the FPU (yet), where the opcode is all zeroes. In that case I don't think that we want to add the 0xd800. Mark ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA]: Convert the last FP opcode saved by FSAVE into a full opcode 2001-02-09 5:27 ` [RFA]: Convert the last FP opcode saved by FSAVE into a full opcode Mark Kettenis @ 2001-02-09 6:58 ` Eli Zaretskii 2001-02-13 13:55 ` Andrew Cagney 1 sibling, 0 replies; 3+ messages in thread From: Eli Zaretskii @ 2001-02-09 6:58 UTC (permalink / raw) To: kettenis; +Cc: gdb-patches > From: Mark Kettenis <kettenis@wins.uva.nl> > Date: 09 Feb 2001 14:27:02 +0100 > > Hmm, right now, in i387-tdep.c:i387_float_info() we have the following > code: > > printf_filtered ("Opcode: %s\n", > local_hex_string_custom (fop ? (fop | 0xd800) : 0, "04")); > > So I don't understand why you're missing those bits in the output of > "info float". I guess that you want "p $fop" to print the full opcode > too (without the missing bits). That's one reason, yes. Also, what about the platforms/configurations which don't use CLI? Do they all go through i387_float_info and printf_filtered? > I'm also somewhat concerned > about consistency between the various x86 targets. If we apply your > patch, targets that don't use the functions from i387-nat.c still > won't include the extra bits. We could fix those targets as well, can't we? > That said, I'm open to discussion. If other x86 maintainers prefer $fop to > contain the full opcode your change would in principle be fine with > me. Yes, please speak up your minds. > But even then, there still might be something wrong with your > patch. On UNIX, the kernel typically returns a dummy FSAVE/FXSAVE > state if the program didn't use the FPU (yet), where the opcode is all > zeroes. In that case I don't think that we want to add the 0xd800. I think my patch explicitly guards agains this. Here's the relevant snippet: + if (val) + val |= 0xd800; In other words, if the opcode is zero, it is left unaltered, exactly like in i387-tdep.c. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA]: Convert the last FP opcode saved by FSAVE into a full opcode 2001-02-09 5:27 ` [RFA]: Convert the last FP opcode saved by FSAVE into a full opcode Mark Kettenis 2001-02-09 6:58 ` Eli Zaretskii @ 2001-02-13 13:55 ` Andrew Cagney 1 sibling, 0 replies; 3+ messages in thread From: Andrew Cagney @ 2001-02-13 13:55 UTC (permalink / raw) To: Mark Kettenis; +Cc: Eli Zaretskii, gdb-patches > So I don't understand why you're missing those bits in the output of > "info float". I guess that you want "p $fop" to print the full opcode > too (without the missing bits). Back when I wrote the code I > deliberately chose to let GDB's registers contain the raw register > contents, and let the "info float" command interpret those things. > That's why I didn't include those bits. I'm also somewhat concerned > about consistency between the various x86 targets. If we apply your > patch, targets that don't use the functions from i387-nat.c still > won't include the extra bits. This, for the moment, is probably the best compromise. The register buffer should contain the raw and not the cooked/pseudo information. Instead that information should be constructed when needed. In theory, the info_registers() function should be implemented using some sort of read register from frame function. Unfortunatly, the current interfaces are not advanced enough to accomodate this. See the TODO file for some bad ascii art that explains the problem a little. Andrew ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-02-13 13:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <200102081828.NAA25535@indy.delorie.com>
2001-02-09 5:27 ` [RFA]: Convert the last FP opcode saved by FSAVE into a full opcode Mark Kettenis
2001-02-09 6:58 ` Eli Zaretskii
2001-02-13 13:55 ` Andrew Cagney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox