Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] solib_global_lookup: Fetch arch from objfile.
Date: Sat, 01 Nov 2014 02:28:00 -0000	[thread overview]
Message-ID: <m3tx2jbqpu.fsf@seba.sebabeach.org> (raw)

Hi.

solib_global_lookup should be using the objfile's arch,
not fetching it from global state.

Regression tested on amd64-linux.

2014-10-31  Doug Evans  <xdje42@gmail.com>

	* objfiles.c (get_objfile_arch): Constify.
	* objfiles.h (get_objfile_arch): Update prototype.
	* solib.c (solib_global_lookup): Fetch arch from objfile,
	not target_gdbarch.

diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 2a5c15f..38a365c 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -366,8 +366,9 @@ allocate_objfile (bfd *abfd, const char *name, int flags)
 }
 
 /* Retrieve the gdbarch associated with OBJFILE.  */
+
 struct gdbarch *
-get_objfile_arch (struct objfile *objfile)
+get_objfile_arch (const struct objfile *objfile)
 {
   return objfile->per_bfd->gdbarch;
 }
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 57a94e1..af80c0c 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -465,7 +465,7 @@ struct objfile
 
 extern struct objfile *allocate_objfile (bfd *, const char *name, int);
 
-extern struct gdbarch *get_objfile_arch (struct objfile *);
+extern struct gdbarch *get_objfile_arch (const struct objfile *);
 
 extern int entry_point_address_query (CORE_ADDR *entry_p);
 
diff --git a/gdb/solib.c b/gdb/solib.c
index 41250a2..6260dac 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1408,7 +1408,7 @@ solib_global_lookup (const struct objfile *objfile,
 		     const char *name,
 		     const domain_enum domain)
 {
-  const struct target_so_ops *ops = solib_ops (target_gdbarch ());
+  const struct target_so_ops *ops = solib_ops (get_objfile_arch (objfile));
 
   if (ops->lookup_lib_global_symbol != NULL)
     return ops->lookup_lib_global_symbol (objfile, name, domain);


             reply	other threads:[~2014-11-01  2:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-01  2:28 Doug Evans [this message]
2014-11-07  1:13 ` Doug Evans
2015-08-27 14:03 ` Cell multi-arch symbol lookup broken (Re: [PATCH] solib_global_lookup: Fetch arch from objfile.) Ulrich Weigand
2015-08-28  5:33   ` Doug Evans
2015-08-28 13:38     ` Ulrich Weigand
2015-08-28 16:07       ` Doug Evans
2015-08-28 17:20         ` Ulrich Weigand

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=m3tx2jbqpu.fsf@seba.sebabeach.org \
    --to=xdje42@gmail.com \
    --cc=gdb-patches@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