diff options
author | Michael Snyder <msnyder@vmware.com> | 2011-03-05 00:52:41 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2011-03-05 00:52:41 +0000 |
commit | 9cc8966527dbd97792d9ff46398f7a15853ad6fc (patch) | |
tree | ee3437934d192445ea723444c5d18a09461e521a /gdb/symfile.c | |
parent | cfdee94ab418b8ee1b2e5aba6f9de8fc3771b4fb (diff) | |
download | gdb-9cc8966527dbd97792d9ff46398f7a15853ad6fc.zip gdb-9cc8966527dbd97792d9ff46398f7a15853ad6fc.tar.gz gdb-9cc8966527dbd97792d9ff46398f7a15853ad6fc.tar.bz2 |
2011-03-04 Michael Snyder <msnyder@vmware.com>
* symfile.c (simple_overlay_update): Check for null return value
from lookup_minimal_symbol.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index 4e0d287..de0b369 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 |