]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-10-03 Jeff Johnston <jjohnstn@redhat.com>
authorJeff Johnston <jjohnstn@redhat.com>
Thu, 3 Oct 2002 22:34:58 +0000 (22:34 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Thu, 3 Oct 2002 22:34:58 +0000 (22:34 +0000)
        * ui-out.h (ui_out_field_fmt_int): New prototype.
        * ui-out.c (ui_out_field_fmt_int): New function allowing specification
        of field width and alignment.
        * stack.c (print_frame_info_base): When printing frame level, use
        ui_out_field_fmt_int with a width of 2 and left alignment.  Fix for
        PR gdb/192

gdb/ChangeLog
gdb/stack.c
gdb/ui-out.c
gdb/ui-out.h

index 70a673118842e330dc646cc75acf761442be3b6c..d300975cb4147cd58090f1fe0223752ab3f81c41 100644 (file)
@@ -1,3 +1,12 @@
+2002-10-03  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * ui-out.h (ui_out_field_fmt_int): New prototype.
+       * ui-out.c (ui_out_field_fmt_int): New function allowing specification
+       of field width and alignment.
+       * stack.c (print_frame_info_base): When printing frame level, use
+       ui_out_field_fmt_int with a width of 2 and left alignment.  Fix for
+       PR gdb/192
+
 2002-10-03  Jeff Johnston  <jjohnstn@redhat.com>
 
        * MAINTAINERS: Add self to Write After Approval list.
index b1cd9c7edde3a8166da944f39b20cc08da4bf1d1..f36e651a375f0739e3dfb158d80d021dd364bec1 100644 (file)
@@ -358,7 +358,10 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
       /* Do this regardless of SOURCE because we don't have any source
          to list for this frame.  */
       if (level >= 0)
-       printf_filtered ("#%-2d ", level);
+        {
+          ui_out_text (uiout, "#");
+          ui_out_field_fmt_int (uiout, 2, ui_left, "level", level);
+        }
       annotate_function_call ();
       printf_filtered ("<function called from gdb>\n");
       annotate_frame_end ();
@@ -371,7 +374,10 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
       /* Do this regardless of SOURCE because we don't have any source
          to list for this frame.  */
       if (level >= 0)
-       printf_filtered ("#%-2d ", level);
+        {
+          ui_out_text (uiout, "#");
+          ui_out_field_fmt_int (uiout, 2, ui_left, "level", level);
+        }
       annotate_signal_handler_caller ();
       printf_filtered ("<signal handler called>\n");
       annotate_frame_end ();
@@ -548,8 +554,7 @@ print_frame (struct frame_info *fi,
   if (level >= 0)
     {
       ui_out_text (uiout, "#");
-      ui_out_field_fmt (uiout, "level", "%-2d", level);
-      ui_out_spaces (uiout, 1);
+      ui_out_field_fmt_int (uiout, 2, ui_left, "level", level);
     }
   if (addressprint)
     if (fi->pc != sal.pc || !sal.symtab || source == LOC_AND_ADDRESS)
index 4a4a9228540c7d077f342a8de59a11677637f30f..da7740f4ca66eb7229b23f412aecb723fbd39f1d 100644 (file)
@@ -485,6 +485,23 @@ ui_out_field_int (struct ui_out *uiout,
   uo_field_int (uiout, fldno, width, align, fldname, value);
 }
 
+void
+ui_out_field_fmt_int (struct ui_out *uiout,
+                      int input_width,
+                      enum ui_align input_align,
+                     const char *fldname,
+                     int value)
+{
+  int fldno;
+  int width;
+  int align;
+  struct ui_out_level *current = current_level (uiout);
+
+  verify_field (uiout, &fldno, &width, &align);
+
+  uo_field_int (uiout, fldno, input_width, input_align, fldname, value);
+}
+
 void
 ui_out_field_core_addr (struct ui_out *uiout,
                        const char *fldname,
index 797c2fe960d3e2c99982c09c969d97ed3abeb4be..c8ed9dd504e73841d2ef3315743d8694ba58d2a5 100644 (file)
@@ -119,6 +119,10 @@ extern struct cleanup *make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout
 extern void ui_out_field_int (struct ui_out *uiout, const char *fldname,
                              int value);
 
+extern void ui_out_field_fmt_int (struct ui_out *uiout, int width,
+                                 enum ui_align align, const char *fldname, 
+                                 int value);
+
 extern void ui_out_field_core_addr (struct ui_out *uiout, const char *fldname,
                                    CORE_ADDR address);