]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/skip.c
Make skip without argument skip the current inline function
[thirdparty/binutils-gdb.git] / gdb / skip.c
index 05be42ab58d73ea2e94c0d50212b4c6928006758..419dd7a46821f4f7f34087956ed432e82322159a 100644 (file)
@@ -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;
     }