* gdbarch.sh (software_single_step): Replace REGCACHE argument by
[deliverable/binutils-gdb.git] / gdb / solib-frv.c
index 128a5434d0b63f5a4b615dc190c9e56fd6e4b78e..f9f966df57a87b38ddef65cad7df5392cf787773 100644 (file)
@@ -1,6 +1,5 @@
 /* Handle FR-V (FDPIC) shared libraries for GDB, the GNU Debugger.
-   Copyright (C) 2004
-   Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,6 +23,7 @@
 #include "gdb_string.h"
 #include "inferior.h"
 #include "gdbcore.h"
+#include "solib.h"
 #include "solist.h"
 #include "frv-tdep.h"
 #include "objfiles.h"
@@ -361,6 +361,14 @@ lm_base (void)
   CORE_ADDR addr;
   gdb_byte buf[FRV_PTR_SIZE];
 
+  /* One of our assumptions is that the main executable has been relocated.
+     Bail out if this has not happened.  (Note that post_create_inferior()
+     in infcmd.c will call solib_add prior to solib_create_inferior_hook().
+     If we allow this to happen, lm_base_cache will be initialized with
+     a bogus value.  */
+  if (main_executable_lm_info == 0)
+    return 0;
+
   /* If we already have a cached value, return it.  */
   if (lm_base_cache)
     return lm_base_cache;
This page took 0.024526 seconds and 4 git commands to generate.