aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2019-10-18 14:28:45 +0200
committerSimon Marchi <simon.marchi@polymtl.ca>2019-12-16 21:02:22 -0500
commit4a4c04f1f4a926f986a77e72277c16e1b90c2b73 (patch)
treeb01e7e192667a386842233108969fa735a7166ac /gdb/infcmd.c
parent43a599b56c6651aad9f21a6e38d99a029e28440b (diff)
downloadfsf-binutils-gdb-4a4c04f1f4a926f986a77e72277c16e1b90c2b73.zip
fsf-binutils-gdb-4a4c04f1f4a926f986a77e72277c16e1b90c2b73.tar.gz
fsf-binutils-gdb-4a4c04f1f4a926f986a77e72277c16e1b90c2b73.tar.bz2
Check all inline frames if they are marked for skip
This makes the skip command work in optimized builds, where skipped functions may be inlined. Previously that was only working when stepping into a non-inlined function.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 2a25346..af66eaf 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -52,6 +52,7 @@
#include "thread-fsm.h"
#include "top.h"
#include "interps.h"
+#include "skip.h"
#include "gdbsupport/gdb_optional.h"
#include "source.h"
#include "cli/cli-style.h"
@@ -1106,14 +1107,29 @@ prepare_one_step (struct step_command_fsm *sm)
&& inline_skipped_frames (tp))
{
ptid_t resume_ptid;
+ const char *fn = NULL;
+ symtab_and_line sal;
+ struct symbol *sym;
/* Pretend that we've ran. */
resume_ptid = user_visible_resume_ptid (1);
set_running (resume_ptid, 1);
step_into_inline_frame (tp);
- sm->count--;
- return prepare_one_step (sm);
+
+ frame = get_current_frame ();
+ sal = find_frame_sal (frame);
+ sym = get_frame_function (frame);
+
+ if (sym != NULL)
+ fn = sym->print_name ();
+
+ if (sal.line == 0
+ || !function_name_is_marked_for_skip (fn, sal))
+ {
+ sm->count--;
+ return prepare_one_step (sm);
+ }
}
pc = get_frame_pc (frame);