Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [commit] symfile.c (simple_overlay_update): Check for null return.
Date: Sat, 05 Mar 2011 00:56:00 -0000	[thread overview]
Message-ID: <4D718A22.3020302@vmware.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 13 bytes --]

checked in.


[-- Attachment #2: null14.txt --]
[-- Type: text/plain, Size: 1701 bytes --]

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

	* symfile.c (simple_overlay_update): Check for null return value
	from lookup_minimal_symbol.

Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.307
diff -u -p -r1.307 symfile.c
--- symfile.c	26 Feb 2011 02:07:09 -0000	1.307
+++ symfile.c	5 Mar 2011 00:51:07 -0000
@@ -3432,15 +3432,24 @@ simple_overlay_update (struct obj_sectio
   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

             reply	other threads:[~2011-03-05  0:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-05  0:56 Michael Snyder [this message]
2011-03-07 11:07 ` can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.") Joel Brobecker
2011-03-07 11:30   ` can we avoid using contractions in GDB messages? Eli Zaretskii
2011-03-07 12:14     ` Joel Brobecker
2011-03-07 19:07   ` Michael Snyder
2011-03-07 19:19     ` Paul Koning
2011-03-08  4:54       ` Joel Brobecker
2011-03-07 21:58   ` can we avoid using contractions in GDB messages? (was: "[commit] symfile.c (simple_overlay_update): Check for null return.") Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D718A22.3020302@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox