2011-03-04 Michael Snyder <msnyder@vmware.com>

* symfile.c (simple_overlay_update): Check for null return value
	from lookup_minimal_symbol.
This commit is contained in:
Michael Snyder 2011-03-05 00:52:41 +00:00
parent cfdee94ab4
commit 9cc8966527
2 changed files with 21 additions and 9 deletions

View file

@ -1,5 +1,8 @@
2011-03-04 Michael Snyder <msnyder@vmware.com> 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. * gdbserver/server.c (queue_stop_reply): Call xmalloc not malloc.
* xml-syscall.c (syscall_start_syscall): Assert name is non null. * xml-syscall.c (syscall_start_syscall): Assert name is non null.

View file

@ -3432,15 +3432,24 @@ simple_overlay_update (struct obj_section *osect)
if (osect) if (osect)
/* Have we got a cached copy of the target's overlay table? */ /* Have we got a cached copy of the target's overlay table? */
if (cache_ovly_table != NULL) if (cache_ovly_table != NULL)
/* Does its cached location match what's currently in the symtab? */ {
if (cache_ovly_table_base == /* Does its cached location match what's currently in the
SYMBOL_VALUE_ADDRESS (lookup_minimal_symbol ("_ovly_table", symtab? */
NULL, NULL))) struct minimal_symbol *minsym
/* Then go ahead and try to look up this single section in the = lookup_minimal_symbol ("_ovly_table", NULL, NULL);
cache. */
if (simple_overlay_update_1 (osect)) if (minsym == NULL)
/* Found it! We're done. */ error (_("Error reading inferior's overlay table: couldn't "
return; "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. /* Cached table no good: need to read the entire table anew.
Or else we want all the sections, in which case it's actually Or else we want all the sections, in which case it's actually