From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9848 invoked by alias); 5 Mar 2011 00:56:10 -0000 Received: (qmail 9840 invoked by uid 22791); 5 Mar 2011 00:56:09 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 05 Mar 2011 00:56:04 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 32E811A015 for ; Fri, 4 Mar 2011 16:56:03 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost2.vmware.com (Postfix) with ESMTP id 28CE28F158 for ; Fri, 4 Mar 2011 16:56:03 -0800 (PST) Message-ID: <4D718A22.3020302@vmware.com> Date: Sat, 05 Mar 2011 00:56:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: [commit] symfile.c (simple_overlay_update): Check for null return. Content-Type: multipart/mixed; boundary="------------040605080400010101090608" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00353.txt.bz2 This is a multi-part message in MIME format. --------------040605080400010101090608 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 13 checked in. --------------040605080400010101090608 Content-Type: text/plain; name="null14.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="null14.txt" Content-length: 1701 2011-03-04 Michael Snyder * 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 --------------040605080400010101090608--