Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Denis PILAT <denis.pilat@st.com>
To: gdb-patches@sourceware.org
Cc: Nick Roberts <nickrob@snap.net.nz>
Subject: Re: [RFC] -thread-select double print stack frame
Date: Mon, 26 Mar 2007 13:19:00 -0000	[thread overview]
Message-ID: <4607C863.7080405@st.com> (raw)
In-Reply-To: <17919.12645.81319.568064@kahikatea.snap.net.nz>


> 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",



  reply	other threads:[~2007-03-26 13:19 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
2007-03-26 13:19   ` Denis PILAT [this message]
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=4607C863.7080405@st.com \
    --to=denis.pilat@st.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nickrob@snap.net.nz \
    /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