/* MI Command Set.
- Copyright (C) 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 2000-2016 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
static int
collect_cores (struct thread_info *ti, void *xdata)
{
- struct collect_cores_data *data = xdata;
+ struct collect_cores_data *data = (struct collect_cores_data *) xdata;
if (ptid_get_pid (ti->ptid) == data->pid)
{
static int
print_one_inferior (struct inferior *inferior, void *xdata)
{
- struct print_one_inferior_data *top_data = xdata;
+ struct print_one_inferior_data *top_data
+ = (struct print_one_inferior_data *) xdata;
struct ui_out *uiout = current_uiout;
if (VEC_empty (int, top_data->inferiors)
static void
free_vector_of_ints (void *xvector)
{
- VEC (int) **vector = xvector;
+ VEC (int) **vector = (VEC (int) **) xvector;
VEC_free (int, *vector);
}
static void
free_splay_tree (void *xt)
{
- splay_tree t = xt;
+ splay_tree t = (splay_tree) xt;
splay_tree_delete (t);
}
/* Create a buffer and read it in. */
total_bytes = word_size * nr_rows * nr_cols;
- mbuf = xcalloc (total_bytes, 1);
+ mbuf = XCNEWVEC (gdb_byte, total_bytes);
make_cleanup (xfree, mbuf);
/* Dispatch memory reads to the topmost target, not the flattened
struct cleanup *t = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
char *data, *p;
int i;
+ int alloc_len;
ui_out_field_core_addr (uiout, "begin", gdbarch, read_result->begin);
ui_out_field_core_addr (uiout, "offset", gdbarch, read_result->begin
- addr);
ui_out_field_core_addr (uiout, "end", gdbarch, read_result->end);
- data = xmalloc (
- (read_result->end - read_result->begin) * 2 * unit_size + 1);
+ alloc_len = (read_result->end - read_result->begin) * 2 * unit_size + 1;
+ data = (char *) xmalloc (alloc_len);
for (i = 0, p = data;
i < ((read_result->end - read_result->begin) * unit_size);
/* FIXME: ezannoni 2000-02-17 LONGEST could possibly not be big
enough when using a compiler other than GCC. */
LONGEST value;
- void *buffer;
+ gdb_byte *buffer;
struct cleanup *old_chain;
long offset = 0;
int oind = 0;
/* Get the value as a number. */
value = parse_and_eval_address (argv[3]);
/* Get the value into an array. */
- buffer = xmalloc (word_size);
+ buffer = (gdb_byte *) xmalloc (word_size);
old_chain = make_cleanup (xfree, buffer);
store_signed_integer (buffer, word_size, byte_order, value);
/* Write it down to memory. */
else
count_units = len_units;
- databuf = xmalloc (len_bytes * sizeof (gdb_byte));
+ databuf = XNEWVEC (gdb_byte, len_bytes);
back_to = make_cleanup (xfree, databuf);
for (i = 0; i < len_bytes; ++i)
{
/* Pattern is made of less units than count:
repeat pattern to fill memory. */
- data = xmalloc (count_units * unit_size);
+ data = (gdb_byte *) xmalloc (count_units * unit_size);
make_cleanup (xfree, data);
/* Number of times the pattern is entirely repeated. */
if (do_timings)
{
- command->cmd_start = (struct mi_timestamp *)
- xmalloc (sizeof (struct mi_timestamp));
+ command->cmd_start = XNEW (struct mi_timestamp);
timestamp (command->cmd_start);
}
=thread-selected is supposed to indicate user's intentions. */
&& strcmp (command->command, "thread-select") != 0)
{
- struct mi_interp *mi = top_level_interpreter_data ();
+ struct mi_interp *mi
+ = (struct mi_interp *) top_level_interpreter_data ();
int report_change = 0;
if (command->thread == -1)
if (tsv != NULL)
{
- tsvname = xrealloc (tsvname, strlen (tsv->name) + 2);
+ tsvname = (char *) xrealloc (tsvname, strlen (tsv->name) + 2);
tsvname[0] = '$';
strcpy (tsvname + 1, tsv->name);
ui_out_field_string (uiout, "name", tsvname);
ui_out_field_core_addr (uiout, "address", gdbarch, r->start);
ui_out_field_int (uiout, "length", r->length);
- data = xmalloc (r->length);
+ data = (gdb_byte *) xmalloc (r->length);
make_cleanup (xfree, data);
if (memory_contents)
int m;
char *data_str, *p;
- data_str = xmalloc (r->length * 2 + 1);
+ data_str = (char *) xmalloc (r->length * 2 + 1);
make_cleanup (xfree, data_str);
for (m = 0, p = data_str; m < r->length; ++m, p += 2)