Fix enum flag with Python 3
[deliverable/binutils-gdb.git] / gdb / tracepoint.c
index 1e079e9fc13670ac098db73f4cdd6d253435c046..bc45470153e504f631e8a87340a2f008fe1ce6e9 100644 (file)
@@ -1,6 +1,6 @@
 /* Tracing functionality for remote targets in custom GDB protocol
 
-   Copyright (C) 1997-2015 Free Software Foundation, Inc.
+   Copyright (C) 1997-2016 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -860,7 +860,8 @@ static int memrange_cmp (const void *, const void *);
 static int
 memrange_cmp (const void *va, const void *vb)
 {
-  const struct memrange *a = va, *b = vb;
+  const struct memrange *a = (const struct memrange *) va;
+  const struct memrange *b = (const struct memrange *) vb;
 
   if (a->type < b->type)
     return -1;
@@ -948,8 +949,8 @@ add_memrange (struct collection_list *memranges,
   if (memranges->next_memrange >= memranges->listsize)
     {
       memranges->listsize *= 2;
-      memranges->list = xrealloc (memranges->list,
-                                 memranges->listsize);
+      memranges->list = (struct memrange *) xrealloc (memranges->list,
+                                                     memranges->listsize);
     }
 
   if (type != memrange_absolute)    /* Better collect the base register!  */
@@ -1137,7 +1138,7 @@ do_collect_symbol (const char *print_name,
                   struct symbol *sym,
                   void *cb_data)
 {
-  struct add_local_symbols_data *p = cb_data;
+  struct add_local_symbols_data *p = (struct add_local_symbols_data *) cb_data;
 
   collect_symbol (p->collect, sym, p->gdbarch, p->frame_regno,
                  p->frame_offset, p->pc, p->trace_string);
@@ -1231,7 +1232,7 @@ clear_collection_list (struct collection_list *list)
 static void
 do_clear_collection_list (void *list)
 {
-  struct collection_list *l = list;
+  struct collection_list *l = (struct collection_list *) list;
 
   clear_collection_list (l);
 }
@@ -1244,12 +1245,10 @@ init_collection_list (struct collection_list *clist)
   memset (clist, 0, sizeof *clist);
 
   clist->listsize = 128;
-  clist->list = xcalloc (clist->listsize,
-                        sizeof (struct memrange));
+  clist->list = XCNEWVEC (struct memrange, clist->listsize);
 
   clist->aexpr_listsize = 128;
-  clist->aexpr_list = xcalloc (clist->aexpr_listsize,
-                              sizeof (struct agent_expr *));
+  clist->aexpr_list = XCNEWVEC (struct agent_expr *, clist->aexpr_listsize);
 }
 
 /* Reduce a collection list to string form (for gdb protocol).  */
@@ -1708,9 +1707,9 @@ add_aexpr (struct collection_list *collect, struct agent_expr *aexpr)
 {
   if (collect->next_aexpr_elt >= collect->aexpr_listsize)
     {
-      collect->aexpr_list =
-       xrealloc (collect->aexpr_list,
-                 2 * collect->aexpr_listsize * sizeof (struct agent_expr *));
+      collect->aexpr_list = XRESIZEVEC (struct agent_expr *,
+                                       collect->aexpr_list,
+                                       2 * collect->aexpr_listsize);
       collect->aexpr_listsize *= 2;
     }
   collect->aexpr_list[collect->next_aexpr_elt] = aexpr;
@@ -2721,7 +2720,7 @@ scope_info (char *args, int from_tty)
 
   location = string_to_event_location (&args, current_language);
   back_to = make_cleanup_delete_event_location (location);
-  sals = decode_line_1 (location, DECODE_LINE_FUNFIRSTLINE, NULL, 0);
+  sals = decode_line_1 (location, DECODE_LINE_FUNFIRSTLINE, NULL, NULL, 0);
   if (sals.nelts == 0)
     {
       /* Presumably decode_line_1 has already warned.  */
@@ -2947,7 +2946,7 @@ trace_dump_actions (struct command_line *action,
                        {
                          size_t len = next_comma - action_exp;
 
-                         cmd = xrealloc (cmd, len + 1);
+                         cmd = (char *) xrealloc (cmd, len + 1);
                          memcpy (cmd, action_exp, len);
                          cmd[len] = 0;
                        }
@@ -2955,7 +2954,7 @@ trace_dump_actions (struct command_line *action,
                        {
                          size_t len = strlen (action_exp);
 
-                         cmd = xrealloc (cmd, len + 1);
+                         cmd = (char *) xrealloc (cmd, len + 1);
                          memcpy (cmd, action_exp, len + 1);
                        }
 
@@ -3236,7 +3235,8 @@ struct current_traceframe_cleanup
 static void
 do_restore_current_traceframe_cleanup (void *arg)
 {
-  struct current_traceframe_cleanup *old = arg;
+  struct current_traceframe_cleanup *old
+    = (struct current_traceframe_cleanup *) arg;
 
   set_current_traceframe (old->traceframe_number);
 }
@@ -3244,7 +3244,8 @@ do_restore_current_traceframe_cleanup (void *arg)
 static void
 restore_current_traceframe_cleanup_dtor (void *arg)
 {
-  struct current_traceframe_cleanup *old = arg;
+  struct current_traceframe_cleanup *old
+    = (struct current_traceframe_cleanup *) arg;
 
   xfree (old);
 }
@@ -3627,7 +3628,7 @@ Status line: '%s'\n"), p, line);
            }
          else if (p2 != p1)
            {
-             ts->stop_desc = xmalloc (strlen (line));
+             ts->stop_desc = (char *) xmalloc (strlen (line));
              end = hex2bin (p1, (gdb_byte *) ts->stop_desc, (p2 - p1) / 2);
              ts->stop_desc[end] = '\0';
            }
@@ -3647,7 +3648,7 @@ Status line: '%s'\n"), p, line);
          p2 = strchr (++p1, ':');
          if (p2 != p1)
            {
-             ts->stop_desc = xmalloc ((p2 - p1) / 2 + 1);
+             ts->stop_desc = (char *) xmalloc ((p2 - p1) / 2 + 1);
              end = hex2bin (p1, (gdb_byte *) ts->stop_desc, (p2 - p1) / 2);
              ts->stop_desc[end] = '\0';
            }
@@ -3701,7 +3702,7 @@ Status line: '%s'\n"), p, line);
       else if (strncmp (p, "username", p1 - p) == 0)
        {
          ++p1;
-         ts->user_name = xmalloc (strlen (p) / 2);
+         ts->user_name = (char *) xmalloc (strlen (p) / 2);
          end = hex2bin (p1, (gdb_byte *) ts->user_name, (p3 - p1)  / 2);
          ts->user_name[end] = '\0';
          p = p3;
@@ -3709,7 +3710,7 @@ Status line: '%s'\n"), p, line);
       else if (strncmp (p, "notes", p1 - p) == 0)
        {
          ++p1;
-         ts->notes = xmalloc (strlen (p) / 2);
+         ts->notes = (char *) xmalloc (strlen (p) / 2);
          end = hex2bin (p1, (gdb_byte *) ts->notes, (p3 - p1) / 2);
          ts->notes[end] = '\0';
          p = p3;
@@ -3836,7 +3837,7 @@ parse_tracepoint_definition (char *line, struct uploaded_tp **utpp)
       p = unpack_varlen_hex (p, &xlen);
       p++;  /* skip a colon */
 
-      buf = alloca (strlen (line));
+      buf = (char *) alloca (strlen (line));
 
       end = hex2bin (p, (gdb_byte *) buf, strlen (p) / 2);
       buf[end] = '\0';
@@ -3873,7 +3874,7 @@ parse_tsv_definition (char *line, struct uploaded_tsv **utsvp)
   int end;
   struct uploaded_tsv *utsv = NULL;
 
-  buf = alloca (strlen (line));
+  buf = (char *) alloca (strlen (line));
 
   p = line;
   p = unpack_varlen_hex (p, &num);
@@ -3894,7 +3895,8 @@ parse_tsv_definition (char *line, struct uploaded_tsv **utsvp)
 void
 free_current_marker (void *arg)
 {
-  struct static_tracepoint_marker **marker_p = arg;
+  struct static_tracepoint_marker **marker_p
+    = (struct static_tracepoint_marker **) arg;
 
   if (*marker_p != NULL)
     {
@@ -3929,14 +3931,14 @@ parse_static_tracepoint_marker_definition (char *line, char **pp,
   if (endp == NULL)
     error (_("bad marker definition: %s"), line);
 
-  marker->str_id = xmalloc (endp - p + 1);
+  marker->str_id = (char *) xmalloc (endp - p + 1);
   end = hex2bin (p, (gdb_byte *) marker->str_id, (endp - p + 1) / 2);
   marker->str_id[end] = '\0';
 
   p += 2 * end;
   p++;  /* skip a colon */
 
-  marker->extra = xmalloc (strlen (p) + 1);
+  marker->extra = (char *) xmalloc (strlen (p) + 1);
   end = hex2bin (p, (gdb_byte *) marker->extra, strlen (p) / 2);
   marker->extra[end] = '\0';
 
@@ -4187,12 +4189,14 @@ traceframe_info_start_memory (struct gdb_xml_parser *parser,
                              const struct gdb_xml_element *element,
                              void *user_data, VEC(gdb_xml_value_s) *attributes)
 {
-  struct traceframe_info *info = user_data;
+  struct traceframe_info *info = (struct traceframe_info *) user_data;
   struct mem_range *r = VEC_safe_push (mem_range_s, info->memory, NULL);
   ULONGEST *start_p, *length_p;
 
-  start_p = xml_find_attribute (attributes, "start")->value;
-  length_p = xml_find_attribute (attributes, "length")->value;
+  start_p
+    = (ULONGEST *) xml_find_attribute (attributes, "start")->value;
+  length_p
+    = (ULONGEST *) xml_find_attribute (attributes, "length")->value;
 
   r->start = *start_p;
   r->length = *length_p;
@@ -4206,8 +4210,9 @@ traceframe_info_start_tvar (struct gdb_xml_parser *parser,
                             void *user_data,
                             VEC(gdb_xml_value_s) *attributes)
 {
-  struct traceframe_info *info = user_data;
-  const char *id_attrib = xml_find_attribute (attributes, "id")->value;
+  struct traceframe_info *info = (struct traceframe_info *) user_data;
+  const char *id_attrib
+    = (const char *) xml_find_attribute (attributes, "id")->value;
   int id = gdb_xml_parse_ulongest (parser, id_attrib);
 
   VEC_safe_push (int, info->tvars, id);
@@ -4218,7 +4223,7 @@ traceframe_info_start_tvar (struct gdb_xml_parser *parser,
 static void
 free_result (void *p)
 {
-  struct traceframe_info *result = p;
+  struct traceframe_info *result = (struct traceframe_info *) p;
 
   free_traceframe_info (result);
 }
This page took 0.027794 seconds and 4 git commands to generate.