This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
write_register_bytes() confusion
- From: "Aaron J. Grier" <aaron at frye dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 1 Jul 2002 12:20:39 -0700
- Subject: write_register_bytes() confusion
I'm in the middle of bringing BDM for m68k support into current gdb, and
while I have fixed the most blatant calling convention changes (pid
changing to pid_t, etc) write_register_bytes() in regcache has got me
horribly confused.
not to mention all this m68k craziness happening elsewhere. ;)
in v1.61 of valops.c (which appears to be current) there is the snippet:
write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
VALUE_CONTENTS (fromval), TYPE_LENGTH (type));
I'm writing a register -- it seems in my case this should be:
write_register_bytes (VALUE_REGNO (toval), VALUE_CONTENTS (fromval), 1);
the 1 of course is machine dependent
what I'm seeing is the register number getting completely thrashed on
the way through.
yet all calls to write_register_bytes are using VALUE_ADDRESS?
insane. I'm starting to think I need to back off -current and just
stick with gdb-5.0...
--
Aaron J. Grier | Frye Electronics, Tigard, OR | aaron@frye.com