Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jerome Guitton <guitton@act-europe.fr>
To: binutils@sources.redhat.com, gdb-patches@sources.redhat.com
Subject: Re: [RFA] bfd_cache_close_all
Date: Thu, 17 Jun 2004 11:51:00 -0000	[thread overview]
Message-ID: <20040617125107.GD8722@act-europe.fr> (raw)
In-Reply-To: <20040617022241.GF3596@bubble.modra.org>

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

Alan Modra (amodra@bigpond.net.au):

> No need to close oldest first.  OK with the following change to simplify
> the code.
> 
>   while (bfd_last_cache != NULL)
>     ret &= bfd_cache_close (bfd_last_cache);

Thanks. Patch committed.

-- 
Jerome

[-- Attachment #2: bfd_cache_close_all.dif --]
[-- Type: text/plain, Size: 2170 bytes --]

2004-06-17  Jerome Guitton  <guitton@gnat.com>

	* bfd-in.h (bfd_cache_close_all): New function declaration.
	* bfd-in2.h: Regenerate.
	* cache.c (bfd_cache_close_all): New function definition.

Index: bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.81
diff -u -r1.81 bfd-in.h
--- bfd-in.h	15 Jun 2004 01:24:22 -0000	1.81
+++ bfd-in.h	17 Jun 2004 10:34:24 -0000
@@ -511,6 +511,8 @@
   (bfd *abfd);
 /* NB: This declaration should match the autogenerated one in libbfd.h.  */
 
+extern bfd_boolean bfd_cache_close_all (void);
+
 extern bfd_boolean bfd_record_phdr
   (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
    bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
Index: bfd-in2.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in2.h,v
retrieving revision 1.280
diff -u -r1.280 bfd-in2.h
--- bfd-in2.h	15 Jun 2004 01:24:22 -0000	1.280
+++ bfd-in2.h	17 Jun 2004 10:34:24 -0000
@@ -518,6 +518,8 @@
   (bfd *abfd);
 /* NB: This declaration should match the autogenerated one in libbfd.h.  */
 
+extern bfd_boolean bfd_cache_close_all (void);
+
 extern bfd_boolean bfd_record_phdr
   (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
    bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
Index: cache.c
===================================================================
RCS file: /cvs/src/src/bfd/cache.c,v
retrieving revision 1.14
diff -u -r1.14 cache.c
--- cache.c	5 May 2004 15:39:11 -0000	1.14
+++ cache.c	17 Jun 2004 10:34:25 -0000
@@ -344,6 +344,31 @@
 }
 
 /*
+FUNCTION
+	bfd_cache_close_all
+
+SYNOPSIS
+	bfd_boolean bfd_cache_close_all (void);
+
+DESCRIPTION
+	Remove all BFDs from the cache. If the attached file is open,
+	then close it too.
+
+RETURNS
+	<<FALSE>> is returned if closing one of the file fails, <<TRUE>> is
+	returned if all is well.
+*/
+
+bfd_boolean
+bfd_cache_close_all ()
+{
+  bfd_boolean ret = TRUE;
+
+  while (bfd_last_cache != NULL)
+    ret &= bfd_cache_close (bfd_last_cache);
+}
+
+/*
 INTERNAL_FUNCTION
 	bfd_open_file
 

  reply	other threads:[~2004-06-17 11:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-16 16:17 Jerome Guitton
2004-06-17  2:22 ` Alan Modra
2004-06-17 11:51   ` Jerome Guitton [this message]
2004-06-17 11:58     ` Jerome Guitton
2004-06-17 12:09       ` Alan Modra
2004-06-17 12:11         ` Jerome Guitton

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=20040617125107.GD8722@act-europe.fr \
    --to=guitton@act-europe.fr \
    --cc=binutils@sources.redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /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