aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog48
-rw-r--r--gdb/gdbserver/ax.c4
-rw-r--r--gdb/gdbserver/hostio.c4
-rw-r--r--gdb/gdbserver/linux-low.c12
-rw-r--r--gdb/gdbserver/mem-break.c14
-rw-r--r--gdb/gdbserver/regcache.c6
-rw-r--r--gdb/gdbserver/remote-utils.c12
-rw-r--r--gdb/gdbserver/server.c28
-rw-r--r--gdb/gdbserver/target.c2
-rw-r--r--gdb/gdbserver/thread-db.c2
-rw-r--r--gdb/gdbserver/tracepoint.c61
11 files changed, 122 insertions, 71 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index d09c454..d6ce174 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,51 @@
+2015-09-25 Simon Marchi <simon.marchi@ericsson.com>
+
+ * ax.c (gdb_parse_agent_expr): Add cast to allocation result
+ assignment.
+ (gdb_unparse_agent_expr): Likewise.
+ * hostio.c (require_data): Likewise.
+ (handle_pread): Likewise.
+ * linux-low.c (disable_regset): Likewise.
+ (fetch_register): Likewise.
+ (store_register): Likewise.
+ (get_dynamic): Likewise.
+ (linux_qxfer_libraries_svr4): Likewise.
+ * mem-break.c (delete_fast_tracepoint_jump): Likewise.
+ (set_fast_tracepoint_jump): Likewise.
+ (uninsert_fast_tracepoint_jumps_at): Likewise.
+ (reinsert_fast_tracepoint_jumps_at): Likewise.
+ (validate_inserted_breakpoint): Likewise.
+ (clone_agent_expr): Likewise.
+ * regcache.c (init_register_cache): Likewise.
+ * remote-utils.c (putpkt_binary_1): Likewise.
+ (decode_M_packet): Likewise.
+ (decode_X_packet): Likewise.
+ (look_up_one_symbol): Likewise.
+ (relocate_instruction): Likewise.
+ (monitor_output): Likewise.
+ * server.c (handle_search_memory): Likewise.
+ (handle_qxfer_exec_file): Likewise.
+ (handle_qxfer_libraries): Likewise.
+ (handle_qxfer): Likewise.
+ (handle_query): Likewise.
+ (handle_v_cont): Likewise.
+ (handle_v_run): Likewise.
+ (captured_main): Likewise.
+ * target.c (write_inferior_memory): Likewise.
+ * thread-db.c (try_thread_db_load_from_dir): Likewise.
+ * tracepoint.c (init_trace_buffer): Likewise.
+ (add_tracepoint_action): Likewise.
+ (add_traceframe): Likewise.
+ (add_traceframe_block): Likewise.
+ (cmd_qtdpsrc): Likewise.
+ (cmd_qtdv): Likewise.
+ (cmd_qtstatus): Likewise.
+ (response_source): Likewise.
+ (response_tsv): Likewise.
+ (cmd_qtnotes): Likewise.
+ (gdb_collect): Likewise.
+ (initialize_tracepoint): Likewise.
+
2015-09-21 Pierre Langlois <pierre.langlois@arm.com>
* linux-aarch64-low-.c: Include ax.h and tracepoint.h.
diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
index 3d0d93d..4c9dadc 100644
--- a/gdb/gdbserver/ax.c
+++ b/gdb/gdbserver/ax.c
@@ -106,7 +106,7 @@ gdb_parse_agent_expr (char **actparm)
++act; /* skip a comma */
aexpr = XNEW (struct agent_expr);
aexpr->length = xlen;
- aexpr->bytes = xmalloc (xlen);
+ aexpr->bytes = (unsigned char *) xmalloc (xlen);
hex2bin (act, aexpr->bytes, xlen);
*actparm = act + (xlen * 2);
return aexpr;
@@ -131,7 +131,7 @@ gdb_unparse_agent_expr (struct agent_expr *aexpr)
{
char *rslt;
- rslt = xmalloc (2 * aexpr->length + 1);
+ rslt = (char *) xmalloc (2 * aexpr->length + 1);
bin2hex (aexpr->bytes, rslt, aexpr->length);
return rslt;
}
diff --git a/gdb/gdbserver/hostio.c b/gdb/gdbserver/hostio.c
index a631d9e..48fa6f3 100644
--- a/gdb/gdbserver/hostio.c
+++ b/gdb/gdbserver/hostio.c
@@ -126,7 +126,7 @@ require_data (char *p, int p_len, char **data, int *data_len)
{
int input_index, output_index, escaped;
- *data = xmalloc (p_len);
+ *data = (char *) xmalloc (p_len);
output_index = 0;
escaped = 0;
@@ -371,7 +371,7 @@ handle_pread (char *own_buf, int *new_packet_len)
if (len > max_reply_size)
len = max_reply_size;
- data = xmalloc (len);
+ data = (char *) xmalloc (len);
#ifdef HAVE_PREAD
ret = pread (fd, data, len, offset);
#else
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index f5b64ab..12a2332 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -4896,7 +4896,7 @@ disable_regset (struct regsets_info *info, struct regset_info *regset)
dr_offset = regset - info->regsets;
if (info->disabled_regsets == NULL)
- info->disabled_regsets = xcalloc (1, info->num_regsets);
+ info->disabled_regsets = (char *) xcalloc (1, info->num_regsets);
info->disabled_regsets[dr_offset] = 1;
}
@@ -5119,7 +5119,7 @@ fetch_register (const struct usrregs_info *usrregs,
size = ((register_size (regcache->tdesc, regno)
+ sizeof (PTRACE_XFER_TYPE) - 1)
& -sizeof (PTRACE_XFER_TYPE));
- buf = alloca (size);
+ buf = (char *) alloca (size);
pid = lwpid_of (current_thread);
for (i = 0; i < size; i += sizeof (PTRACE_XFER_TYPE))
@@ -5163,7 +5163,7 @@ store_register (const struct usrregs_info *usrregs,
size = ((register_size (regcache->tdesc, regno)
+ sizeof (PTRACE_XFER_TYPE) - 1)
& -sizeof (PTRACE_XFER_TYPE));
- buf = alloca (size);
+ buf = (char *) alloca (size);
memset (buf, 0, size);
if (the_low_target.collect_ptrace_register)
@@ -6324,7 +6324,7 @@ get_dynamic (const int pid, const int is_elf64)
return 0;
gdb_assert (num_phdr < 100); /* Basic sanity check. */
- phdr_buf = alloca (num_phdr * phdr_size);
+ phdr_buf = (unsigned char *) alloca (num_phdr * phdr_size);
if (linux_read_memory (phdr_memaddr, phdr_buf, num_phdr * phdr_size))
return 0;
@@ -6653,7 +6653,7 @@ linux_qxfer_libraries_svr4 (const char *annex, unsigned char *readbuf,
}
}
- document = xmalloc (allocated);
+ document = (char *) xmalloc (allocated);
strcpy (document, "<library-list-svr4 version=\"1.0\"");
p = document + strlen (document);
@@ -6714,7 +6714,7 @@ linux_qxfer_libraries_svr4 (const char *annex, unsigned char *readbuf,
/* Expand to guarantee sufficient storage. */
uintptr_t document_len = p - document;
- document = xrealloc (document, 2 * allocated);
+ document = (char *) xrealloc (document, 2 * allocated);
allocated *= 2;
p = document + document_len;
}
diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c
index 9356741..f077497 100644
--- a/gdb/gdbserver/mem-break.c
+++ b/gdb/gdbserver/mem-break.c
@@ -527,7 +527,7 @@ delete_fast_tracepoint_jump (struct fast_tracepoint_jump *todel)
pass the current shadow contents, because
write_inferior_memory updates any shadow memory with
what we pass here, and we want that to be a nop. */
- buf = alloca (bp->length);
+ buf = (unsigned char *) alloca (bp->length);
memcpy (buf, fast_tracepoint_jump_shadow (bp), bp->length);
ret = write_inferior_memory (bp->pc, buf, bp->length);
if (ret != 0)
@@ -585,12 +585,12 @@ set_fast_tracepoint_jump (CORE_ADDR where,
/* We don't, so create a new object. Double the length, because the
flexible array member holds both the jump insn, and the
shadow. */
- jp = xcalloc (1, sizeof (*jp) + (length * 2));
+ jp = (struct fast_tracepoint_jump *) xcalloc (1, sizeof (*jp) + (length * 2));
jp->pc = where;
jp->length = length;
memcpy (fast_tracepoint_jump_insn (jp), insn, length);
jp->refcount = 1;
- buf = alloca (length);
+ buf = (unsigned char *) alloca (length);
/* Note that there can be trap breakpoints inserted in the same
address range. To access the original memory contents, we use
@@ -670,7 +670,7 @@ uninsert_fast_tracepoint_jumps_at (CORE_ADDR pc)
pass the current shadow contents, because
write_inferior_memory updates any shadow memory with what we
pass here, and we want that to be a nop. */
- buf = alloca (jp->length);
+ buf = (unsigned char *) alloca (jp->length);
memcpy (buf, fast_tracepoint_jump_shadow (jp), jp->length);
err = write_inferior_memory (jp->pc, buf, jp->length);
if (err != 0)
@@ -717,7 +717,7 @@ reinsert_fast_tracepoint_jumps_at (CORE_ADDR where)
to pass the current shadow contents, because
write_inferior_memory updates any shadow memory with what we pass
here, and we want that to be a nop. */
- buf = alloca (jp->length);
+ buf = (unsigned char *) alloca (jp->length);
memcpy (buf, fast_tracepoint_jump_shadow (jp), jp->length);
err = write_inferior_memory (where, buf, jp->length);
if (err != 0)
@@ -1669,7 +1669,7 @@ validate_inserted_breakpoint (struct raw_breakpoint *bp)
gdb_assert (bp->inserted);
gdb_assert (bp->raw_type == raw_bkpt_type_sw);
- buf = alloca (breakpoint_len);
+ buf = (unsigned char *) alloca (breakpoint_len);
err = (*the_target->read_memory) (bp->pc, buf, breakpoint_len);
if (err || memcmp (buf, breakpoint_data, breakpoint_len) != 0)
{
@@ -1939,7 +1939,7 @@ clone_agent_expr (const struct agent_expr *src_ax)
ax = XCNEW (struct agent_expr);
ax->length = src_ax->length;
- ax->bytes = xcalloc (ax->length, 1);
+ ax->bytes = (unsigned char *) xcalloc (ax->length, 1);
memcpy (ax->bytes, src_ax->bytes, ax->length);
return ax;
}
diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index 59bdc53..f79063c 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -131,9 +131,11 @@ init_register_cache (struct regcache *regcache,
fetches. This way they'll read as zero instead of
garbage. */
regcache->tdesc = tdesc;
- regcache->registers = xcalloc (1, tdesc->registers_size);
+ regcache->registers
+ = (unsigned char *) xcalloc (1, tdesc->registers_size);
regcache->registers_owned = 1;
- regcache->register_status = xcalloc (1, tdesc->num_registers);
+ regcache->register_status
+ = (unsigned char *) xcalloc (1, tdesc->num_registers);
gdb_assert (REG_UNAVAILABLE == 0);
#else
gdb_assert_not_reached ("can't allocate memory from the heap");
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 7cf66cc..e366091 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -622,7 +622,7 @@ putpkt_binary_1 (char *buf, int cnt, int is_notif)
char *p;
int cc;
- buf2 = xmalloc (strlen ("$") + cnt + strlen ("#nn") + 1);
+ buf2 = (char *) xmalloc (strlen ("$") + cnt + strlen ("#nn") + 1);
/* Copy the packet into buffer BUF2, encapsulating it
and giving it a checksum. */
@@ -1325,7 +1325,7 @@ decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr,
}
if (*to_p == NULL)
- *to_p = xmalloc (*len_ptr);
+ *to_p = (unsigned char *) xmalloc (*len_ptr);
hex2bin (&from[i++], *to_p, *len_ptr);
}
@@ -1351,7 +1351,7 @@ decode_X_packet (char *from, int packet_len, CORE_ADDR *mem_addr_ptr,
}
if (*to_p == NULL)
- *to_p = xmalloc (*len_ptr);
+ *to_p = (unsigned char *) xmalloc (*len_ptr);
if (remote_unescape_input ((const gdb_byte *) &from[i], packet_len - i,
*to_p, *len_ptr) != *len_ptr)
@@ -1478,7 +1478,7 @@ look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb)
unsigned int mem_len;
decode_m_packet (&own_buf[1], &mem_addr, &mem_len);
- mem_buf = xmalloc (mem_len);
+ mem_buf = (unsigned char *) xmalloc (mem_len);
if (read_inferior_memory (mem_addr, mem_buf, mem_len) == 0)
bin2hex (mem_buf, own_buf, mem_len);
else
@@ -1562,7 +1562,7 @@ relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc)
if (own_buf[0] == 'm')
{
decode_m_packet (&own_buf[1], &mem_addr, &mem_len);
- mem_buf = xmalloc (mem_len);
+ mem_buf = (unsigned char *) xmalloc (mem_len);
if (read_inferior_memory (mem_addr, mem_buf, mem_len) == 0)
bin2hex (mem_buf, own_buf, mem_len);
else
@@ -1617,7 +1617,7 @@ void
monitor_output (const char *msg)
{
int len = strlen (msg);
- char *buf = xmalloc (len * 2 + 2);
+ char *buf = (char *) xmalloc (len * 2 + 2);
buf[0] = 'O';
bin2hex ((const gdb_byte *) msg, buf + 1, len);
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 827316f..53763e5 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -959,7 +959,7 @@ handle_search_memory (char *own_buf, int packet_len)
CORE_ADDR found_addr;
int cmd_name_len = sizeof ("qSearch:memory:") - 1;
- pattern = malloc (packet_len);
+ pattern = (gdb_byte *) malloc (packet_len);
if (pattern == NULL)
{
error ("Unable to allocate memory to perform the search");
@@ -983,7 +983,7 @@ handle_search_memory (char *own_buf, int packet_len)
if (search_space_len < search_buf_size)
search_buf_size = search_space_len;
- search_buf = malloc (search_buf_size);
+ search_buf = (gdb_byte *) malloc (search_buf_size);
if (search_buf == NULL)
{
free (pattern);
@@ -1211,7 +1211,7 @@ handle_qxfer_exec_file (const char *const_annex,
}
else
{
- char *annex = alloca (strlen (const_annex) + 1);
+ char *annex = (char *) alloca (strlen (const_annex) + 1);
strcpy (annex, const_annex);
annex = unpack_varlen_hex (annex, &pid);
@@ -1334,7 +1334,7 @@ handle_qxfer_libraries (const char *annex,
for_each_inferior_with_data (&all_dlls, accumulate_file_name_length,
&total_len);
- document = malloc (total_len);
+ document = (char *) malloc (total_len);
if (document == NULL)
return -1;
@@ -1795,7 +1795,7 @@ handle_qxfer (char *own_buf, int packet_len, int *new_packet_len_p)
more. */
if (len > PBUFSIZ - 2)
len = PBUFSIZ - 2;
- data = malloc (len + 1);
+ data = (unsigned char *) malloc (len + 1);
if (data == NULL)
{
write_enn (own_buf);
@@ -1829,7 +1829,7 @@ handle_qxfer (char *own_buf, int packet_len, int *new_packet_len_p)
unsigned char *data;
strcpy (own_buf, "E00");
- data = malloc (packet_len - (offset - own_buf));
+ data = (unsigned char *) malloc (packet_len - (offset - own_buf));
if (data == NULL)
{
write_enn (own_buf);
@@ -2071,7 +2071,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
p = strtok (NULL, ";"))
{
count++;
- qsupported = xrealloc (qsupported, count * sizeof (char *));
+ qsupported = XRESIZEVEC (char *, qsupported, count);
qsupported[count - 1] = xstrdup (p);
}
@@ -2334,7 +2334,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
/* Handle "monitor" commands. */
if (startswith (own_buf, "qRcmd,"))
{
- char *mon = malloc (PBUFSIZ);
+ char *mon = (char *) malloc (PBUFSIZ);
int len = strlen (own_buf + 6);
if (mon == NULL)
@@ -2523,7 +2523,7 @@ handle_v_cont (char *own_buf)
p = strchr (p, ';');
}
- resume_info = malloc (n * sizeof (resume_info[0]));
+ resume_info = (struct thread_resume *) malloc (n * sizeof (resume_info[0]));
if (resume_info == NULL)
goto err;
@@ -2718,7 +2718,7 @@ handle_v_run (char *own_buf)
new_argc++;
}
- new_argv = calloc (new_argc + 2, sizeof (char *));
+ new_argv = (char **) calloc (new_argc + 2, sizeof (char *));
if (new_argv == NULL)
{
write_enn (own_buf);
@@ -2737,7 +2737,7 @@ handle_v_run (char *own_buf)
else
{
/* FIXME: Fail request if out of memory instead of dying. */
- new_argv[i] = xmalloc (1 + (next_p - p) / 2);
+ new_argv[i] = (char *) xmalloc (1 + (next_p - p) / 2);
hex2bin (p, (gdb_byte *) new_argv[i], (next_p - p) / 2);
new_argv[i][(next_p - p) / 2] = '\0';
}
@@ -3524,15 +3524,15 @@ captured_main (int argc, char *argv[])
initialize_tracepoint ();
initialize_notif ();
- own_buf = xmalloc (PBUFSIZ + 1);
- mem_buf = xmalloc (PBUFSIZ);
+ own_buf = (char *) xmalloc (PBUFSIZ + 1);
+ mem_buf = (unsigned char *) xmalloc (PBUFSIZ);
if (pid == 0 && *next_arg != NULL)
{
int i, n;
n = argc - (next_arg - argv);
- program_argv = xmalloc (sizeof (char *) * (n + 1));
+ program_argv = XNEWVEC (char *, n + 1);
for (i = 0; i < n; i++)
program_argv[i] = xstrdup (next_arg[i]);
program_argv[i] = NULL;
diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
index 17ff7a6..301f90e 100644
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -75,7 +75,7 @@ write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr,
if (buffer != NULL)
free (buffer);
- buffer = xmalloc (len);
+ buffer = (unsigned char *) xmalloc (len);
memcpy (buffer, myaddr, len);
check_mem_write (memaddr, buffer, myaddr, len);
res = (*the_target->write_memory) (memaddr, buffer, len);
diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c
index cd07c52..f5fdf10 100644
--- a/gdb/gdbserver/thread-db.c
+++ b/gdb/gdbserver/thread-db.c
@@ -749,7 +749,7 @@ try_thread_db_load_from_dir (const char *dir, size_t dir_len)
if (dir_len + 1 + strlen (LIBTHREAD_DB_SO) + 1 > sizeof (path))
{
- char *cp = xmalloc (dir_len + 1);
+ char *cp = (char *) xmalloc (dir_len + 1);
memcpy (cp, dir, dir_len);
cp[dir_len] = '\0';
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 6b50f26..1b3a5d0 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -1497,7 +1497,7 @@ init_trace_buffer (LONGEST bufsize)
marker. */
alloc_size = (bufsize < TRACEFRAME_EOB_MARKER_SIZE
? TRACEFRAME_EOB_MARKER_SIZE : bufsize);
- trace_buffer_lo = xrealloc (trace_buffer_lo, alloc_size);
+ trace_buffer_lo = (unsigned char *) xrealloc (trace_buffer_lo, alloc_size);
trace_buffer_hi = trace_buffer_lo + trace_buffer_size;
@@ -2024,13 +2024,11 @@ add_tracepoint_action (struct tracepoint *tpoint, char *packet)
tpoint->num_step_actions++;
tpoint->step_actions
- = xrealloc (tpoint->step_actions,
- (sizeof (*tpoint->step_actions)
- * tpoint->num_step_actions));
+ = XRESIZEVEC (struct tracepoint_action *, tpoint->step_actions,
+ tpoint->num_step_actions);
tpoint->step_actions_str
- = xrealloc (tpoint->step_actions_str,
- (sizeof (*tpoint->step_actions_str)
- * tpoint->num_step_actions));
+ = XRESIZEVEC (char *, tpoint->step_actions_str,
+ tpoint->num_step_actions);
tpoint->step_actions[tpoint->num_step_actions - 1] = action;
tpoint->step_actions_str[tpoint->num_step_actions - 1]
= savestring (act_start, act - act_start);
@@ -2039,11 +2037,10 @@ add_tracepoint_action (struct tracepoint *tpoint, char *packet)
{
tpoint->numactions++;
tpoint->actions
- = xrealloc (tpoint->actions,
- sizeof (*tpoint->actions) * tpoint->numactions);
+ = XRESIZEVEC (struct tracepoint_action *, tpoint->actions,
+ tpoint->numactions);
tpoint->actions_str
- = xrealloc (tpoint->actions_str,
- sizeof (*tpoint->actions_str) * tpoint->numactions);
+ = XRESIZEVEC (char *, tpoint->actions_str, tpoint->numactions);
tpoint->actions[tpoint->numactions - 1] = action;
tpoint->actions_str[tpoint->numactions - 1]
= savestring (act_start, act - act_start);
@@ -2201,7 +2198,8 @@ add_traceframe (struct tracepoint *tpoint)
{
struct traceframe *tframe;
- tframe = trace_buffer_alloc (sizeof (struct traceframe));
+ tframe
+ = (struct traceframe *) trace_buffer_alloc (sizeof (struct traceframe));
if (tframe == NULL)
return NULL;
@@ -2223,7 +2221,7 @@ add_traceframe_block (struct traceframe *tframe,
if (!tframe)
return NULL;
- block = trace_buffer_alloc (amt);
+ block = (unsigned char *) trace_buffer_alloc (amt);
if (!block)
return NULL;
@@ -2685,7 +2683,7 @@ cmd_qtdpsrc (char *own_buf)
saved = packet;
packet = strchr (packet, ':');
- srctype = xmalloc (packet - saved + 1);
+ srctype = (char *) xmalloc (packet - saved + 1);
memcpy (srctype, saved, packet - saved);
srctype[packet - saved] = '\0';
++packet;
@@ -2693,7 +2691,7 @@ cmd_qtdpsrc (char *own_buf)
++packet; /* skip a colon */
packet = unpack_varlen_hex (packet, &slen);
++packet; /* skip a colon */
- src = xmalloc (slen + 1);
+ src = (char *) xmalloc (slen + 1);
nbytes = hex2bin (packet, (gdb_byte *) src, strlen (packet) / 2);
src[nbytes] = '\0';
@@ -2735,7 +2733,7 @@ cmd_qtdv (char *own_buf)
++packet; /* skip a colon */
nbytes = strlen (packet) / 2;
- varname = xmalloc (nbytes + 1);
+ varname = (char *) xmalloc (nbytes + 1);
nbytes = hex2bin (packet, (gdb_byte *) varname, nbytes);
varname[nbytes] = '\0';
@@ -3659,7 +3657,8 @@ cmd_qtstatus (char *packet)
result_name = stop_reason_rsp + strlen ("terror:");
hexstr_len = strlen (result_name) * 2;
- p = stop_reason_rsp = alloca (strlen ("terror:") + hexstr_len + 1);
+ p = stop_reason_rsp
+ = (char *) alloca (strlen ("terror:") + hexstr_len + 1);
strcpy (p, "terror:");
p += strlen (p);
bin2hex ((gdb_byte *) result_name, p, strlen (result_name));
@@ -3668,7 +3667,7 @@ cmd_qtstatus (char *packet)
/* If this was a forced stop, include any stop note that was supplied. */
if (strcmp (stop_reason_rsp, "tstop") == 0)
{
- stop_reason_rsp = alloca (strlen ("tstop:") + strlen (buf3) + 1);
+ stop_reason_rsp = (char *) alloca (strlen ("tstop:") + strlen (buf3) + 1);
strcpy (stop_reason_rsp, "tstop:");
strcat (stop_reason_rsp, buf3);
}
@@ -3780,7 +3779,7 @@ response_source (char *packet,
int len;
len = strlen (src->str);
- buf = alloca (len * 2 + 1);
+ buf = (char *) alloca (len * 2 + 1);
bin2hex ((gdb_byte *) src->str, buf, len);
sprintf (packet, "Z%x:%s:%s:%x:%x:%s",
@@ -3869,7 +3868,7 @@ response_tsv (char *packet, struct trace_state_variable *tsv)
if (tsv->name)
{
namelen = strlen (tsv->name);
- buf = alloca (namelen * 2 + 1);
+ buf = (char *) alloca (namelen * 2 + 1);
bin2hex ((gdb_byte *) tsv->name, buf, namelen);
}
@@ -4110,7 +4109,7 @@ cmd_qtnotes (char *own_buf)
saved = packet;
packet = strchr (packet, ';');
nbytes = (packet - saved) / 2;
- user = xmalloc (nbytes + 1);
+ user = (char *) xmalloc (nbytes + 1);
nbytes = hex2bin (saved, (gdb_byte *) user, nbytes);
user[nbytes] = '\0';
++packet; /* skip the semicolon */
@@ -4124,7 +4123,7 @@ cmd_qtnotes (char *own_buf)
saved = packet;
packet = strchr (packet, ';');
nbytes = (packet - saved) / 2;
- notes = xmalloc (nbytes + 1);
+ notes = (char *) xmalloc (nbytes + 1);
nbytes = hex2bin (saved, (gdb_byte *) notes, nbytes);
notes[nbytes] = '\0';
++packet; /* skip the semicolon */
@@ -4138,7 +4137,7 @@ cmd_qtnotes (char *own_buf)
saved = packet;
packet = strchr (packet, ';');
nbytes = (packet - saved) / 2;
- stopnote = xmalloc (nbytes + 1);
+ stopnote = (char *) xmalloc (nbytes + 1);
nbytes = hex2bin (saved, (gdb_byte *) stopnote, nbytes);
stopnote[nbytes] = '\0';
++packet; /* skip the semicolon */
@@ -5800,7 +5799,7 @@ gdb_collect (struct tracepoint *tpoint, unsigned char *regs)
ctx.regcache_initted = 0;
/* Wrap the regblock in a register cache (in the stack, we don't
want to malloc here). */
- ctx.regspace = alloca (ipa_tdesc->registers_size);
+ ctx.regspace = (unsigned char *) alloca (ipa_tdesc->registers_size);
if (ctx.regspace == NULL)
{
trace_debug ("Trace buffer block allocation failed, skipping");
@@ -7365,7 +7364,7 @@ initialize_tracepoint (void)
if (pagesize == -1)
perror_with_name ("sysconf");
- gdb_tp_heap_buffer = xmalloc (5 * 1024 * 1024);
+ gdb_tp_heap_buffer = (char *) xmalloc (5 * 1024 * 1024);
#define SCRATCH_BUFFER_NPAGES 20
@@ -7373,10 +7372,12 @@ initialize_tracepoint (void)
address (close to the main executable's code). */
for (addr = pagesize; addr != 0; addr += pagesize)
{
- gdb_jump_pad_buffer = mmap ((void *) addr, pagesize * SCRATCH_BUFFER_NPAGES,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
- -1, 0);
+ gdb_jump_pad_buffer
+ = (char *) mmap ((void *) addr,
+ pagesize * SCRATCH_BUFFER_NPAGES,
+ PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
+ -1, 0);
if (gdb_jump_pad_buffer != MAP_FAILED)
break;
}
@@ -7393,7 +7394,7 @@ initialize_tracepoint (void)
buffer setup, but it can be mysterious, so create a channel to
report back on what went wrong, using a fixed size since we may
not be able to allocate space later when the problem occurs. */
- gdb_trampoline_buffer_error = xmalloc (IPA_BUFSIZ);
+ gdb_trampoline_buffer_error = (char *) xmalloc (IPA_BUFSIZ);
strcpy (gdb_trampoline_buffer_error, "No errors reported");