This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC] -thread-select double print stack frame
- From: Denis PILAT <denis dot pilat at st dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Mon, 19 Mar 2007 14:47:55 +0100
- Subject: [RFC] -thread-select double print stack frame
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
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;
}