Fix PR threads/19422 - show which thread caused stop
[deliverable/binutils-gdb.git] / gdb / completer.c
index 7fc27b17782b1e091cf8752bbdeff8ea7c426b10..5c3b3fcfaaeaa06acdb86aafe5987bc75c4dcc18 100644 (file)
@@ -1,5 +1,5 @@
 /* Line completion stuff for GDB, the GNU debugger.
-   Copyright (C) 2000-2015 Free Software Foundation, Inc.
+   Copyright (C) 2000-2016 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -165,14 +165,14 @@ filename_completer (struct cmd_list_element *ignore,
       else if (word > text)
        {
          /* Return some portion of p.  */
-         q = xmalloc (strlen (p) + 5);
+         q = (char *) xmalloc (strlen (p) + 5);
          strcpy (q, p + (word - text));
          xfree (p);
        }
       else
        {
          /* Return some of TEXT plus p.  */
-         q = xmalloc (strlen (p) + (text - word) + 5);
+         q = (char *) xmalloc (strlen (p) + (text - word) + 5);
          strncpy (q, word, text - word);
          q[text - word] = '\0';
          strcat (q, p);
@@ -358,14 +358,15 @@ collect_explicit_location_matches (struct event_location *location,
                                   const char *word)
 {
   VEC (char_ptr) *matches = NULL;
-  const struct explicit_location *explicit = get_explicit_location (location);
+  const struct explicit_location *explicit_loc
+    = get_explicit_location (location);
 
   switch (what)
     {
     case MATCH_SOURCE:
       {
-       const char *text = (explicit->source_filename == NULL
-                           ? "" : explicit->source_filename);
+       const char *text = (explicit_loc->source_filename == NULL
+                           ? "" : explicit_loc->source_filename);
 
        matches = make_source_files_completion_list (text, word);
       }
@@ -373,14 +374,14 @@ collect_explicit_location_matches (struct event_location *location,
 
     case MATCH_FUNCTION:
       {
-       const char *text = (explicit->function_name == NULL
-                           ? "" : explicit->function_name);
+       const char *text = (explicit_loc->function_name == NULL
+                           ? "" : explicit_loc->function_name);
 
-       if (explicit->source_filename != NULL)
+       if (explicit_loc->source_filename != NULL)
          {
-           matches
-             = make_file_symbol_completion_list (text, word,
-                                                 explicit->source_filename);
+           const char *filename = explicit_loc->source_filename;
+
+           matches = make_file_symbol_completion_list (text, word, filename);
          }
        else
          matches = make_symbol_completion_list (text, word);
@@ -451,7 +452,8 @@ explicit_location_completer (struct cmd_list_element *ignore,
       size_t len, offset;
       const char *new_word, *end;
       enum explicit_location_match_type what;
-      struct explicit_location *explicit = get_explicit_location (location);
+      struct explicit_location *explicit_loc
+       = get_explicit_location (location);
 
       /* Backup P to the previous word, which should be the option
         the user is attempting to complete.  */
@@ -463,17 +465,17 @@ explicit_location_completer (struct cmd_list_element *ignore,
       if (strncmp (p, "-source", len) == 0)
        {
          what = MATCH_SOURCE;
-         new_word = explicit->source_filename + offset;
+         new_word = explicit_loc->source_filename + offset;
        }
       else if (strncmp (p, "-function", len) == 0)
        {
          what = MATCH_FUNCTION;
-         new_word = explicit->function_name + offset;
+         new_word = explicit_loc->function_name + offset;
        }
       else if (strncmp (p, "-label", len) == 0)
        {
          what = MATCH_LABEL;
-         new_word = explicit->label_name + offset;
+         new_word = explicit_loc->label_name + offset;
        }
       else
        {
@@ -983,7 +985,7 @@ new_completion_tracker (void)
 static void
 free_completion_tracker (void *p)
 {
-  completion_tracker_t *tracker_ptr = p;
+  completion_tracker_t *tracker_ptr = (completion_tracker_t *) p;
 
   htab_delete (*tracker_ptr);
   *tracker_ptr = NULL;
@@ -1147,11 +1149,12 @@ signal_completer (struct cmd_list_element *ignore,
 /* Bit-flags for selecting what the register and/or register-group
    completer should complete on.  */
 
-enum reg_completer_targets
+enum reg_completer_target
   {
     complete_register_names = 0x1,
     complete_reggroup_names = 0x2
   };
+DEF_ENUM_FLAGS_TYPE (enum reg_completer_target, reg_completer_targets);
 
 /* Complete register names and/or reggroup names based on the value passed
    in TARGETS.  At least one bit in TARGETS must be set.  */
@@ -1159,7 +1162,7 @@ enum reg_completer_targets
 static VEC (char_ptr) *
 reg_or_group_completer_1 (struct cmd_list_element *ignore,
                          const char *text, const char *word,
-                         enum reg_completer_targets targets)
+                         reg_completer_targets targets)
 {
   VEC (char_ptr) *result = NULL;
   size_t len = strlen (word);
This page took 0.025769 seconds and 4 git commands to generate.