diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 68d7aebbbf7..d221af89744 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -126,8 +126,36 @@ struct thread_control_state
   CORE_ADDR step_range_start = 0;	/* Inclusive */
   CORE_ADDR step_range_end = 0;		/* Exclusive */
 
-  /* Function the thread was in as of last it started stepping.  */
-  struct symbol *step_start_function = nullptr;
+  /* Set m_step_start_function according to FRAME.  */
+  void set_step_start_function (const frame_info_ptr &frame)
+  {
+    m_step_start_function = get_frame_function (frame);
+  }
+
+  /* Reset step_start_function.  */
+  void reset_step_start_function ()
+  {
+    m_step_start_function = nullptr;
+  }
+
+  /* Return true if the function symbol of FRAME matches
+     m_step_start_function.  */
+  bool in_step_start_function (const frame_info_ptr &frame) const
+  {
+    return m_step_start_function == get_frame_function (frame);
+  }
+
+  /* Return true if step_start_function is set.  */
+  bool step_start_function_p () const
+  {
+    return m_step_start_function != nullptr;
+  }
+
+  /* Return step_start_function.  */
+  const struct symbol *step_start_function () const
+  {
+    return m_step_start_function;
+  }
 
   /* If GDB issues a target step request, and this is nonzero, the
      target should single-step this thread once, and then continue
@@ -176,6 +204,10 @@ struct thread_control_state
 
   /* True if the thread is evaluating a BP condition.  */
   bool in_cond_eval = false;
+
+private:
+  /* Function the thread was in when it last started stepping.  */
+  const struct symbol *m_step_start_function = nullptr;
 };
 
 /* Inferior thread specific part of `struct infcall_suspend_state'.  */
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 98b45f884b1..17691633def 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -898,8 +898,7 @@ set_step_frame (thread_info *tp)
   symtab_and_line sal = find_frame_sal (frame);
   set_step_info (tp, frame, sal);
 
-  CORE_ADDR pc = get_frame_pc (frame);
-  tp->control.step_start_function = find_symbol_for_pc (pc);
+  tp->control.set_step_start_function (frame);
 }
 
 /* Step until outside of current statement.  */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index aa1c3553131..0af8c67d554 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3099,7 +3099,7 @@ clear_proceed_status_thread (struct thread_info *tp)
   tp->control.step_frame_id = null_frame_id;
   tp->control.step_stack_frame_id = null_frame_id;
   tp->control.step_over_calls = STEP_OVER_UNDEBUGGABLE;
-  tp->control.step_start_function = nullptr;
+  tp->control.reset_step_start_function ();
   tp->stop_requested = false;
 
   tp->control.stop_step = 0;
@@ -7751,9 +7751,9 @@ process_event_stop_test (struct execution_control_state *ecs)
   if (execution_direction != EXEC_REVERSE
       && ecs->event_thread->control.step_over_calls == STEP_OVER_UNDEBUGGABLE
       && in_solib_dynsym_resolve_code (ecs->event_thread->stop_pc ())
-      && (ecs->event_thread->control.step_start_function == nullptr
+      && (!ecs->event_thread->control.step_start_function_p ()
 	  || !in_solib_dynsym_resolve_code (
-	       ecs->event_thread->control.step_start_function->value_block ()
+	       ecs->event_thread->control.step_start_function ()->value_block ()
 		->entry_pc ())))
     {
       CORE_ADDR pc_after_resolver =
@@ -7877,8 +7877,7 @@ process_event_stop_test (struct execution_control_state *ecs)
 	   == ecs->event_thread->control.step_stack_frame_id)
 	  && ((ecs->event_thread->control.step_stack_frame_id
 	       != outer_frame_id)
-	      || (ecs->event_thread->control.step_start_function
-		  != find_symbol_for_pc (ecs->event_thread->stop_pc ())))))
+	      || !ecs->event_thread->control.in_step_start_function (frame))))
     {
       CORE_ADDR stop_pc = ecs->event_thread->stop_pc ();
       CORE_ADDR real_stop_pc;
@@ -9365,8 +9364,7 @@ print_stop_location (const target_waitstatus &ws)
       if (frame_info_ptr frame = get_current_frame ();
 	  tp->control.stop_step
 	  && (tp->control.step_frame_id == get_frame_id (frame))
-	  && (tp->control.step_start_function
-	      == find_symbol_for_pc (tp->stop_pc ())))
+	  && tp->control.in_step_start_function (frame))
 	{
 	  symtab_and_line sal = find_frame_sal (frame);
 	  if (sal.symtab != tp->current_symtab)
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-extend-inline-block.exp b/gdb/testsuite/gdb.dwarf2/dw2-extend-inline-block.exp
index 9e4798b53f3..481dfbdd134 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-extend-inline-block.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-extend-inline-block.exp
@@ -52,8 +52,11 @@ get_func_info main
 # Create DWARF for the test.  In this case, inline function 'foo' is created
 # with a contiguous address range that needs extending.
 
-proc build_dwarf_for_contiguous_block { asm_file } {
+proc build_dwarf_for_contiguous_block { asm_file {range_correct 0} {variant 0} } {
     Dwarf::assemble $asm_file {
+	upvar range_correct range_correct
+	upvar variant variant
+
 	declare_labels lines_table inline_func
 
 	cu { } {
@@ -83,7 +86,11 @@ proc build_dwarf_for_contiguous_block { asm_file } {
 			DW_AT_call_file 1 data1
 			DW_AT_call_line $::foo_call_line data1
 			DW_AT_low_pc main_1 addr
-			DW_AT_high_pc main_3 addr
+			if {$range_correct} {
+			    DW_AT_high_pc main_4 addr
+			} else {
+			    DW_AT_high_pc main_3 addr
+			}
 		    }
 		}
 	    }
@@ -120,10 +127,15 @@ proc build_dwarf_for_contiguous_block { asm_file } {
 		DW_LNS_copy
 
 		DW_LNE_set_address main_4
+		if {$variant == 1} {
+		    DW_LNS_advance_line 1
+		}
 		DW_LNS_copy
 
 		DW_LNE_set_address main_5
-		DW_LNS_advance_line 1
+		if {$variant == 0} {
+		    DW_LNS_advance_line 1
+		}
 		DW_LNS_negate_stmt
 		DW_LNS_copy
 
@@ -146,6 +158,22 @@ proc build_dwarf_for_contiguous_block { asm_file } {
     }
 }
 
+# Like build_dwarf_for_contiguous_block, but use a slightly different line
+# info by setting variant == 1.
+# Use range_correct 1, so we're not testing the fix for PR33930.
+
+proc build_dwarf_for_contiguous_block_2 { asm_file } {
+    return [build_dwarf_for_contiguous_block $asm_file 1 1]
+}
+
+# Like build_dwarf_for_contiguous_block, but use a slightly different line
+# info by setting variant == 1.
+# Use range_correct 0, so we're testing the fix for PR33930.
+
+proc build_dwarf_for_contiguous_block_3 { asm_file } {
+    return [build_dwarf_for_contiguous_block $asm_file 0 1]
+}
+
 # Assuming GDB is stopped at the entry $pc for 'foo', use 'maint info
 # blocks' to check the block for 'foo' is correct.  This function checks
 # 'foo' created by 'build_dwarf_for_contiguous_block'.
@@ -555,6 +583,12 @@ set test_list \
 	 [list "contiguous block" \
 	      build_dwarf_for_contiguous_block \
 	      check_contiguous_block] \
+	 [list "contiguous block 2" \
+	      build_dwarf_for_contiguous_block_2 \
+	      check_contiguous_block] \
+	 [list "contiguous block 3" \
+	      build_dwarf_for_contiguous_block_3 \
+	      check_contiguous_block] \
 	]
 
 # Run all the tests.
@@ -566,6 +600,11 @@ foreach test_spec $test_list {
     set build_dwarf_func [lindex $test_spec 1]
     set check_block_func [lindex $test_spec 2]
 
+    if {$build_dwarf_func == "build_dwarf_for_contiguous_block_3"} {
+	# Work around PR gdb/33930.
+	continue
+    }
+
     with_test_prefix $prefix {
 	set asm_file [standard_output_file ${testfile}-${suffix}.S]
 	$build_dwarf_func $asm_file
diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp
index 12db0709fe6..9bfc32f58b3 100644
--- a/gdb/testsuite/gdb.opt/inline-cmds.exp
+++ b/gdb/testsuite/gdb.opt/inline-cmds.exp
@@ -176,24 +176,35 @@ if { $bt_test == 0 } {
 # "stop" at the call sites before entering them.
 runto_main
 
-set msg "step into func1"
-set saw_call_site 0
-gdb_test_multiple "list" $msg {
-    -re "($first|$opt).*$gdb_prompt $" {
+set saw_call_site false
+set saw_main_frame false
+# Don't send the command using gdb_test_multiple, as it will be
+# injected into the regexp that start with '^' and use '-wrap', and we
+# send a different command using 'send_gdb' within the gdb_test_multiple.
+send_gdb "list\r"
+gdb_test_multiple "" "step into func1" {
+    -re "^(list|step)\r\n" {
+	exp_continue
+    }
+    -re -wrap "^\[^\r\n\]*($first|$opt)\[^\r\n\]*" {
 	send_gdb "step\r"
 	exp_continue
     }
-    -re "result = func1.*$gdb_prompt $" {
-	set saw_call_site 1
+    -re -wrap "^\[^\r\n\]*y = 8\[^\r\n\]*" {
+	send_gdb "step\r"
+	exp_continue
+    }
+    -re "^main \\(\\) at \[^\r\n\]+\r\n" {
+	set saw_main_frame true
+	exp_continue
+    }
+    -re -wrap "^\[^\r\n\]*result = func1 \\(\\);" {
+	set saw_call_site true
 	send_gdb "step\r"
 	exp_continue
     }
     -re "func1 \\\(\\\) at .*\r\n$decimal.*bar \\\(\\\);\r\n$gdb_prompt $" {
-	if { $saw_call_site } {
-	    pass $msg
-	} else {
-	    fail $msg
-	}
+	gdb_assert { $saw_call_site && !$saw_main_frame } $gdb_test_name
     }
 }
 
