* ada-lang.c (ada_make_symbol_completion_list): Add 'code'
[deliverable/binutils-gdb.git] / gdb / completer.c
index 7954c2c0d36b259f8a4c318e9fb62da573bd5cd1..946717d1af8f0f2b73ffa3a6bfcf940ae46be506 100644 (file)
@@ -390,13 +390,14 @@ expression_completer (struct cmd_list_element *ignore,
   struct type *type = NULL;
   char *fieldname, *p;
   volatile struct gdb_exception except;
+  enum type_code code = TYPE_CODE_UNDEF;
 
   /* Perform a tentative parse of the expression, to see whether a
      field completion is required.  */
   fieldname = NULL;
   TRY_CATCH (except, RETURN_MASK_ERROR)
     {
-      type = parse_expression_for_completion (text, &fieldname);
+      type = parse_expression_for_completion (text, &fieldname, &code);
     }
   if (except.reason < 0)
     return NULL;
@@ -422,6 +423,15 @@ expression_completer (struct cmd_list_element *ignore,
          return result;
        }
     }
+  else if (fieldname && code != TYPE_CODE_UNDEF)
+    {
+      VEC (char_ptr) *result;
+      struct cleanup *cleanup = make_cleanup (xfree, fieldname);
+
+      result = make_symbol_completion_type (fieldname, fieldname, code);
+      do_cleanups (cleanup);
+      return result;
+    }
   xfree (fieldname);
 
   /* Commands which complete on locations want to see the entire
This page took 0.023493 seconds and 4 git commands to generate.