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]

[PATCH 3/3] cleanup print_frame_info.


This "regardless" comment is confusing.  It was not clear to me what
"this" was referring to.  Looking back in history, the comment appears
already in the initial cvs import, and at that time, this branch was
only printing the level, so the comment must be referring to the level
printing.  SOURCE refers to the old 'source' parameter, before it was
replaced with print_what.  Whatever the original meaning, it's gone
and the comment is just distrating.

I had initially thought that the "regardless" comment might be
referring to the ui_out_is_mi_like_p check.  But, given the
investigation above, it isn't.

print_stack_frame unconditionally sets print_what to
PF_LOCATION|PF_LOC_ADDRESS for MI, so replacing with the proper
print_what check will have the same effect for MI (I ran tests with
assertions in place to look for cases I might have missed), and I
think it's cleaner/simpler/'less suprising' this way.

Tested on x86_64 Fedora 17.

gdb/
2013-08-30  Pedro Alves  <palves@redhat.com>

	* stack.c (print_frame_info): Remove comment.  Check print_what
	instead of whether the uiout is MI-like.
---
 0 files changed

diff --git a/gdb/stack.c b/gdb/stack.c
index f8ad24a..5313771 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -795,15 +795,13 @@ print_frame_info (struct frame_info *frame, enum print_what print_what,
       annotate_frame_begin (print_level ? frame_relative_level (frame) : 0,
 			    gdbarch, get_frame_pc (frame));
 
-      /* Do this regardless of SOURCE because we don't have any source
-         to list for this frame.  */
       if (print_level)
         {
           ui_out_text (uiout, "#");
           ui_out_field_fmt_int (uiout, 2, ui_left, "level",
 				frame_relative_level (frame));
         }
-      if (ui_out_is_mi_like_p (uiout))
+      if ((print_what & PF_LOC_ADDRESS) != 0)
         {
           annotate_frame_address ();
           ui_out_field_core_addr (uiout, "addr",


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