This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Signal Trampoline Frames


Andrew,

It's probably too late now, but I have the feeling this new
tramp-frame.c is not generic enough.  It assumes fixed-length
instructions (which makes it unsuitable for IA-32 and AMD64) and uses
the arbitrary number 8 for the number of instructions (which makes it
not quite suitable for SPARC).  The whole thing seems a bit
over-engineered to me :-(.

Anyway, you might want to conseider the attached patch, which makes
the comments catch up with reality.  The extra whitespace is there to
guide the eye and make the distinction between the instruction
sequence members and the initialization function clear.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* tramp-frame.h (struct tramp_frame): Fix comments.

Index: tramp-frame.h
===================================================================
RCS file: /cvs/src/src/gdb/tramp-frame.h,v
retrieving revision 1.2
diff -u -p -r1.2 tramp-frame.h
--- tramp-frame.h 23 Mar 2004 14:12:30 -0000 1.2
+++ tramp-frame.h 24 Mar 2004 22:51:03 -0000
@@ -43,15 +43,16 @@ struct tramp_frame
 {
   /* The trampoline's entire instruction sequence.  Search for this in
      the inferior at or around the frame's PC.  It is assumed that the
-     PC is INSN_SIZE aligned, and that each element of TRAMP contains
-     one INSN_SIZE instruction.  It is also assumed that TRAMP[0]
+     PC is INSN_SIZE aligned, and that each element of INSN contains
+     one INSN_SIZE instruction.  It is also assumed that INSN[0]
      contains the first instruction of the trampoline and hence the
-     address of the instruction matching TRAMP[0] is the trampoline's
+     address of the instruction matching INSN[0] is the trampoline's
      "func" address.  */
   int insn_size;
   ULONGEST insn[8];
+
   /* Initialize a trad-frame cache corresponding to the tramp-frame.
-     FUNC is the address of the instruction TRAMP[0] in memory.  */
+     FUNC is the address of the instruction INSN[0] in memory.  */
   void (*init) (const struct tramp_frame *self,
 		struct frame_info *next_frame,
 		struct trad_frame_cache *this_cache,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]