aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/infrun.c7
-rw-r--r--gdb/testsuite/gdb.base/rtld-step-nodebugsym.c25
-rw-r--r--gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp32
3 files changed, 61 insertions, 3 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 5ff0dc4..6da46b7 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -6956,9 +6956,10 @@ 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 ())
- && !in_solib_dynsym_resolve_code (
- ecs->event_thread->control.step_start_function->value_block ()
- ->entry_pc ()))
+ && (ecs->event_thread->control.step_start_function == nullptr
+ || !in_solib_dynsym_resolve_code (
+ ecs->event_thread->control.step_start_function->value_block ()
+ ->entry_pc ())))
{
CORE_ADDR pc_after_resolver =
gdbarch_skip_solib_resolver (gdbarch, ecs->event_thread->stop_pc ());
diff --git a/gdb/testsuite/gdb.base/rtld-step-nodebugsym.c b/gdb/testsuite/gdb.base/rtld-step-nodebugsym.c
new file mode 100644
index 0000000..2e01da6
--- /dev/null
+++ b/gdb/testsuite/gdb.base/rtld-step-nodebugsym.c
@@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2022 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+
+int
+main (void)
+{
+ printf ("hello world");
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp b/gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp
new file mode 100644
index 0000000..1c8fa47
--- /dev/null
+++ b/gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp
@@ -0,0 +1,32 @@
+# Copyright 2022 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test stepping through a runtime loader / dynamic linker (RTLD) without
+# debug info.
+
+standard_testfile
+
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
+ {nodebug}] } {
+ return
+}
+
+if { ![runto_main] } {
+ return
+}
+
+gdb_test "step" "Single stepping until exit from function.*"
+
+gdb_continue_to_end "" continue 1