Fix print of value type in a corner case of finish
[deliverable/binutils-gdb.git] / gdb / infcmd.c
index 9a1fb8d71307b698c56a525eb1267a38e833d978..3737b8f6f1cfed1892a0c029317c2ef4ee2f7a6e 100644 (file)
@@ -1607,10 +1607,16 @@ print_return_value (struct value *function, struct type *value_type)
     }
   else
     {
+      struct cleanup *oldchain;
+      char *type_name;
+
+      type_name = type_to_string (value_type);
+      oldchain = make_cleanup (xfree, type_name);
       ui_out_text (uiout, "Value returned has type: ");
-      ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
+      ui_out_field_string (uiout, "return-type", type_name);
       ui_out_text (uiout, ".");
       ui_out_text (uiout, " Cannot determine contents\n");
+      do_cleanups (oldchain);
     }
 }
 
This page took 0.027976 seconds and 4 git commands to generate.