This is the mail archive of the gdb-patches@sourceware.cygnus.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]

[rfc] SKIP_PROLOG_FRAMELESS_P -> PROLOG_FRAMELES_P multi-arch cleanup


Hello,

The attatched patches replace SKIP_PROLOG_FRAMELESS_P with a
multi-arched PROLOGUE_FRAMELESS_P.  Thoughts?

The old SKIP_PROLOGUE_FRAMELESS_P was wierd, the caller relied on the
address being changed for it to work.

	Andrew
Fri Apr 28 16:22:34 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* blockframe.c (frameless_look_for_prologue): Use
 	PROLOG_FRAMELESS_P instead of SKIP_PROLOGUE_FRAMELESS_P.
	* gdbarch.sh (PROLOG_FRAMELESS_P): Define.
	* gdbarch.h, gdbarch.c: Re-generate.
	* arch-utils.h, arch-utils.c (generic_prologue_frameless_p): New
 	function.
	
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.2
diff -p -r1.2 arch-utils.c
*** arch-utils.c	2000/04/19 23:22:14	1.2
--- arch-utils.c	2000/04/28 06:58:01
*************** generic_remote_translate_xfer_address (C
*** 133,138 ****
--- 133,148 ----
    *rem_len = gdb_len;
  }
  
+ int
+ generic_prologue_frameless_p (CORE_ADDR ip)
+ {
+ #ifdef SKIP_PROLOGUE_FRAMELESS_P
+   return ip == SKIP_PROLOGUE_FRAMELESS_P (ip)
+ #endif
+   return ip == SKIP_PROLOGUE (ip);
+ }
+ 
+ 
  /* */
  
  extern initialize_file_ftype __initialize_gdbarch_utils;
Index: arch-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.h,v
retrieving revision 1.2
diff -p -r1.2 arch-utils.h
*** arch-utils.h	2000/04/19 23:22:14	1.2
--- arch-utils.h	2000/04/28 06:58:01
*************** extern int legacy_sizeof_call_dummy_word
*** 54,57 ****
--- 54,62 ----
  /* Typical remote_translate_xfer_address */
  extern gdbarch_remote_translate_xfer_address_ftype generic_remote_translate_xfer_address;
  
+ /* Generic implementation of prologue_frameless_p.  Just calls
+    SKIP_PROLOG and checks the return value to see if it actually
+    changed. */
+ extern gdbarch_prologue_frameless_p_ftype generic_prologue_frameless_p;
+ 
  #endif
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.3
diff -p -r1.3 blockframe.c
*** blockframe.c	2000/04/26 02:53:02	1.3
--- blockframe.c	2000/04/28 06:58:05
*************** frameless_look_for_prologue (frame)
*** 300,314 ****
    if (func_start)
      {
        func_start += FUNCTION_START_OFFSET;
-       after_prologue = func_start;
- #ifdef SKIP_PROLOGUE_FRAMELESS_P
        /* This is faster, since only care whether there *is* a
           prologue, not how long it is.  */
!       after_prologue = SKIP_PROLOGUE_FRAMELESS_P (after_prologue);
! #else
!       after_prologue = SKIP_PROLOGUE (after_prologue);
! #endif
!       return after_prologue == func_start;
      }
    else if (frame->pc == 0)
      /* A frame with a zero PC is usually created by dereferencing a
--- 300,308 ----
    if (func_start)
      {
        func_start += FUNCTION_START_OFFSET;
        /* This is faster, since only care whether there *is* a
           prologue, not how long it is.  */
!       return PROLOGUE_FRAMELESS_P (func_start);
      }
    else if (frame->pc == 0)
      /* A frame with a zero PC is usually created by dereferencing a
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.15
diff -p -r1.15 gdbarch.sh
*** gdbarch.sh	2000/04/22 06:44:39	1.15
--- gdbarch.sh	2000/04/28 06:58:16
*************** f:2:FRAME_INIT_SAVED_REGS:void:frame_ini
*** 302,307 ****
--- 302,308 ----
  f:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0
  #
  f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
+ f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p:0
  f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0
  f:2:BREAKPOINT_FROM_PC:unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc:0
  f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint:0
Index: doc/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/doc/ChangeLog,v
retrieving revision 1.30
diff -p -r1.30 ChangeLog
Fri Apr 28 16:56:15 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* gdbint.texinfo (PROLOGUE_FRAMELESS_P): Add definition.
	(SKIP_PROLOGUE_FRAMELESS_P): Update definition.  Document as
 	deprecated.
	(SKIP_PROLOGUE): Update definition.
	
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.10
diff -p -r1.10 gdbint.texinfo
*** gdbint.texinfo	2000/04/17 10:46:50	1.10
--- gdbint.texinfo	2000/04/28 06:58:36
*************** appropriate format for the current archi
*** 1849,1854 ****
--- 1849,1859 ----
  address the pointer refers to.
  @xref{Target Architecture Definition, , Pointers Are Not Always Addresses}.
  
+ @deftypefn PROLOGUE_FRAMELESS_P (CORE_ADDR @var{pc})
+ A function that returns non-zero when the function at @var{pc} has no
+ frame.  If not defined, @code{SKIP_PROLOGUE} will be used to determine
+ if the function has a frame.
+ 
  @item REGISTER_CONVERTIBLE (@var{reg})
  Return non-zero if @var{reg} uses different raw and virtual formats.
  @xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}.
*************** state so that execution will resume just
*** 2013,2026 ****
  macro does the right thing even when the breakpoint is in the delay slot
  of a branch or jump.
  
! @item SKIP_PROLOGUE (pc)
  A C expression that returns the address of the ``real'' code beyond the
  function entry prologue found at @var{pc}.
  
! @item SKIP_PROLOGUE_FRAMELESS_P
  A C expression that should behave similarly, but that can stop as soon
  as the function is known to have a frame.  If not defined,
  @code{SKIP_PROLOGUE} will be used instead.
  
  @item SKIP_TRAMPOLINE_CODE (pc)
  If the target machine has trampoline code that sits between callers and
--- 2018,2033 ----
  macro does the right thing even when the breakpoint is in the delay slot
  of a branch or jump.
  
! @deftypefn {Target Macro} SKIP_PROLOGUE (CORE_ADDR @var{pc})
  A C expression that returns the address of the ``real'' code beyond the
  function entry prologue found at @var{pc}.
  
! @deftypefn {Target Macro} SKIP_PROLOGUE_FRAMELESS_P (CORE_ADDR @var{pc})
  A C expression that should behave similarly, but that can stop as soon
  as the function is known to have a frame.  If not defined,
  @code{SKIP_PROLOGUE} will be used instead.
+ 
+ This function has been deprecated in favor of @code{PROLOGUE_FRAMELESS_P}.
  
  @item SKIP_TRAMPOLINE_CODE (pc)
  If the target machine has trampoline code that sits between callers and

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