From patchwork Fri Feb 6 23:55:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 4951 Received: (qmail 7459 invoked by alias); 6 Feb 2015 23:55:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 7447 invoked by uid 89); 6 Feb 2015 23:55:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-oi0-f74.google.com Received: from mail-oi0-f74.google.com (HELO mail-oi0-f74.google.com) (209.85.218.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 06 Feb 2015 23:55:26 +0000 Received: by mail-oi0-f74.google.com with SMTP id a141so2450616oig.1 for ; Fri, 06 Feb 2015 15:55:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type; bh=ld1Y/0ATHrMlBziPueYNTyjUjbgBUPLlZ9qmVFbwV0Y=; b=CoxzoQ4nRcHMHfnEenniQH+HibRX4sFFbjnaFa4wzZzGm0Cy/2D9cI89umZ91dAF22 eZfMQkpRaathhIdsgqAqks4fP5nBkGFptyNp8+poRAFiU1t2tBxReKx4pxhMfc+faf5d Ot+jNkjIM5Ei8nsVlTt5BlfXL0fWzm5oAH1lbYV5NBS0qFCvhLjm53E8S+bkTeIr2Sqx RhMfXwhJmuV7NTV7m4K81r3lMOD2/p7GO/KYmPgGNEkVQQ1YuuSXqol0Tt53MQVSRIT1 WmMq95ULbM2OB2fJCopZ14cwIS8aPJ6zq15Oe4BP/PAVxKebOYG4ezJADD17f62UkB29 JgyA== X-Gm-Message-State: ALoCoQmpVoC/YqZWnHstEoECM1KKiPszODAa4m7VFvHWCII6qDjz2GAfK/y65CtZfw+hETAd033qi13qlSikKJVMn2MjYMOsBkG2CN1LaqEn7jZNU3zsyvllKfxxNzjlXYLipoyuIuw0ZkNFWnNVMeHHr6FnBVZEaLqoYuyekxFrI57k5PYNe/w= X-Received: by 10.182.249.12 with SMTP id yq12mr600851obc.46.1423266924228; Fri, 06 Feb 2015 15:55:24 -0800 (PST) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id s10si753547qcl.3.2015.02.06.15.55.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Feb 2015 15:55:24 -0800 (PST) Received: from ruffy.mtv.corp.google.com ([172.17.128.44]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTPS id UL81VCJ7.1; Fri, 06 Feb 2015 15:55:24 -0800 From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH] Rename new_symfile_objfile to finish_new_objfile. Date: Fri, 06 Feb 2015 15:55:23 -0800 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hi. I'm tempted to just commit this patch, but in case anyone wants to comment ... clear_symtab_users is in need of a bit of cleanup. I can see how doing things a little differently would make this part of gdb that much more obvious and clean. I started to go down this road but ran out of time (for the moment at least). I still want to get this part in. The name "new_symfile_objfile" is confusing. "symfile_objfile" has a very specific meaning: it is the piece of global state that records the "main" objfile. Thus one would naturally expect that new_symfile_objfile would only be called when there's a new main objfile. However, this is not the case. :-( To remove this bit of confusion this patch renames the function. And since it has only one caller in the same file I made it static. That helps limit the scope of things one needs to think about when cleaning up clear_symtab_users. 2015-02-06 Doug Evans * symfile.h (new_symfile_objfile): Delete. * symfile.c (finish_new_objfile): Renamed from new_symfile_objfile. All callers updated. diff --git a/gdb/symfile.c b/gdb/symfile.c index 5ae5000..c2a71ec 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1099,8 +1099,8 @@ syms_from_objfile (struct objfile *objfile, symbols for a new objfile, or mapping in the symbols from a reusable objfile. ADD_FLAGS is a bitmask of enum symfile_add_flags. */ -void -new_symfile_objfile (struct objfile *objfile, int add_flags) +static void +finish_new_objfile (struct objfile *objfile, int add_flags) { /* If this is the main symbol file we have to clean up all users of the old main symbol file. Otherwise it is sufficient to fixup all the @@ -1234,7 +1234,7 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name, int add_flags, return objfile; /* No symbols. */ } - new_symfile_objfile (objfile, add_flags); + finish_new_objfile (objfile, add_flags); observer_notify_new_objfile (objfile); diff --git a/gdb/symfile.h b/gdb/symfile.h index a22ee04..0bf40c1 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -458,8 +458,6 @@ enum symfile_add_flags SYMFILE_NO_READ = 1 << 4 }; -extern void new_symfile_objfile (struct objfile *, int); - extern struct objfile *symbol_file_add (const char *, int, struct section_addr_info *, int);