aboutsummaryrefslogtreecommitdiff
path: root/gdb/skip.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2019-12-25 16:35:32 +0100
committerBernd Edlinger <bernd.edlinger@hotmail.de>2020-01-14 21:20:16 +0100
commit717c684dd1afe36293a256aa2bce4b3af56402c5 (patch)
tree0d2e12e16f47a0806a7fb63d843e4e250b7719bc /gdb/skip.c
parente44925ae5689fc997b833d039e971484f54bd8c0 (diff)
downloadfsf-binutils-gdb-717c684dd1afe36293a256aa2bce4b3af56402c5.zip
fsf-binutils-gdb-717c684dd1afe36293a256aa2bce4b3af56402c5.tar.gz
fsf-binutils-gdb-717c684dd1afe36293a256aa2bce4b3af56402c5.tar.bz2
Make skip without argument skip the current inline function
Previously always the outermost function block was used, but since skip is now able to skip over inline functions it is more natural to skip the inline function that the program is currently executing. gdb: 2020-01-14 Bernd Edlinger <bernd.edlinger@hotmail.de> * skip.c (skip_function_command): Make skip w/o arguments use the name of the inlined function if pc is inside any inlined function. gdb/testsuite: 2020-01-14 Bernd Edlinger <bernd.edlinger@hotmail.de> * gdb.base/skip-inline.exp: Extend test.
Diffstat (limited to 'gdb/skip.c')
-rw-r--r--gdb/skip.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/gdb/skip.c b/gdb/skip.c
index 05be42a..419dd7a 100644
--- a/gdb/skip.c
+++ b/gdb/skip.c
@@ -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;
}