gdbsupport: make gdb_open_cloexec return scoped_fd
[binutils-gdb.git] / gdb / stack.c
index a3a6ba6c41966ccd82da1a15b101a188cd22cbe9..7c4cf9491cc28653d5e34954a1f791f9d3d1fabc 100644 (file)
@@ -427,17 +427,14 @@ print_frame_arg (const frame_print_options &fp_opts,
 
   annotate_arg_emitter arg_emitter;
   ui_out_emit_tuple tuple_emitter (uiout, NULL);
-  fprintf_symbol_filtered (&stb, arg->sym->print_name (),
-                          arg->sym->language (), DMGL_PARAMS | DMGL_ANSI);
+  fputs_filtered (arg->sym->print_name (), &stb);
   if (arg->entry_kind == print_entry_values_compact)
     {
       /* It is OK to provide invalid MI-like stream as with
         PRINT_ENTRY_VALUE_COMPACT we never use MI.  */
       stb.puts ("=");
 
-      fprintf_symbol_filtered (&stb, arg->sym->print_name (),
-                              arg->sym->language (),
-                              DMGL_PARAMS | DMGL_ANSI);
+      fputs_filtered (arg->sym->print_name (), &stb);
     }
   if (arg->entry_kind == print_entry_values_only
       || arg->entry_kind == print_entry_values_compact)
@@ -1005,11 +1002,11 @@ print_pc (struct ui_out *uiout, struct gdbarch *gdbarch, frame_info *frame,
 
   std::string flags = gdbarch_get_pc_address_flags (gdbarch, frame, pc);
   if (!flags.empty ())
-  {
-    uiout->text (" [");
-    uiout->field_string ("addr_flags", flags);
-    uiout->text ("]");
-  }
+    {
+      uiout->text (" [");
+      uiout->field_string ("addr_flags", flags);
+      uiout->text ("]");
+    }
 }
 
 /* See stack.h.  */
@@ -1368,8 +1365,7 @@ print_frame (const frame_print_options &fp_opts,
     annotate_frame_function_name ();
 
     string_file stb;
-    fprintf_symbol_filtered (&stb, funname ? funname.get () : "??",
-                            funlang, DMGL_ANSI);
+    fputs_filtered (funname ? funname.get () : "??", &stb);
     uiout->field_stream ("func", stb, function_name_style.style ());
     uiout->wrap_hint ("   ");
     annotate_frame_args ();
@@ -1564,8 +1560,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
   if (funname)
     {
       printf_filtered (" in ");
-      fprintf_symbol_filtered (gdb_stdout, funname, funlang,
-                              DMGL_ANSI | DMGL_PARAMS);
+      fputs_filtered (funname, gdb_stdout);
     }
   wrap_here ("   ");
   if (sal.symtab)
@@ -1927,7 +1922,7 @@ public:
     struct frame_info *fid;
 
     if (args == NULL)
-    error (_("Missing address argument to view a frame"));
+      error (_("Missing address argument to view a frame"));
 
     gdb_argv argv (args);
 
@@ -2327,6 +2322,8 @@ do_print_variable_and_value (const char *print_name,
   if (p->treg.has_value ()
       && !treg_matches_sym_type_name (*p->treg, sym))
     return;
+  if (language_def (sym->language ())->symbol_printing_suppressed (sym))
+    return;
 
   frame = frame_find_by_id (p->frame_id);
   if (frame == NULL)
@@ -2769,7 +2766,7 @@ return_command (const char *retval_exp, int from_tty)
       if (thisfun != NULL)
        return_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (thisfun));
       if (return_type == NULL)
-       {
+       {
          if (retval_expr->first_opcode () != UNOP_CAST
              && retval_expr->first_opcode () != UNOP_CAST_TYPE)
            error (_("Return value type not available for selected "
@@ -3508,17 +3505,19 @@ With a negative COUNT, print outermost -COUNT frames."),
   add_com_alias ("bt", backtrace_cmd, class_stack, 0);
 
   add_com_alias ("where", backtrace_cmd, class_stack, 0);
-  add_info ("stack", backtrace_command,
-           _("Backtrace of the stack, or innermost COUNT frames."));
-  add_info_alias ("s", "stack", 1);
-
-  add_prefix_cmd ("frame", class_info, &info_frame_cmd.base_command,
-                 _("All about the selected stack frame.\n\
+  cmd_list_element *info_stack_cmd
+    = add_info ("stack", backtrace_command,
+               _("Backtrace of the stack, or innermost COUNT frames."));
+  add_info_alias ("s", info_stack_cmd, 1);
+
+  cmd_list_element *info_frame_cmd_el
+    = add_prefix_cmd ("frame", class_info, &info_frame_cmd.base_command,
+                     _("All about the selected stack frame.\n\
 With no arguments, displays information about the currently selected stack\n\
 frame.  Alternatively a frame specification may be provided (See \"frame\")\n\
 the information is then printed about the specified frame."),
-                 &info_frame_cmd_list, 1, &infolist);
-  add_info_alias ("f", "frame", 1);
+                     &info_frame_cmd_list, 1, &infolist);
+  add_info_alias ("f", info_frame_cmd_el, 1);
 
   add_cmd ("address", class_stack, &info_frame_cmd.address,
           _("\