Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: New function to read a descriptor's entry point
@ 2003-06-13 23:01 Jim Blandy
  2003-06-13 23:23 ` Kevin Buettner
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Blandy @ 2003-06-13 23:01 UTC (permalink / raw)
  To: gdb-patches


This is a trivial wrapper around read_memory_unsigned_integer, but
it's a bit clearer *why* one is reading that word if you use it.

2003-06-06  Jim Blandy  <jimb@redhat.com>

	* ppc-linux-tdep.c (ppc64_desc_entry_point): New function.
	(ppc64_standard_linkage_target): Use it.

Index: gdb/ppc-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v
retrieving revision 1.28.8.4
diff -c -r1.28.8.4 ppc-linux-tdep.c
*** gdb/ppc-linux-tdep.c	5 Jun 2003 23:53:03 -0000	1.28.8.4
--- gdb/ppc-linux-tdep.c	6 Jun 2003 23:54:31 -0000
***************
*** 730,735 ****
--- 730,745 ----
  }
  
  
+ /* If DESC is the address of a 64-bit PowerPC Linux function
+    descriptor, return the descriptor's entry point.  */
+ static CORE_ADDR
+ ppc64_desc_entry_point (CORE_ADDR desc)
+ {
+   /* The first word of the descriptor is the entry point.  */
+   return (CORE_ADDR) read_memory_unsigned_integer (desc, 8);
+ }
+ 
+ 
  /* Pattern for the standard linkage function.  These are built by
     build_plt_stub in elf64-ppc.c, whose GLINK argument is always
     zero.  */
***************
*** 864,870 ****
         + insn_ds_field (insn[2]));
  
    /* The first word of the descriptor is the entry point.  Return that.  */
!   return (CORE_ADDR) read_memory_unsigned_integer (desc, 8);
  }
  
  
--- 874,880 ----
         + insn_ds_field (insn[2]));
  
    /* The first word of the descriptor is the entry point.  Return that.  */
!   return ppc64_desc_entry_point (desc);
  }
  
  


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

* Re: RFA: New function to read a descriptor's entry point
  2003-06-13 23:01 RFA: New function to read a descriptor's entry point Jim Blandy
@ 2003-06-13 23:23 ` Kevin Buettner
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Buettner @ 2003-06-13 23:23 UTC (permalink / raw)
  To: Jim Blandy, gdb-patches

On Jun 13,  6:01pm, Jim Blandy wrote:

> This is a trivial wrapper around read_memory_unsigned_integer, but
> it's a bit clearer *why* one is reading that word if you use it.
> 
> 2003-06-06  Jim Blandy  <jimb@redhat.com>
> 
> 	* ppc-linux-tdep.c (ppc64_desc_entry_point): New function.
> 	(ppc64_standard_linkage_target): Use it.

Hmm.  I thought I okay'd this one already:

    http://sources.redhat.com/ml/gdb-patches/2003-06/msg00442.html
    http://sources.redhat.com/ml/gdb-patches/2003-06/msg00457.html

Anyway, it's still okay.  :-)

Kevin


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

end of thread, other threads:[~2003-06-13 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-13 23:01 RFA: New function to read a descriptor's entry point Jim Blandy
2003-06-13 23:23 ` Kevin Buettner

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