diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index 152afc21b9df..e10a6dda776b 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -504,6 +504,10 @@ darwin_solib_read_all_image_info_addr (struct darwin_info *info) static void darwin_solib_create_inferior_hook (int from_tty) { + /* Everything below only makes sense if we have a running inferior. */ + if (!target_has_execution ()) + return; + struct darwin_info *info = get_darwin_info (); CORE_ADDR load_addr;