* command.h (add_setshow_integer_cmd): Make VAR an integer.
* cli/cli-decode.c (add_setshow_integer_cmd): Update to match.
* valops.c (value_string): Add a cast.
* eval.c (evaluate_subexp_standard): Use gdb_byte for byte buffers.
* breakpoint.c (re_enable_breakpoints_in_shlibs): Use gdb_byte for
byte buffers.
* target.h (struct target_ops): For to_insert_hw_breakpoint and
to_remove_hw_breakpoint use gdb_byte for byte buffer parameters.
* breakpoint.h (struct bp_location): Make shadow_contents a
gdb_byte buffer.
* cli/cli-setshow.c (do_setshow_command): Fix cast.
* cli/cli-dump.c (restore_section_callback)
(restore_binary_file): Use gdb_byte for byte buffers.
* proc-service.c (ps_ptwrite, ps_ptread, ps_pdwrite): Fix casts.
(ps_xfer_memory): Use gdb_byte for byte buffers.
* tracepoint.c (mem2hex): Use gdb_byte for byte buffers, and char
for string buffers.
* ser-tcp.c (net_open): Make len a socklen_t.
+2005-05-26 Andrew Cagney <cagney@gnu.org>
+
+ * command.h (add_setshow_integer_cmd): Make VAR an integer.
+ * cli/cli-decode.c (add_setshow_integer_cmd): Update to match.
+ * valops.c (value_string): Add a cast.
+ * eval.c (evaluate_subexp_standard): Use gdb_byte for byte buffers.
+ * breakpoint.c (re_enable_breakpoints_in_shlibs): Use gdb_byte for
+ byte buffers.
+ * target.h (struct target_ops): For to_insert_hw_breakpoint and
+ to_remove_hw_breakpoint use gdb_byte for byte buffer parameters.
+ * breakpoint.h (struct bp_location): Make shadow_contents a
+ gdb_byte buffer.
+ * cli/cli-setshow.c (do_setshow_command): Fix cast.
+ * cli/cli-dump.c (restore_section_callback)
+ (restore_binary_file): Use gdb_byte for byte buffers.
+ * proc-service.c (ps_ptwrite, ps_ptread, ps_pdwrite): Fix casts.
+ (ps_xfer_memory): Use gdb_byte for byte buffers.
+ * tracepoint.c (mem2hex): Use gdb_byte for byte buffers, and char
+ for string buffers.
+ * ser-tcp.c (net_open): Make len a socklen_t.
+
2005-05-24 Andrew Cagney <cagney@gnu.org>
* rs6000-tdep.c (ppc_supply_reg, ppc_collect_reg): Use gdb_byte
{
if (b->enable_state == bp_shlib_disabled)
{
- char buf[1], *lib;
+ gdb_byte buf[1];
+ char *lib;
/* Do not reenable the breakpoint if the shared library is
still not mapped in. */
control of the target insert_breakpoint and remove_breakpoint routines.
No other code should assume anything about the value(s) here.
Valid only for bp_loc_software_breakpoint. */
- char shadow_contents[BREAKPOINT_MAX];
+ gdb_byte shadow_contents[BREAKPOINT_MAX];
/* Address at which breakpoint was requested, either by the user or
by GDB for internal breakpoints. This will usually be the same
value. SET_DOC and SHOW_DOC are the documentation strings. */
void
add_setshow_integer_cmd (char *name, enum command_class class,
- unsigned int *var,
+ int *var,
const char *set_doc, const char *show_doc,
const char *help_doc,
cmd_sfunc_ftype *set_func,
bfd_size_type sec_offset = 0;
bfd_size_type sec_load_count = size;
struct cleanup *old_chain;
- char *buf;
+ gdb_byte *buf;
int ret;
/* Ignore non-loadable sections, eg. from elf files. */
{
FILE *file = fopen_with_cleanup (filename, FOPEN_RB);
int status;
- char *buf;
+ gdb_byte *buf;
long len;
/* Get the file size for reading. */
switch (c->var_type)
{
case var_string:
- {
- unsigned char *p;
-
- if (*(unsigned char **) c->var)
- fputstr_filtered (*(unsigned char **) c->var, '"', stb->stream);
- }
+ if (((char *)c->var)[0] != '\0')
+ fputstr_filtered ((char *)c->var, '"', stb->stream);
break;
case var_string_noescape:
case var_optional_filename:
extern void add_setshow_integer_cmd (char *name,
enum command_class class,
- unsigned int *var,
+ int *var,
const char *set_doc,
const char *show_doc,
const char *help_doc,
&& TYPE_CODE (type) == TYPE_CODE_SET)
{
struct value *set = allocate_value (expect_type);
- char *valaddr = value_contents_raw (set);
+ gdb_byte *valaddr = value_contents_raw (set);
struct type *element_type = TYPE_INDEX_TYPE (type);
struct type *check_type = element_type;
LONGEST low_bound, high_bound;
static ps_err_e
ps_xfer_memory (const struct ps_prochandle *ph, paddr_t addr,
- char *buf, size_t len, int write)
+ gdb_byte *buf, size_t len, int write)
{
struct cleanup *old_chain = save_inferior_ptid ();
int ret;
ps_pdwrite (gdb_ps_prochandle_t ph, paddr_t addr,
gdb_ps_write_buf_t buf, gdb_ps_size_t size)
{
- return ps_xfer_memory (ph, addr, (char *) buf, size, 1);
+ return ps_xfer_memory (ph, addr, (gdb_byte *) buf, size, 1);
}
/* Read SIZE bytes from the target process PH at address ADDR and copy
ps_ptread (gdb_ps_prochandle_t ph, paddr_t addr,
gdb_ps_read_buf_t buf, gdb_ps_size_t size)
{
- return ps_xfer_memory (ph, addr, buf, size, 0);
+ return ps_xfer_memory (ph, addr, (gdb_byte *) buf, size, 0);
}
/* Write SIZE bytes from BUF into the target process PH at address ADDR. */
ps_ptwrite (gdb_ps_prochandle_t ph, paddr_t addr,
gdb_ps_write_buf_t buf, gdb_ps_size_t size)
{
- return ps_xfer_memory (ph, addr, (char *) buf, size, 1);
+ return ps_xfer_memory (ph, addr, (gdb_byte *) buf, size, 1);
}
/* Get the general registers of LWP LWPID within the target process PH
/* Got something. Is it an error? */
{
- int res, err, len;
+ int res, err;
+ socklen_t len;
len = sizeof(err);
/* On Windows, the fourth parameter to getsockopt is a "char *";
on UNIX systems it is generally "void *". The cast to "void *"
int (*to_insert_breakpoint) (CORE_ADDR, gdb_byte *);
int (*to_remove_breakpoint) (CORE_ADDR, gdb_byte *);
int (*to_can_use_hw_breakpoint) (int, int, int);
- int (*to_insert_hw_breakpoint) (CORE_ADDR, char *);
- int (*to_remove_hw_breakpoint) (CORE_ADDR, char *);
+ int (*to_insert_hw_breakpoint) (CORE_ADDR, gdb_byte *);
+ int (*to_remove_hw_breakpoint) (CORE_ADDR, gdb_byte *);
int (*to_remove_watchpoint) (CORE_ADDR, int, int);
int (*to_insert_watchpoint) (CORE_ADDR, int, int);
int (*to_stopped_by_watchpoint) (void);
struct collection_list;
static void add_aexpr (struct collection_list *, struct agent_expr *);
-static unsigned char *mem2hex (unsigned char *, unsigned char *, int);
+static char *mem2hex (gdb_byte *, char *, int);
static void add_register (struct collection_list *collection,
unsigned int regno);
static struct cleanup *make_cleanup_free_actions (struct tracepoint *t);
static const char hexchars[] = "0123456789abcdef";
-static unsigned char *
-mem2hex (unsigned char *mem, unsigned char *buf, int count)
+static char *
+mem2hex (gdb_byte *mem, char *buf, int count)
{
- unsigned char ch;
+ gdb_byte ch;
while (count-- > 0)
{
copy LEN bytes from PTR in gdb to that address in the inferior. */
addr = allocate_space_in_inferior (len);
- write_memory (addr, ptr, len);
+ write_memory (addr, (gdb_byte *) ptr, len);
val = value_at_lazy (stringtype, addr);
return (val);