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]

[patch] x86_64_skip_prologue


Hi all,
This patch removes the already unnecessary note about frame pointers and 
second it increments PC after verifying that a given function has a 
prologue. OK to commit?

2002-05-24  Michal Ludvig  <mludvig@suse.cz>

         * x86-64-tdep.c (x86_64_skip_prologue): Remove obsolete note.
         Let PC point right after the prologue before looking up symbols.

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* +420 2 9654 5373   * http://www.suse.cz
Index: x86-64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v
retrieving revision 1.19
diff -c -3 -p -r1.19 x86-64-tdep.c
*** x86-64-tdep.c	13 May 2002 14:00:36 -0000	1.19
--- x86-64-tdep.c	24 May 2002 09:59:14 -0000
*************** x86_64_skip_prologue (CORE_ADDR pc)
*** 859,881 ****
  
    read_memory (pc, (char *) prolog_buf, PROLOG_BUFSIZE);
  
!   /* First check, whether pc points to pushq %rbp. If not, 
!    * print a recommendation to enable frame pointer.  */
!   if (prolog_expect[0] != prolog_buf[0])
!     {
!       if (!omit_fp_note_printed)
! 	{
! 	  printf_filtered
! 	    ("NOTE: This function doesn't seem to have a valid prologue.\n"
! 	     "      Consider adding -fno-omit-frame-pointer to your gcc's CFLAGS.\n");
! 	  omit_fp_note_printed++;
! 	}
!       return pc;
!     }
!   /* Valid prolog continues with movq %rsp,%rbp.  */
!   for (i = 1; i < PROLOG_BUFSIZE; i++)
      if (prolog_expect[i] != prolog_buf[i])
!       return pc + 1;		/* First instruction after pushq %rbp.  */
  
    v_function = find_pc_function (pc);
    v_sal = find_pc_line (pc, 0);
--- 859,872 ----
  
    read_memory (pc, (char *) prolog_buf, PROLOG_BUFSIZE);
  
!   /* First check, whether pc points to pushq %rbp, movq %rsp,%rbp.  */
!   for (i = 0; i < PROLOG_BUFSIZE; i++)
      if (prolog_expect[i] != prolog_buf[i])
!       return pc;	/* ... no, it doesn't. Nothing to skip.  */
! 
!   /* OK, we have found the prologue and want PC of the first 
!      non-prologue instruction.  */
!   pc += PROLOG_BUFSIZE;
  
    v_function = find_pc_function (pc);
    v_sal = find_pc_line (pc, 0);

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