* stack.c (print_frame_info_base): Print the frame's pc
authorKeith Seitz <keiths@redhat.com>
Sun, 13 Jan 2002 20:19:28 +0000 (20:19 +0000)
committerKeith Seitz <keiths@redhat.com>
Sun, 13 Jan 2002 20:19:28 +0000 (20:19 +0000)
only if when print_frame_info_listing_hook is not defined.

gdb/ChangeLog
gdb/stack.c

index 9099360cace648e8c913b5992f41e9509397c468..00c6701ecf68a916b70f954b0b3a7287cf993382 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-13  Keith Seitz  <keiths@redhat.com>
+
+       * stack.c (print_frame_info_base): Print the frame's pc
+       only if when print_frame_info_listing_hook is not defined.
+
 2002-01-13  Keith Seitz  <keiths@redhat.com>
 
        * varobj.c (varobj_set_value): Make sure that there were no
index 8300c65e24927594d4e2288ec8c09d9f2b1f7e8b..007ddadb64d31b8735a6b5429a86a869a7a683c7 100644 (file)
@@ -399,20 +399,31 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
                                     fi->pc);
       if (!done)
        {
-         if (addressprint && mid_statement)
+         if (print_frame_info_listing_hook)
+           print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0);
+         else
            {
+             /* We used to do this earlier, but that is clearly
+                wrong. This function is used by many different
+                parts of gdb, including normal_stop in infrun.c,
+                which uses this to print out the current PC
+                when we stepi/nexti into the middle of a source
+                line. Only the command line really wants this
+                behavior. Other UIs probably would like the
+                ability to decide for themselves if it is desired. */
+             if (addressprint && mid_statement)
+               {
 #ifdef UI_OUT
-             ui_out_field_core_addr (uiout, "addr", fi->pc);
-             ui_out_text (uiout, "\t");
+                 ui_out_field_core_addr (uiout, "addr", fi->pc);
+                 ui_out_text (uiout, "\t");
 #else
-             print_address_numeric (fi->pc, 1, gdb_stdout);
-             printf_filtered ("\t");
+                 print_address_numeric (fi->pc, 1, gdb_stdout);
+                 printf_filtered ("\t");
 #endif
+               }
+
+             print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
            }
-         if (print_frame_info_listing_hook)
-           print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0);
-         else
-           print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
        }
       current_source_line = max (sal.line - lines_to_list / 2, 1);
     }