Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa:ppc64] Use target in convert_from_func_ptr_addr
@ 2003-10-23  1:37 Andrew Cagney
  2003-10-23 16:00 ` Kevin Buettner
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2003-10-23  1:37 UTC (permalink / raw)
  To: gdb-patches

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

Hello,

The attached rewrites the PPC64 GNU/Linux convert_from_func_ptr_addr 
method so that it makes use of the explicit "struct target_ops" 
parameter  I recently added (previously it was indirectly using 
current_target).

ok?
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1116 bytes --]

2003-10-17  Andrew Cagney  <cagney@redhat.com>

	* ppc-linux-tdep.c (ppc64_linux_convert_from_func_ptr_addr):
	Rewrite to use target_ops when transfering memory.

Index: ppc-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v
retrieving revision 1.44
diff -u -r1.44 ppc-linux-tdep.c
--- ppc-linux-tdep.c	22 Oct 2003 23:54:11 -0000	1.44
+++ ppc-linux-tdep.c	23 Oct 2003 01:32:51 -0000
@@ -936,14 +936,14 @@
 					CORE_ADDR addr,
 					struct target_ops *targ)
 {
-  struct obj_section *s;
-
-  s = find_pc_section (addr);
-
-  /* Check if ADDR points to a function descriptor.  */
-  if (s && strcmp (s->the_bfd_section->name, ".opd") == 0)
-    return read_memory_unsigned_integer (addr, 8);
-
+  struct section_table *s = target_section_by_addr (targ, addr);
+  if (s != NULL && s->the_bfd_section != NULL
+      && strcmp (s->the_bfd_section->name, ".opd") == 0)
+    {
+      char desc[8];
+      target_read (targ, TARGET_OBJECT_MEMORY, NULL, desc, addr, 8);
+      return extract_unsigned_integer (desc, 8);
+    }
   return addr;
 }
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-10-24 20:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-23  1:37 [rfa:ppc64] Use target in convert_from_func_ptr_addr Andrew Cagney
2003-10-23 16:00 ` Kevin Buettner
2003-10-23 16:26   ` Andrew Cagney
2003-10-23 17:12     ` Kevin Buettner
2003-10-23 21:02       ` Andrew Cagney
2003-10-23 21:23         ` Kevin Buettner
2003-10-23 22:31           ` Andrew Cagney
2003-10-24 20:27           ` [commit] Add get_target_memory ... + " Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox