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

Re: [RFC] -thread-select double print stack frame



args.print_what = ui_out_is_mi_like_p (uiout) ? LOC_AND_ADDRESS : print_what

in print_stack_frame, to centralise things and remove the need for the clause
in normal_stop.


Attach is a patch that fits Nick's comments and fixes the "double print" bug.
Stack frame printing under MI is centralized into print_stack_frame which alway prints location and address.
We don't need anymore specific code in infrun.c, but also is the -thread-info command I've submitted last week.


Ok for commit ?
--
Denis

2007-03-26 Denis Pilat <denis.pilat@st.com>

	* stack.c (print_stack_frame): alway use LOC_AND_ADDRESS in mi output.
	* infrun.c (normal_stop): remove mi specific frame printing treatment.

Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.142
diff -u -p -r1.142 stack.c
--- stack.c     27 Feb 2007 19:46:04 -0000      1.142
+++ stack.c     26 Mar 2007 13:14:25 -0000
@@ -105,7 +105,8 @@ print_stack_frame (struct frame_info *fr

  args.frame = frame;
  args.print_level = print_level;
-  args.print_what = print_what;
+  /* For mi, alway print location and address.  */
+  args.print_what = ui_out_is_mi_like_p (uiout) ? LOC_AND_ADDRESS : print_what;
  args.print_args = 1;

  catch_errors (print_stack_frame_stub, &args, "", RETURN_MASK_ALL);
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.223
diff -u -p -r1.223 infrun.c
--- infrun.c    9 Mar 2007 16:20:42 -0000       1.223
+++ infrun.c    26 Mar 2007 13:14:39 -0000
@@ -3200,10 +3200,6 @@ Further execution is probably impossible
           default:
             internal_error (__FILE__, __LINE__, _("Unknown value."));
           }
-         /* For mi, have the same behavior every time we stop:
-            print everything but the source line. */
-         if (ui_out_is_mi_like_p (uiout))
-           source_flag = LOC_AND_ADDRESS;

         if (ui_out_is_mi_like_p (uiout))
           ui_out_field_int (uiout, "thread-id",



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