This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Make solib-frv.c work again
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 27 Apr 2007 15:24:59 -0700
- Subject: [commit] Make solib-frv.c work again
At some point in the past year (or so), loading of FR-V shared
libraries became broken. I have committed the patch below which fixes
this situation.
* solib-frv.c (lm_base): Bail out if the main executable has
not been relocated.
Index: solib-frv.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-frv.c,v
retrieving revision 1.15
diff -u -p -r1.15 solib-frv.c
--- solib-frv.c 20 Feb 2007 12:45:06 -0000 1.15
+++ solib-frv.c 27 Apr 2007 22:17:02 -0000
@@ -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;