* [commit] gdb_byte regcache.[hc]
@ 2005-05-19 17:07 Andrew Cagney
2005-05-19 18:56 ` Daniel Jacobowitz
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cagney @ 2005-05-19 17:07 UTC (permalink / raw)
To: gdb-patches
little by little.
These still contains void*s where an object, and not a buffer, is being
passed.
I'll look in defs.h next, it contains some stray void* and char* parameters.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [commit] gdb_byte regcache.[hc]
2005-05-19 17:07 [commit] gdb_byte regcache.[hc] Andrew Cagney
@ 2005-05-19 18:56 ` Daniel Jacobowitz
2005-05-19 19:13 ` Andrew Cagney
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2005-05-19 18:56 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Thu, May 19, 2005 at 12:37:05PM -0400, Andrew Cagney wrote:
> little by little.
>
> These still contains void*s where an object, and not a buffer, is being
> passed.
>
> I'll look in defs.h next, it contains some stray void* and char* parameters.
Didn't attach the patch?
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [commit] gdb_byte regcache.[hc]
2005-05-19 18:56 ` Daniel Jacobowitz
@ 2005-05-19 19:13 ` Andrew Cagney
2005-06-10 22:12 ` Mark Kettenis
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cagney @ 2005-05-19 19:13 UTC (permalink / raw)
To: gdb-patches; +Cc: Daniel Jacobowitz
[-- Attachment #1: Type: text/plain, Size: 319 bytes --]
Daniel Jacobowitz wrote:
> On Thu, May 19, 2005 at 12:37:05PM -0400, Andrew Cagney wrote:
>
>>little by little.
>>
>>These still contains void*s where an object, and not a buffer, is being
>>passed.
>>
>>I'll look in defs.h next, it contains some stray void* and char* parameters.
>
>
> Didn't attach the patch?
>
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 18409 bytes --]
2005-05-19 Andrew Cagney <cagney@gnu.org>
* regcache.h (regcache_raw_read, regcache_raw_write)
(regcache_raw_read_part, regcache_raw_write_part)
(regcache_cooked_read_part, regcache_cooked_write_part)
(regcache_cooked_read, regcache_cooked_write)
(regcache_raw_supply, regcache_raw_collect)
(regcache_cooked_read_ftype, regcache_save, regcache_restore)
(deprecated_read_register_gen, deprecated_write_register_gen)
(deprecated_read_register_bytes, deprecated_write_register_bytes)
(deprecated_grub_regcache_for_registers): Use gdb_byte for byte
buffer parameters.
* ia64-tdep.c (ia64_extract_return_value): Update.
* frame.c (do_frame_register_read): Update.
* regcache.c (deprecated_grub_regcache_for_registers)
(struct regcache, regcache_save, regcache_restore, regcache_cpy)
(do_cooked_read, regcache_xmalloc, register_buffer)
(deprecated_read_register_bytes, regcache_raw_read)
(regcache_raw_read_signed, regcache_raw_read_unsigned)
(deprecated_read_register_gen, regcache_cooked_read)
(regcache_cooked_read_signed, regcache_cooked_read_unsigned)
(deprecated_write_register_gen, regcache_cooked_write)
(deprecated_write_register_bytes, regcache_raw_read_part)
(regcache_raw_write_part, regcache_cooked_read_part)
(regcache_cooked_write_part, read_register, regcache_raw_supply):
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.207
diff -p -u -r1.207 frame.c
--- frame.c 24 Feb 2005 13:51:31 -0000 1.207
+++ frame.c 19 May 2005 16:36:04 -0000
@@ -491,7 +491,7 @@ get_frame_func (struct frame_info *fi)
}
static int
-do_frame_register_read (void *src, int regnum, void *buf)
+do_frame_register_read (void *src, int regnum, gdb_byte *buf)
{
frame_register_read (src, regnum, buf);
return 1;
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.131
diff -p -u -r1.131 ia64-tdep.c
--- ia64-tdep.c 1 May 2005 19:58:54 -0000 1.131
+++ ia64-tdep.c 19 May 2005 16:36:04 -0000
@@ -88,7 +88,6 @@ static gdbarch_register_name_ftype ia64_
static gdbarch_register_type_ftype ia64_register_type;
static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc;
static gdbarch_skip_prologue_ftype ia64_skip_prologue;
-static gdbarch_extract_return_value_ftype ia64_extract_return_value;
static struct type *is_float_or_hfa_type (struct type *t);
static CORE_ADDR ia64_find_global_pointer (CORE_ADDR faddr);
@@ -2694,7 +2693,8 @@ ia64_use_struct_convention (int gcc_p, s
}
void
-ia64_extract_return_value (struct type *type, struct regcache *regcache, void *valbuf)
+ia64_extract_return_value (struct type *type, struct regcache *regcache,
+ gdb_byte *valbuf)
{
struct type *float_elt_type;
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.135
diff -p -u -r1.135 regcache.c
--- regcache.c 9 May 2005 21:20:34 -0000 1.135
+++ regcache.c 19 May 2005 16:36:05 -0000
@@ -185,8 +185,8 @@ struct regcache
/* The register buffers. A read-only register cache can hold the
full [0 .. NUM_REGS + NUM_PSEUDO_REGS) while a read/write
register cache can only hold [0 .. NUM_REGS). */
- char *registers;
- char *register_valid_p;
+ gdb_byte *registers;
+ gdb_byte *register_valid_p;
/* Is this a read-only cache? A read-only cache is used for saving
the target's register state (e.g, across an inferior function
call or just before forcing a function return). A read-only
@@ -206,9 +206,9 @@ regcache_xmalloc (struct gdbarch *gdbarc
regcache = XMALLOC (struct regcache);
regcache->descr = descr;
regcache->registers
- = XCALLOC (descr->sizeof_raw_registers, char);
+ = XCALLOC (descr->sizeof_raw_registers, gdb_byte);
regcache->register_valid_p
- = XCALLOC (descr->sizeof_raw_register_valid_p, char);
+ = XCALLOC (descr->sizeof_raw_register_valid_p, gdb_byte);
regcache->readonly_p = 1;
return regcache;
}
@@ -245,7 +245,7 @@ get_regcache_arch (const struct regcache
/* Return a pointer to register REGNUM's buffer cache. */
-static char *
+static gdb_byte *
register_buffer (const struct regcache *regcache, int regnum)
{
return regcache->registers + regcache->descr->register_offset[regnum];
@@ -256,7 +256,7 @@ regcache_save (struct regcache *dst, reg
void *src)
{
struct gdbarch *gdbarch = dst->descr->gdbarch;
- char buf[MAX_REGISTER_SIZE];
+ gdb_byte buf[MAX_REGISTER_SIZE];
int regnum;
/* The DST should be `read-only', if it wasn't then the save would
end up trying to write the register values back out to the
@@ -287,10 +287,10 @@ regcache_save (struct regcache *dst, reg
void
regcache_restore (struct regcache *dst,
regcache_cooked_read_ftype *cooked_read,
- void *src)
+ void *cooked_read_context)
{
struct gdbarch *gdbarch = dst->descr->gdbarch;
- char buf[MAX_REGISTER_SIZE];
+ gdb_byte buf[MAX_REGISTER_SIZE];
int regnum;
/* The dst had better not be read-only. If it is, the `restore'
doesn't make much sense. */
@@ -303,7 +303,7 @@ regcache_restore (struct regcache *dst,
{
if (gdbarch_register_reggroup_p (gdbarch, regnum, restore_reggroup))
{
- int valid = cooked_read (src, regnum, buf);
+ int valid = cooked_read (cooked_read_context, regnum, buf);
if (valid)
regcache_cooked_write (dst, regnum, buf);
}
@@ -311,7 +311,7 @@ regcache_restore (struct regcache *dst,
}
static int
-do_cooked_read (void *src, int regnum, void *buf)
+do_cooked_read (void *src, int regnum, gdb_byte *buf)
{
struct regcache *regcache = src;
if (!regcache->register_valid_p[regnum] && regcache->readonly_p)
@@ -328,7 +328,7 @@ void
regcache_cpy (struct regcache *dst, struct regcache *src)
{
int i;
- char *buf;
+ gdb_byte *buf;
gdb_assert (src != NULL && dst != NULL);
gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
gdb_assert (src != dst);
@@ -384,7 +384,7 @@ regcache_valid_p (struct regcache *regca
return regcache->register_valid_p[regnum];
}
-char *
+gdb_byte *
deprecated_grub_regcache_for_registers (struct regcache *regcache)
{
return regcache->registers;
@@ -513,11 +513,11 @@ deprecated_registers_fetched (void)
into memory at MYADDR. */
void
-deprecated_read_register_bytes (int in_start, char *in_buf, int in_len)
+deprecated_read_register_bytes (int in_start, gdb_byte *in_buf, int in_len)
{
int in_end = in_start + in_len;
int regnum;
- char reg_buf[MAX_REGISTER_SIZE];
+ gdb_byte reg_buf[MAX_REGISTER_SIZE];
/* See if we are trying to read bytes from out-of-date registers. If so,
update just those registers. */
@@ -570,7 +570,7 @@ deprecated_read_register_bytes (int in_s
}
void
-regcache_raw_read (struct regcache *regcache, int regnum, void *buf)
+regcache_raw_read (struct regcache *regcache, int regnum, gdb_byte *buf)
{
gdb_assert (regcache != NULL && buf != NULL);
gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
@@ -606,7 +606,7 @@ regcache_raw_read (struct regcache *regc
void
regcache_raw_read_signed (struct regcache *regcache, int regnum, LONGEST *val)
{
- char *buf;
+ gdb_byte *buf;
gdb_assert (regcache != NULL);
gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
buf = alloca (regcache->descr->sizeof_register[regnum]);
@@ -619,7 +619,7 @@ void
regcache_raw_read_unsigned (struct regcache *regcache, int regnum,
ULONGEST *val)
{
- char *buf;
+ gdb_byte *buf;
gdb_assert (regcache != NULL);
gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
buf = alloca (regcache->descr->sizeof_register[regnum]);
@@ -652,7 +652,7 @@ regcache_raw_write_unsigned (struct regc
}
void
-deprecated_read_register_gen (int regnum, char *buf)
+deprecated_read_register_gen (int regnum, gdb_byte *buf)
{
gdb_assert (current_regcache != NULL);
gdb_assert (current_regcache->descr->gdbarch == current_gdbarch);
@@ -660,7 +660,7 @@ deprecated_read_register_gen (int regnum
}
void
-regcache_cooked_read (struct regcache *regcache, int regnum, void *buf)
+regcache_cooked_read (struct regcache *regcache, int regnum, gdb_byte *buf)
{
gdb_assert (regnum >= 0);
gdb_assert (regnum < regcache->descr->nr_cooked_registers);
@@ -681,7 +681,7 @@ void
regcache_cooked_read_signed (struct regcache *regcache, int regnum,
LONGEST *val)
{
- char *buf;
+ gdb_byte *buf;
gdb_assert (regcache != NULL);
gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_cooked_registers);
buf = alloca (regcache->descr->sizeof_register[regnum]);
@@ -694,7 +694,7 @@ void
regcache_cooked_read_unsigned (struct regcache *regcache, int regnum,
ULONGEST *val)
{
- char *buf;
+ gdb_byte *buf;
gdb_assert (regcache != NULL);
gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_cooked_registers);
buf = alloca (regcache->descr->sizeof_register[regnum]);
@@ -728,7 +728,8 @@ regcache_cooked_write_unsigned (struct r
}
void
-regcache_raw_write (struct regcache *regcache, int regnum, const void *buf)
+regcache_raw_write (struct regcache *regcache, int regnum,
+ const gdb_byte *buf)
{
gdb_assert (regcache != NULL && buf != NULL);
gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
@@ -762,7 +763,7 @@ regcache_raw_write (struct regcache *reg
}
void
-deprecated_write_register_gen (int regnum, char *buf)
+deprecated_write_register_gen (int regnum, gdb_byte *buf)
{
gdb_assert (current_regcache != NULL);
gdb_assert (current_regcache->descr->gdbarch == current_gdbarch);
@@ -770,7 +771,8 @@ deprecated_write_register_gen (int regnu
}
void
-regcache_cooked_write (struct regcache *regcache, int regnum, const void *buf)
+regcache_cooked_write (struct regcache *regcache, int regnum,
+ const gdb_byte *buf)
{
gdb_assert (regnum >= 0);
gdb_assert (regnum < regcache->descr->nr_cooked_registers);
@@ -785,7 +787,7 @@ regcache_cooked_write (struct regcache *
into registers starting with the MYREGSTART'th byte of register data. */
void
-deprecated_write_register_bytes (int myregstart, char *myaddr, int inlen)
+deprecated_write_register_bytes (int myregstart, gdb_byte *myaddr, int inlen)
{
int myregend = myregstart + inlen;
int regnum;
@@ -815,7 +817,7 @@ deprecated_write_register_bytes (int myr
/* The register partially overlaps the range being written. */
else
{
- char regbuf[MAX_REGISTER_SIZE];
+ gdb_byte regbuf[MAX_REGISTER_SIZE];
/* What's the overlap between this register's bytes and
those the caller wants to write? */
int overlapstart = max (regstart, myregstart);
@@ -841,7 +843,10 @@ typedef void (regcache_write_ftype) (str
static void
regcache_xfer_part (struct regcache *regcache, int regnum,
int offset, int len, void *in, const void *out,
- regcache_read_ftype *read, regcache_write_ftype *write)
+ void (*read) (struct regcache *regcache, int regnum,
+ gdb_byte *buf),
+ void (*write) (struct regcache *regcache, int regnum,
+ const gdb_byte *buf))
{
struct regcache_descr *descr = regcache->descr;
gdb_byte reg[MAX_REGISTER_SIZE];
@@ -873,7 +878,7 @@ regcache_xfer_part (struct regcache *reg
void
regcache_raw_read_part (struct regcache *regcache, int regnum,
- int offset, int len, void *buf)
+ int offset, int len, gdb_byte *buf)
{
struct regcache_descr *descr = regcache->descr;
gdb_assert (regnum >= 0 && regnum < descr->nr_raw_registers);
@@ -883,7 +888,7 @@ regcache_raw_read_part (struct regcache
void
regcache_raw_write_part (struct regcache *regcache, int regnum,
- int offset, int len, const void *buf)
+ int offset, int len, const gdb_byte *buf)
{
struct regcache_descr *descr = regcache->descr;
gdb_assert (regnum >= 0 && regnum < descr->nr_raw_registers);
@@ -893,7 +898,7 @@ regcache_raw_write_part (struct regcache
void
regcache_cooked_read_part (struct regcache *regcache, int regnum,
- int offset, int len, void *buf)
+ int offset, int len, gdb_byte *buf)
{
struct regcache_descr *descr = regcache->descr;
gdb_assert (regnum >= 0 && regnum < descr->nr_cooked_registers);
@@ -903,7 +908,7 @@ regcache_cooked_read_part (struct regcac
void
regcache_cooked_write_part (struct regcache *regcache, int regnum,
- int offset, int len, const void *buf)
+ int offset, int len, const gdb_byte *buf)
{
struct regcache_descr *descr = regcache->descr;
gdb_assert (regnum >= 0 && regnum < descr->nr_cooked_registers);
@@ -935,7 +940,7 @@ deprecated_register_bytes (void)
ULONGEST
read_register (int regnum)
{
- char *buf = alloca (register_size (current_gdbarch, regnum));
+ gdb_byte *buf = alloca (register_size (current_gdbarch, regnum));
deprecated_read_register_gen (regnum, buf);
return (extract_unsigned_integer (buf, register_size (current_gdbarch, regnum)));
}
@@ -997,7 +1002,8 @@ write_register_pid (int regnum, CORE_ADD
/* Supply register REGNUM, whose contents are stored in BUF, to REGCACHE. */
void
-regcache_raw_supply (struct regcache *regcache, int regnum, const void *buf)
+regcache_raw_supply (struct regcache *regcache, int regnum,
+ const gdb_byte *buf)
{
void *regbuf;
size_t size;
@@ -1030,7 +1036,8 @@ regcache_raw_supply (struct regcache *re
/* Collect register REGNUM from REGCACHE and store its contents in BUF. */
void
-regcache_raw_collect (const struct regcache *regcache, int regnum, void *buf)
+regcache_raw_collect (const struct regcache *regcache, int regnum,
+ gdb_byte *buf)
{
const void *regbuf;
size_t size;
Index: regcache.h
===================================================================
RCS file: /cvs/src/src/gdb/regcache.h,v
retrieving revision 1.45
diff -p -u -r1.45 regcache.h
--- regcache.h 14 Nov 2004 01:11:07 -0000 1.45
+++ regcache.h 19 May 2005 16:36:05 -0000
@@ -39,9 +39,9 @@ extern struct gdbarch *get_regcache_arch
/* Transfer a raw register [0..NUM_REGS) between core-gdb and the
regcache. */
-void regcache_raw_read (struct regcache *regcache, int rawnum, void *buf);
+void regcache_raw_read (struct regcache *regcache, int rawnum, gdb_byte *buf);
void regcache_raw_write (struct regcache *regcache, int rawnum,
- const void *buf);
+ const gdb_byte *buf);
extern void regcache_raw_read_signed (struct regcache *regcache,
int regnum, LONGEST *val);
extern void regcache_raw_read_unsigned (struct regcache *regcache,
@@ -55,16 +55,17 @@ extern void regcache_raw_write_unsigned
write style operations. */
void regcache_raw_read_part (struct regcache *regcache, int regnum,
- int offset, int len, void *buf);
+ int offset, int len, gdb_byte *buf);
void regcache_raw_write_part (struct regcache *regcache, int regnum,
- int offset, int len, const void *buf);
+ int offset, int len, const gdb_byte *buf);
int regcache_valid_p (struct regcache *regcache, int regnum);
/* Transfer a cooked register [0..NUM_REGS+NUM_PSEUDO_REGS). */
-void regcache_cooked_read (struct regcache *regcache, int rawnum, void *buf);
+void regcache_cooked_read (struct regcache *regcache, int rawnum,
+ gdb_byte *buf);
void regcache_cooked_write (struct regcache *regcache, int rawnum,
- const void *buf);
+ const gdb_byte *buf);
/* NOTE: cagney/2002-08-13: At present GDB has no reliable mechanism
for indicating when a ``cooked'' register was constructed from
@@ -88,18 +89,18 @@ extern void regcache_cooked_write_unsign
write style operations. */
void regcache_cooked_read_part (struct regcache *regcache, int regnum,
- int offset, int len, void *buf);
+ int offset, int len, gdb_byte *buf);
void regcache_cooked_write_part (struct regcache *regcache, int regnum,
- int offset, int len, const void *buf);
+ int offset, int len, const gdb_byte *buf);
/* Transfer a raw register [0..NUM_REGS) between the regcache and the
target. These functions are called by the target in response to a
target_fetch_registers() or target_store_registers(). */
extern void regcache_raw_supply (struct regcache *regcache,
- int regnum, const void *buf);
+ int regnum, const gdb_byte *buf);
extern void regcache_raw_collect (const struct regcache *regcache,
- int regnum, void *buf);
+ int regnum, gdb_byte *buf);
/* The register's ``offset''.
@@ -136,14 +137,15 @@ extern int register_size (struct gdbarch
restore_reggroup respectively. COOKED_READ returns zero iff the
register's value can't be returned. */
-typedef int (regcache_cooked_read_ftype) (void *src, int regnum, void *buf);
+typedef int (regcache_cooked_read_ftype) (void *src, int regnum,
+ gdb_byte *buf);
extern void regcache_save (struct regcache *dst,
regcache_cooked_read_ftype *cooked_read,
- void *src);
+ void *cooked_read_context);
extern void regcache_restore (struct regcache *dst,
regcache_cooked_read_ftype *cooked_read,
- void *src);
+ void *cooked_read_context);
/* Copy/duplicate the contents of a register cache. By default, the
operation is pass-through. Writes to DST and reads from SRC will
@@ -173,12 +175,12 @@ extern void regcache_cpy_no_passthrough
method, there should already be a non-deprecated variant that is
parameterized with FRAME or REGCACHE. */
-extern char *deprecated_grub_regcache_for_registers (struct regcache *);
-extern void deprecated_read_register_gen (int regnum, char *myaddr);
-extern void deprecated_write_register_gen (int regnum, char *myaddr);
-extern void deprecated_read_register_bytes (int regbyte, char *myaddr,
+extern gdb_byte *deprecated_grub_regcache_for_registers (struct regcache *);
+extern void deprecated_read_register_gen (int regnum, gdb_byte *myaddr);
+extern void deprecated_write_register_gen (int regnum, gdb_byte *myaddr);
+extern void deprecated_read_register_bytes (int regbyte, gdb_byte *myaddr,
int len);
-extern void deprecated_write_register_bytes (int regbyte, char *myaddr,
+extern void deprecated_write_register_bytes (int regbyte, gdb_byte *myaddr,
int len);
/* NOTE: cagney/2002-11-05: This function has been superseeded by
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [commit] gdb_byte regcache.[hc]
2005-05-19 19:13 ` Andrew Cagney
@ 2005-06-10 22:12 ` Mark Kettenis
2005-06-11 1:43 ` Michael Snyder
2005-06-11 21:29 ` Mark Kettenis
0 siblings, 2 replies; 10+ messages in thread
From: Mark Kettenis @ 2005-06-10 22:12 UTC (permalink / raw)
To: cagney; +Cc: gdb-patches, drow
Date: Thu, 19 May 2005 13:24:08 -0400
From: Andrew Cagney <cagney@gnu.org>
2005-05-19 Andrew Cagney <cagney@gnu.org>
* regcache.h (regcache_raw_read, regcache_raw_write)
(regcache_raw_read_part, regcache_raw_write_part)
(regcache_cooked_read_part, regcache_cooked_write_part)
(regcache_cooked_read, regcache_cooked_write)
(regcache_raw_supply, regcache_raw_collect)
(regcache_cooked_read_ftype, regcache_save, regcache_restore)
(deprecated_read_register_gen, deprecated_write_register_gen)
(deprecated_read_register_bytes, deprecated_write_register_bytes)
(deprecated_grub_regcache_for_registers): Use gdb_byte for byte
buffer parameters.
* ia64-tdep.c (ia64_extract_return_value): Update.
* frame.c (do_frame_register_read): Update.
* regcache.c (deprecated_grub_regcache_for_registers)
(struct regcache, regcache_save, regcache_restore, regcache_cpy)
(do_cooked_read, regcache_xmalloc, register_buffer)
(deprecated_read_register_bytes, regcache_raw_read)
(regcache_raw_read_signed, regcache_raw_read_unsigned)
(deprecated_read_register_gen, regcache_cooked_read)
(regcache_cooked_read_signed, regcache_cooked_read_unsigned)
(deprecated_write_register_gen, regcache_cooked_write)
(deprecated_write_register_bytes, regcache_raw_read_part)
(regcache_raw_write_part, regcache_cooked_read_part)
(regcache_cooked_write_part, read_register, regcache_raw_supply):
I know it's a bit late (just returned from vacation in .ca ;-), but
there is a nasty problem with the register cache stuff in this patch
:-(. Many bits of native code pass native data types to
regcache_raw_write, and this now raises a compiler warning. I'm not
sure how to solve this; adding casts all over the code is really,
really ugly, and I really, really don't want to do that. The best
thing I can come up with is that we revert the regcache_raw_xxx
interfaces back to using `void *', whereas we keep the
regcache_cooked_xxx interface as they are now (using `gdb_byte *').
Mark
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [commit] gdb_byte regcache.[hc]
2005-06-10 22:12 ` Mark Kettenis
@ 2005-06-11 1:43 ` Michael Snyder
2005-06-11 21:29 ` Mark Kettenis
1 sibling, 0 replies; 10+ messages in thread
From: Michael Snyder @ 2005-06-11 1:43 UTC (permalink / raw)
To: Mark Kettenis; +Cc: cagney, gdb-patches, drow
Mark Kettenis wrote:
> I know it's a bit late (just returned from vacation in .ca ;-), but
> there is a nasty problem with the register cache stuff in this patch
> :-(. Many bits of native code pass native data types to
> regcache_raw_write, and this now raises a compiler warning. I'm not
> sure how to solve this; adding casts all over the code is really,
> really ugly, and I really, really don't want to do that. The best
> thing I can come up with is that we revert the regcache_raw_xxx
> interfaces back to using `void *', whereas we keep the
> regcache_cooked_xxx interface as they are now (using `gdb_byte *').
I'm coming to this discussion even later than you, Mark.
I've gone back thru the archive to catch up, but I'm still
not clear on what is the purpose of gdb_byte (other than
to avoid using bfd_byte).
I thought it was to refer to target data, so we could
differentiate between host bytes and target bytes.
That would make sense. I'm not convinced that replacing
all uses of void* makes sense.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [commit] gdb_byte regcache.[hc]
2005-06-10 22:12 ` Mark Kettenis
2005-06-11 1:43 ` Michael Snyder
@ 2005-06-11 21:29 ` Mark Kettenis
2005-06-15 15:48 ` Andrew Cagney
1 sibling, 1 reply; 10+ messages in thread
From: Mark Kettenis @ 2005-06-11 21:29 UTC (permalink / raw)
To: mark.kettenis; +Cc: cagney, gdb-patches, drow
Date: Sat, 11 Jun 2005 00:12:24 +0200 (CEST)
From: Mark Kettenis <mark.kettenis@xs4all.nl>
Date: Thu, 19 May 2005 13:24:08 -0400
From: Andrew Cagney <cagney@gnu.org>
2005-05-19 Andrew Cagney <cagney@gnu.org>
* regcache.h (regcache_raw_read, regcache_raw_write)
(regcache_raw_read_part, regcache_raw_write_part)
(regcache_cooked_read_part, regcache_cooked_write_part)
(regcache_cooked_read, regcache_cooked_write)
(regcache_raw_supply, regcache_raw_collect)
(regcache_cooked_read_ftype, regcache_save, regcache_restore)
(deprecated_read_register_gen, deprecated_write_register_gen)
(deprecated_read_register_bytes, deprecated_write_register_bytes)
(deprecated_grub_regcache_for_registers): Use gdb_byte for byte
buffer parameters.
* ia64-tdep.c (ia64_extract_return_value): Update.
* frame.c (do_frame_register_read): Update.
* regcache.c (deprecated_grub_regcache_for_registers)
(struct regcache, regcache_save, regcache_restore, regcache_cpy)
(do_cooked_read, regcache_xmalloc, register_buffer)
(deprecated_read_register_bytes, regcache_raw_read)
(regcache_raw_read_signed, regcache_raw_read_unsigned)
(deprecated_read_register_gen, regcache_cooked_read)
(regcache_cooked_read_signed, regcache_cooked_read_unsigned)
(deprecated_write_register_gen, regcache_cooked_write)
(deprecated_write_register_bytes, regcache_raw_read_part)
(regcache_raw_write_part, regcache_cooked_read_part)
(regcache_cooked_write_part, read_register, regcache_raw_supply):
I know it's a bit late (just returned from vacation in .ca ;-), but
there is a nasty problem with the register cache stuff in this patch
:-(. Many bits of native code pass native data types to
regcache_raw_write, and this now raises a compiler warning. I'm not
sure how to solve this; adding casts all over the code is really,
really ugly, and I really, really don't want to do that. The best
thing I can come up with is that we revert the regcache_raw_xxx
interfaces back to using `void *', whereas we keep the
regcache_cooked_xxx interface as they are now (using `gdb_byte *').
Argh, let's blame it on my jetlag, but I meant regcache_raw_supply and
regcache_raw_collect as the function that should take `void *' instead
of `gdb_byte *'. The other regcache_raw_xxx functions can stay as
they are now.
Mark
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [commit] gdb_byte regcache.[hc]
2005-06-11 21:29 ` Mark Kettenis
@ 2005-06-15 15:48 ` Andrew Cagney
2005-06-15 16:48 ` Mark Kettenis
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cagney @ 2005-06-15 15:48 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
>
> Argh, let's blame it on my jetlag, but I meant regcache_raw_supply and
> regcache_raw_collect as the function that should take `void *' instead
> of `gdb_byte *'. The other regcache_raw_xxx functions can stay as
> they are now.
6hrs time difference is not jetlag ...
Just supply/collect is making more sense :-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [commit] gdb_byte regcache.[hc]
2005-06-15 15:48 ` Andrew Cagney
@ 2005-06-15 16:48 ` Mark Kettenis
2005-06-17 1:45 ` Daniel Jacobowitz
0 siblings, 1 reply; 10+ messages in thread
From: Mark Kettenis @ 2005-06-15 16:48 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
>>
>> Argh, let's blame it on my jetlag, but I meant regcache_raw_supply and
>> regcache_raw_collect as the function that should take `void *' instead
>> of `gdb_byte *'. The other regcache_raw_xxx functions can stay as
>> they are now.
>
> 6hrs time difference is not jetlag ...
>
> Just supply/collect is making more sense :-)
The attached patchis what I had in mind.
OK?
Mark
[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 2297 bytes --]
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.7235
diff -u -p -r1.7235 ChangeLog
--- ChangeLog 15 Jun 2005 16:35:28 -0000 1.7235
+++ ChangeLog 15 Jun 2005 16:46:42 -0000
@@ -1,3 +1,9 @@
+2005-06-15 Mark Kettenis <kettenis@jive.nl>
+
+ * regcache.c (regcache_raw_supply, regcache_raw_collect): Change
+ type of last argument back to `void *'.
+ * regcache.h (regcache_raw_supply, regcache_raw_collect): Likewise.
+
2005-06-15 Mark Kettenis <kettenis@gnu.org>
* hppa-hpux-nat.c (hppa_hpux_fetch_register)
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.136
diff -u -p -r1.136 regcache.c
--- regcache.c 19 May 2005 16:37:09 -0000 1.136
+++ regcache.c 15 Jun 2005 16:46:43 -0000
@@ -1002,8 +1002,7 @@ write_register_pid (int regnum, CORE_ADD
/* Supply register REGNUM, whose contents are stored in BUF, to REGCACHE. */
void
-regcache_raw_supply (struct regcache *regcache, int regnum,
- const gdb_byte *buf)
+regcache_raw_supply (struct regcache *regcache, int regnum, const void *buf)
{
void *regbuf;
size_t size;
@@ -1036,8 +1035,7 @@ regcache_raw_supply (struct regcache *re
/* Collect register REGNUM from REGCACHE and store its contents in BUF. */
void
-regcache_raw_collect (const struct regcache *regcache, int regnum,
- gdb_byte *buf)
+regcache_raw_collect (const struct regcache *regcache, int regnum, void *buf)
{
const void *regbuf;
size_t size;
Index: regcache.h
===================================================================
RCS file: /cvs/src/src/gdb/regcache.h,v
retrieving revision 1.46
diff -u -p -r1.46 regcache.h
--- regcache.h 19 May 2005 16:37:09 -0000 1.46
+++ regcache.h 15 Jun 2005 16:46:43 -0000
@@ -98,9 +98,9 @@ void regcache_cooked_write_part (struct
target_fetch_registers() or target_store_registers(). */
extern void regcache_raw_supply (struct regcache *regcache,
- int regnum, const gdb_byte *buf);
+ int regnum, const void *buf);
extern void regcache_raw_collect (const struct regcache *regcache,
- int regnum, gdb_byte *buf);
+ int regnum, void *buf);
/* The register's ``offset''.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [commit] gdb_byte regcache.[hc]
2005-06-15 16:48 ` Mark Kettenis
@ 2005-06-17 1:45 ` Daniel Jacobowitz
2005-06-18 15:24 ` Mark Kettenis
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2005-06-17 1:45 UTC (permalink / raw)
To: gdb-patches
On Wed, Jun 15, 2005 at 06:47:59PM +0200, Mark Kettenis wrote:
> >>
> >> Argh, let's blame it on my jetlag, but I meant regcache_raw_supply and
> >> regcache_raw_collect as the function that should take `void *' instead
> >> of `gdb_byte *'. The other regcache_raw_xxx functions can stay as
> >> they are now.
> >
> > 6hrs time difference is not jetlag ...
> >
> > Just supply/collect is making more sense :-)
>
> The attached patchis what I had in mind.
>
> OK?
I think this is a good idea.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [commit] gdb_byte regcache.[hc]
2005-06-17 1:45 ` Daniel Jacobowitz
@ 2005-06-18 15:24 ` Mark Kettenis
0 siblings, 0 replies; 10+ messages in thread
From: Mark Kettenis @ 2005-06-18 15:24 UTC (permalink / raw)
To: drow; +Cc: gdb-patches
Date: Thu, 16 Jun 2005 21:45:20 -0400
From: Daniel Jacobowitz <drow@false.org>
On Wed, Jun 15, 2005 at 06:47:59PM +0200, Mark Kettenis wrote:
> >>
> >> Argh, let's blame it on my jetlag, but I meant regcache_raw_supply and
> >> regcache_raw_collect as the function that should take `void *' instead
> >> of `gdb_byte *'. The other regcache_raw_xxx functions can stay as
> >> they are now.
> >
> > 6hrs time difference is not jetlag ...
> >
> > Just supply/collect is making more sense :-)
>
> The attached patchis what I had in mind.
>
> OK?
I think this is a good idea.
Since it did make some sense to Andrew too, I committed it. This
should fix many -Werror issues on native builds.
Mark
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-06-18 15:24 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-19 17:07 [commit] gdb_byte regcache.[hc] Andrew Cagney
2005-05-19 18:56 ` Daniel Jacobowitz
2005-05-19 19:13 ` Andrew Cagney
2005-06-10 22:12 ` Mark Kettenis
2005-06-11 1:43 ` Michael Snyder
2005-06-11 21:29 ` Mark Kettenis
2005-06-15 15:48 ` Andrew Cagney
2005-06-15 16:48 ` Mark Kettenis
2005-06-17 1:45 ` Daniel Jacobowitz
2005-06-18 15:24 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox