public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Make unlink_objfile and put_objfile_before static
Date: Wed, 23 Oct 2019 09:52:00 -0000	[thread overview]
Message-ID: <54d83b8d3920eea4a0d545f1ff7ac2923d938e6c@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 54d83b8d3920eea4a0d545f1ff7ac2923d938e6c ***

commit 54d83b8d3920eea4a0d545f1ff7ac2923d938e6c
Author:     Tom Tromey <tom@tromey.com>
AuthorDate: Sun Oct 20 20:41:20 2019 -0600
Commit:     Tom Tromey <tom@tromey.com>
CommitDate: Sun Oct 20 20:54:06 2019 -0600

    Make unlink_objfile and put_objfile_before static
    
    I noticed an obsolete comment just before unlink_objfile, and then I
    noticed that both unlink_objfile and put_objfile_before could be
    static.  This patch makes these changes, and also moves unlink_objfile
    earlier, so that a forward declaration is not needed.
    
    Tested by rebuilding.
    
    gdb/ChangeLog
    2019-10-20  Tom Tromey  <tom@tromey.com>
    
            * objfiles.h (unlink_objfile, put_objfile_before): Don't declare.
            * objfiles.c (unlink_objfile): Move earlier.  Now static.  Remove
            obsolete comment.
            (put_objfile_before): Now static.
    
    Change-Id: I1b5927a60fd1cc59bfc9c6761f61652a01ef13e0

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7c737ac9f4..67de8488e1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2019-10-20  Tom Tromey  <tom@tromey.com>
+
+	* objfiles.h (unlink_objfile, put_objfile_before): Don't declare.
+	* objfiles.c (unlink_objfile): Move earlier.  Now static.  Remove
+	obsolete comment.
+	(put_objfile_before): Now static.
+
 2019-10-19  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* gdbsupport/common-utils.h (startswith): Change return type to
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index f1e708de0f..fd1cbf764d 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -473,10 +473,31 @@ separate_debug_iterator::operator++ ()
   return *this;
 }
 
+/* Unlink OBJFILE from the list of known objfiles.  */
+
+static void
+unlink_objfile (struct objfile *objfile)
+{
+  struct objfile **objpp;
+
+  for (objpp = &object_files; *objpp != NULL; objpp = &((*objpp)->next))
+    {
+      if (*objpp == objfile)
+	{
+	  *objpp = (*objpp)->next;
+	  objfile->next = NULL;
+	  return;
+	}
+    }
+
+  internal_error (__FILE__, __LINE__,
+		  _("unlink_objfile: objfile already unlinked"));
+}
+
 /* Put one object file before a specified on in the global list.
    This can be used to make sure an object file is destroyed before
    another when using objfiles_safe to free all objfiles.  */
-void
+static void
 put_objfile_before (struct objfile *objfile, struct objfile *before_this)
 {
   struct objfile **objp;
@@ -497,38 +518,6 @@ put_objfile_before (struct objfile *objfile, struct objfile *before_this)
 		  _("put_objfile_before: before objfile not in list"));
 }
 
-/* Unlink OBJFILE from the list of known objfiles, if it is found in the
-   list.
-
-   It is not a bug, or error, to call this function if OBJFILE is not known
-   to be in the current list.  This is done in the case of mapped objfiles,
-   for example, just to ensure that the mapped objfile doesn't appear twice
-   in the list.  Since the list is threaded, linking in a mapped objfile
-   twice would create a circular list.
-
-   If OBJFILE turns out to be in the list, we zap it's NEXT pointer after
-   unlinking it, just to ensure that we have completely severed any linkages
-   between the OBJFILE and the list.  */
-
-void
-unlink_objfile (struct objfile *objfile)
-{
-  struct objfile **objpp;
-
-  for (objpp = &object_files; *objpp != NULL; objpp = &((*objpp)->next))
-    {
-      if (*objpp == objfile)
-	{
-	  *objpp = (*objpp)->next;
-	  objfile->next = NULL;
-	  return;
-	}
-    }
-
-  internal_error (__FILE__, __LINE__,
-		  _("unlink_objfile: objfile already unlinked"));
-}
-
 /* Add OBJFILE as a separate debug objfile of PARENT.  */
 
 void
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 2d92120870..aa8e32081e 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -637,12 +637,8 @@ extern CORE_ADDR entry_point_address (void);
 
 extern void build_objfile_section_table (struct objfile *);
 
-extern void put_objfile_before (struct objfile *, struct objfile *);
-
 extern void add_separate_debug_objfile (struct objfile *, struct objfile *);
 
-extern void unlink_objfile (struct objfile *);
-
 extern void free_objfile_separate_debug (struct objfile *);
 
 extern void free_all_objfiles (void);


             reply	other threads:[~2019-10-23  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23  9:52 gdb-buildbot [this message]
2019-10-23  9:53 ` Failures on Ubuntu-Aarch64-m64, branch master gdb-buildbot
2019-10-23 12:03 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2019-11-06 19:16 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2019-11-06 20:52 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2019-11-06 22:13 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2019-11-06 22:24 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

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=54d83b8d3920eea4a0d545f1ff7ac2923d938e6c@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).