Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] rs6000-nat.c: Call target_new_objfile_hook
Date: Fri, 12 Jul 2002 12:10:00 -0000	[thread overview]
Message-ID: <1020712190012.ZM7376@localhost.localdomain> (raw)

I've just committed the patch below.

While reviewing this patch, I was wondering why Nick needed to call
target_new_objfile_hook() directly.  The shared lib loading machinery
of other ports call symbol_file_add() instead.

It turns out that the ldinfo machinery in rs6000-tdep.c does much of
the work of symbol_file_add().  Apparently it can't call
symbol_file_add() directly since one of the pieces of information
obtained from the ldinfo is a file descriptor for the symbol file.  It
seems to me that if the name is always available, it might be better
to ignore the fd obtained from from the ldinfo and simply allow
symbol_file_add() to (re)open the file as is done on other ports.  I
haven't convinced myself that this will work yet though.  Also, there
may be other reasons why the rs6000 port does things the way they do.

So... since there are a number of things to sort out, I decided to
leave cleanup of the rs6000 shared lib machinery for another day
and commit Nick's patch instead.  (As noted in a comment below, this
patch is needed for AIX thread support.)

	From Nicholas Duffek:
	* rs6000-nat.c (vmap_ldinfo, xcoff_relocate_core): Call
	target_new_objfile_hook.

Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.23
diff -u -p -r1.23 rs6000-nat.c
--- rs6000-nat.c	21 Mar 2002 13:52:57 -0000	1.23
+++ rs6000-nat.c	12 Jul 2002 18:39:05 -0000
@@ -832,6 +832,11 @@ vmap_ldinfo (LdInfo *ldi)
 	  /* relocate symbol table(s). */
 	  vmap_symtab (vp);
 
+	  /* Announce new object files.  Doing this after symbol relocation
+	     makes aix-thread.c's job easier. */
+	  if (target_new_objfile_hook && vp->objfile)
+	    target_new_objfile_hook (vp->objfile);
+
 	  /* There may be more, so we don't break out of the loop.  */
 	}
 
@@ -1109,6 +1114,9 @@ xcoff_relocate_core (struct target_ops *
 	}
 
       vmap_symtab (vp);
+
+      if (target_new_objfile_hook && vp != vmap && vp->objfile)
+	target_new_objfile_hook (vp->objfile);
     }
   while (LDI_NEXT (ldi, arch64) != 0);
   vmap_exec ();


                 reply	other threads:[~2002-07-12 19:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1020712190012.ZM7376@localhost.localdomain \
    --to=kevinb@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