This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[RFC]: export write_register_gen
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [RFC]: export write_register_gen
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Wed, 26 Apr 2000 17:27:04 -0700
- Organization: Cygnus Solutions
The module findvar.c has at least three different interfaces
for accessing GDB's internal cache of register values:
CORE_ADDR read_register (int regno);
void write_register (int regno, LONGEST val);
void read_register_bytes (int inregbyte, char *myaddr, int inlen);
void write_register_bytes (int inregbyte, char *myaddr, int inlen);
void read_register_gen (int regno, char *myaddr);
static void write_register_gen (int regno, char *myaddr);
If you're dealing with a host LONGEST or CORE_ADDR,
then the preferred interface is read_register/write_register.
However if you're dealing with a buffer of bytes in target
byte order, you would use one of the other two. And by far
the easiest to use is [read/write]_register_gen. You would
only need to use [read/write]_register_bytes if the stream
of bytes you have might cross the boundary between two registers
(or start in the middle of one).
Yet write_register_gen is declared static. I thought I was
going to need it, so I wanted to export it. It turns out that
I don't need it, but I still think it should be public.
Thoughts?
Michael