summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2011-03-05 00:52:40 +0000
committerMichael Snyder <msnyder@specifix.com>2011-03-05 00:52:40 +0000
commitc9b457b27759bcdb9fecd960957345d0d3c86064 (patch)
treeb69045fff326317b399b1b11137efb5c96955201
parenta87a7f2c898ba901ffa25e6abd809f4397b60d1d (diff)
downloadgdb-c9b457b27759bcdb9fecd960957345d0d3c86064.tar.gz
2011-03-04 Michael Snyder <msnyder@vmware.com>
* symfile.c (simple_overlay_update): Check for null return value from lookup_minimal_symbol.
-rw-r--r--gdb/ChangeLog3
-rw-r--r--gdb/symfile.c27
2 files changed, 21 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 043be2ee64c..949fcd2a693 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,8 @@
2011-03-04 Michael Snyder <msnyder@vmware.com>
+ * symfile.c (simple_overlay_update): Check for null return value
+ from lookup_minimal_symbol.
+
* gdbserver/server.c (queue_stop_reply): Call xmalloc not malloc.
* xml-syscall.c (syscall_start_syscall): Assert name is non null.
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 4e0d2875a04..de0b3694390 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3432,15 +3432,24 @@ simple_overlay_update (struct obj_section *osect)
if (osect)
/* Have we got a cached copy of the target's overlay table? */
if (cache_ovly_table != NULL)
- /* Does its cached location match what's currently in the symtab? */
- if (cache_ovly_table_base ==
- SYMBOL_VALUE_ADDRESS (lookup_minimal_symbol ("_ovly_table",
- NULL, NULL)))
- /* Then go ahead and try to look up this single section in the
- cache. */
- if (simple_overlay_update_1 (osect))
- /* Found it! We're done. */
- return;
+ {
+ /* Does its cached location match what's currently in the
+ symtab? */
+ struct minimal_symbol *minsym
+ = lookup_minimal_symbol ("_ovly_table", NULL, NULL);
+
+ if (minsym == NULL)
+ error (_("Error reading inferior's overlay table: couldn't "
+ "find `_ovly_table' array\n"
+ "in inferior. Use `overlay manual' mode."));
+
+ if (cache_ovly_table_base == SYMBOL_VALUE_ADDRESS (minsym))
+ /* Then go ahead and try to look up this single section in
+ the cache. */
+ if (simple_overlay_update_1 (osect))
+ /* Found it! We're done. */
+ return;
+ }
/* Cached table no good: need to read the entire table anew.
Or else we want all the sections, in which case it's actually