* function.c (thread_prologue_and_epilogue_insns): Put a line note
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Feb 2000 20:15:50 +0000 (20:15 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Feb 2000 20:15:50 +0000 (20:15 +0000)
after the prologue.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32037 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/function.c

index 99ea250..9248a10 100644 (file)
@@ -1,3 +1,8 @@
+2000-02-17  Mark Mitchell  <mark@codesourcery.com>
+
+       * function.c (thread_prologue_and_epilogue_insns): Put a line note
+       after the prologue.
+
 2000-02-17  Nick Clifton  <nickc@cygnus.com>
 
        * config/arm/thumb.c: Replace includes of system headers with
index dd4bcb9..914cc95 100644 (file)
@@ -6626,6 +6626,8 @@ thread_prologue_and_epilogue_insns (f)
 #ifdef HAVE_prologue
   if (HAVE_prologue)
     {
+      rtx insn;
+
       start_sequence ();
       seq = gen_prologue();
       emit_insn (seq);
@@ -6634,8 +6636,27 @@ thread_prologue_and_epilogue_insns (f)
       if (GET_CODE (seq) != SEQUENCE)
        seq = get_insns ();
       prologue = record_insns (seq);
-
       emit_note (NULL, NOTE_INSN_PROLOGUE_END);
+
+      /* GDB handles `break f' by setting a breakpoint on the first
+        line note *after* the prologue.  That means that we should
+        insert a line note here; otherwise, if the next line note
+        comes part way into the next block, GDB will skip all the way
+        to that point.  */
+      insn = next_nonnote_insn (f);
+      while (insn)
+       {
+         if (GET_CODE (insn) == NOTE 
+             && NOTE_LINE_NUMBER (insn) >= 0)
+           {
+             emit_line_note_force (NOTE_SOURCE_FILE (insn),
+                                   NOTE_LINE_NUMBER (insn));
+             break;
+           }
+
+         insn = PREV_INSN (insn);
+       }
+
       seq = gen_sequence ();
       end_sequence ();