From: Nick Roberts <nickrob@snap.net.nz>
To: Denis PILAT <denis.pilat@st.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC] -thread-select double print stack frame
Date: Tue, 20 Mar 2007 00:57:00 -0000 [thread overview]
Message-ID: <17919.12645.81319.568064@kahikatea.snap.net.nz> (raw)
In-Reply-To: <45FE948B.9090007@st.com>
> 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;
> }
>
While this surely fixes the immediate problem, I'm not sure it's the best way.
For example, we could have:
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.
Furthermore, I don't understand why file and line details are duplicated in MI,
but not CLI. It has something to do with uiout->flags not being 0 in MI (from
looking at print_source_lines_base). The frame printing code is either one big
mess, or I'm not seeing the underlying structure at the moment. Hopefully it's
the latter.
--
Nick http://www.inet.net.nz/~nickrob
next prev parent reply other threads:[~2007-03-20 0:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-19 13:48 Denis PILAT
2007-03-20 0:57 ` Nick Roberts [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17919.12645.81319.568064@kahikatea.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=denis.pilat@st.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox