From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11388 invoked by alias); 6 Jan 2006 16:26:09 -0000 Received: (qmail 11375 invoked by uid 22791); 6 Jan 2006 16:26:06 -0000 X-Spam-Check-By: sourceware.org Received: from w099.z064220152.sjc-ca.dsl.cnc.net (HELO duck.specifix.com) (64.220.152.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 06 Jan 2006 16:26:04 +0000 Received: from [::1] (duck.specifix.com [64.220.152.99]) by duck.specifix.com (Postfix) with ESMTP id 66F98FC4E; Fri, 6 Jan 2006 08:25:55 -0800 (PST) From: Fred Fish Reply-To: fnf@specifix.com To: Jim Blandy Subject: [commit] Clear current source symtab if belongs to objfile being freed Date: Fri, 06 Jan 2006 16:26:00 -0000 User-Agent: KMail/1.9.1 Cc: gdb-patches@sourceware.org References: <200601031242.38425.fnf@specifix.com> <200601041558.09798.fnf@specifix.com> <8f2776cb0601051408va10ba1aw3ec142a066ba77fc@mail.gmail.com> In-Reply-To: <8f2776cb0601051408va10ba1aw3ec142a066ba77fc@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200601061126.38530.fnf@specifix.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00080.txt.bz2 On Thursday 05 January 2006 17:08, Jim Blandy wrote: > Okay. The original patch is fine; consider the doc change I suggested. Done. Here is the revised patch. -Fred 2006-01-06 Fred Fish * objfiles.c (source.h): Include. (free_objfile): Update comment about clear_symtab_users(). (free_objfile): Check all symtabs of objfile being freed and if one of them is the current source symtab, call clear_current_source_symtab_and_line(). Index: objfiles.c =================================================================== RCS file: /cvs/src/src/gdb/objfiles.c,v retrieving revision 1.62 diff -c -p -r1.62 objfiles.c *** objfiles.c 17 Dec 2005 22:34:01 -0000 1.62 --- objfiles.c 6 Jan 2006 16:22:26 -0000 *************** *** 45,50 **** --- 45,51 ---- #include "breakpoint.h" #include "block.h" #include "dictionary.h" + #include "source.h" /* Prototypes for local functions */ *************** free_objfile (struct objfile *objfile) *** 432,441 **** is unknown, but we play it safe for now and keep each action until it is shown to be no longer needed. */ ! /* I *think* all our callers call clear_symtab_users. If so, no need ! to call this here. */ clear_pc_function_cache (); /* The last thing we do is free the objfile struct itself. */ objfile_free_data (objfile); --- 433,456 ---- is unknown, but we play it safe for now and keep each action until it is shown to be no longer needed. */ ! /* Not all our callers call clear_symtab_users (objfile_purge_solibs, ! for example), so we need to call this here. */ clear_pc_function_cache (); + /* Check to see if the current_source_symtab belongs to this objfile, + and if so, call clear_current_source_symtab_and_line. */ + + { + struct symtab_and_line cursal = get_current_source_symtab_and_line (); + struct symtab *s; + + ALL_OBJFILE_SYMTABS (objfile, s) + { + if (s == cursal.symtab) + clear_current_source_symtab_and_line (); + } + } + /* The last thing we do is free the objfile struct itself. */ objfile_free_data (objfile);