aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/infcmd.c14
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.opt/inline-cmds.exp17
4 files changed, 26 insertions, 16 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0abd3dd..bcd3786 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2021-04-06 Tom de Vries <tdevries@suse.de>
+ PR breakpoints/25884
+ * infcmd.c (prepare_one_step): Using inline frame info to narrow
+ stepping range.
+
+2021-04-06 Tom de Vries <tdevries@suse.de>
+
PR tui/27680
* tui/tui-disasm.c (len_without_escapes): Pass ptr pointing at escape
to style.parse.
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 9b0186d..60f25d2 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1013,6 +1013,20 @@ prepare_one_step (thread_info *tp, struct step_command_fsm *sm)
&tp->control.step_range_start,
&tp->control.step_range_end);
+ /* There's a problem in gcc (PR gcc/98780) that causes missing line
+ table entries, which results in a too large stepping range.
+ Use inlined_subroutine info to make the range more narrow. */
+ if (inline_skipped_frames (tp) > 0)
+ {
+ symbol *sym = inline_skipped_symbol (tp);
+ if (SYMBOL_CLASS (sym) == LOC_BLOCK)
+ {
+ const block *block = SYMBOL_BLOCK_VALUE (sym);
+ if (BLOCK_END (block) < tp->control.step_range_end)
+ tp->control.step_range_end = BLOCK_END (block);
+ }
+ }
+
tp->control.may_range_step = 1;
/* If we have no line info, switch to stepi mode. */
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f5fe029..c6063be 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2021-04-06 Tom de Vries <tdevries@suse.de>
+ PR breakpoints/25884
+ * gdb.opt/inline-cmds.exp: Remove kfail.
+
+2021-04-06 Tom de Vries <tdevries@suse.de>
+
PR testsuite/27691
* gdb.threads/gcore-thread.exp: Don't call gdb_core_cmd with core
file "".
diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp
index 17720c4..981dcbb 100644
--- a/gdb/testsuite/gdb.opt/inline-cmds.exp
+++ b/gdb/testsuite/gdb.opt/inline-cmds.exp
@@ -222,22 +222,7 @@ gdb_breakpoint $line3
gdb_continue_to_breakpoint "consecutive func1"
gdb_test "next" ".*func1 .*first call.*" "next to first func1"
-set msg "next to second func1"
-gdb_test_multiple "next" $msg {
- -re ".*func1 .*second call.*$gdb_prompt $" {
- pass $msg
- }
- -re ".*marker .*$gdb_prompt $" {
- # This assembles to two consecutive call instructions.
- # Both appear to be at the same line, because they're
- # in the body of the same inlined function. This is
- # reasonable for the line table. GDB should take the
- # containing block and/or function into account when
- # deciding how far to step. The single line table entry
- # is actually two consecutive instances of the same line.
- kfail gdb/25884 $msg
- }
-}
+gdb_test "next" ".*func1 .*second call.*" "next to second func1"
# It is easier when the two inlined functions are not on the same line.
set line4 [gdb_get_line_number "set breakpoint 4 here"]