Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] -thread-select double print stack frame
@ 2007-03-19 13:48 Denis PILAT
  2007-03-20  0:57 ` Nick Roberts
  0 siblings, 1 reply; 10+ messages in thread
From: Denis PILAT @ 2007-03-19 13:48 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

Following discussion with Nick 
(http://sources.redhat.com/ml/gdb-patches/2007-03/msg00156.html),
about mi output of -thread-info new command,
here is a patch that fix a problem with *-thread-select* that double 
print the stack frame.

Example:
-thread-select 1
^done,new-thread-id="1",frame={level="0",func="done_making_threads",args=[],file="/project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/cvs/head/src/gdb/testsuite/gdb.mi/pthreads.c",fullname="/project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/cvs/head/src/gdb/testsuite/gdb.mi/pthreads.c",line="61"},line="61",file="/project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/cvs/head/src/gdb/testsuite/gdb.mi/pthreads.c"
(gdb)

As noticed by Nick, this "double printing" is not documented neither 
tested. I propose to remove it, it does not involved any regression in 
the testsuite( done for linux native target).

-- 
Denis





[-- Attachment #2: thread-select.patch --]
[-- Type: text/plain, Size: 875 bytes --]

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

	* thread.c (do_captured_thread_select): print_stack_frame use
	LOC_AND_ADDRESS for mi output.

Index: thread.c
===================================================================
RCS file: /cvs/src/src/gdb/thread.c,v
retrieving revision 1.51
diff -u -p -r1.51 thread.c
--- thread.c	28 Feb 2007 17:35:01 -0000	1.51
+++ thread.c	19 Mar 2007 13:27:53 -0000
@@ -700,7 +700,12 @@ do_captured_thread_select (struct ui_out
   ui_out_text (uiout, target_tid_to_str (inferior_ptid));
   ui_out_text (uiout, ")]");
 
-  print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
+  /* For mi, we just print location.  */
+  if (ui_out_is_mi_like_p (uiout))
+    print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS);
+  else
+    print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
+
   return GDB_RC_OK;
 }
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-03-29  7:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-19 13:48 [RFC] -thread-select double print stack frame Denis PILAT
2007-03-20  0:57 ` Nick Roberts
2007-03-26 13:19   ` Denis PILAT
2007-03-27 19:33     ` Daniel Jacobowitz
2007-03-27 21:42       ` Nick Roberts
2007-03-28  2:11         ` Daniel Jacobowitz
2007-03-28  5:56           ` Nick Roberts
2007-03-28  8:26             ` Denis PILAT
2007-03-28 11:43         ` Daniel Jacobowitz
2007-03-29  7:45           ` Denis PILAT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox