]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/skip.c
[gdb/symtab] Make gold index workaround more precise
[thirdparty/binutils-gdb.git] / gdb / skip.c
index fcf41bf79a732d05ac7a4eebf12d2feeaf08e662..419dd7a46821f4f7f34087956ed432e82322159a 100644 (file)
@@ -1,6 +1,6 @@
 /* Skipping uninteresting files and functions while stepping.
 
-   Copyright (C) 2011-2019 Free Software Foundation, Inc.
+   Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -179,7 +179,7 @@ skip_file_command (const char *arg, int from_tty)
       if (symtab == NULL)
        error (_("No default file now."));
 
-      /* It is not a typo, symtab_to_filename_for_display woule be needlessly
+      /* It is not a typo, symtab_to_filename_for_display would be needlessly
         ambiguous.  */
       filename = symtab_to_fullname (symtab);
     }
@@ -209,18 +209,15 @@ skip_function_command (const char *arg, int from_tty)
   /* Default to the current function if no argument is given.  */
   if (arg == NULL)
     {
+      frame_info *fi = get_selected_frame (_("No default function now."));
+      struct symbol *sym = get_frame_function (fi);
       const char *name = NULL;
-      CORE_ADDR pc;
 
-      if (!last_displayed_sal_is_valid ())
-       error (_("No default function now."));
-
-      pc = get_last_displayed_addr ();
-      if (!find_pc_partial_function (pc, &name, NULL, NULL))
-       {
-         error (_("No function found containing current program point %s."),
-                 paddress (get_current_arch (), pc));
-       }
+      if (sym != NULL)
+       name = sym->print_name ();
+      else
+       error (_("No function found containing current program point %s."),
+              paddress (get_current_arch (), get_frame_pc (fi)));
       skip_function (name);
       return;
     }
@@ -415,7 +412,9 @@ info_skip_command (const char *arg, int from_tty)
       current_uiout->field_string ("file",
                                   e.file ().empty () ? "<none>"
                                   : e.file ().c_str (),
-                                  file_name_style.style ()); /* 4 */
+                                  e.file ().empty ()
+                                  ? metadata_style.style ()
+                                  : file_name_style.style ()); /* 4 */
       if (e.function_is_regexp ())
        current_uiout->field_string ("regexp", "y"); /* 5 */
       else
@@ -424,7 +423,9 @@ info_skip_command (const char *arg, int from_tty)
       current_uiout->field_string ("function",
                                   e.function ().empty () ? "<none>"
                                   : e.function ().c_str (),
-                                  function_name_style.style ()); /* 6 */
+                                  e.function ().empty ()
+                                  ? metadata_style.style ()
+                                  : function_name_style.style ()); /* 6 */
 
       current_uiout->text ("\n");
     }
@@ -661,8 +662,9 @@ complete_skip_number (cmd_list_element *cmd,
     }
 }
 
+void _initialize_step_skip ();
 void
-_initialize_step_skip (void)
+_initialize_step_skip ()
 {
   static struct cmd_list_element *skiplist = NULL;
   struct cmd_list_element *c;