Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: gdb-patches@sourceware.org
Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Subject: [RFA] (try to) consistently use 'frame level' concept instead of 'frame number'.
Date: Thu, 12 Jul 2018 22:15:00 -0000	[thread overview]
Message-ID: <20180712221536.26845-1-philippe.waroquiers@skynet.be> (raw)

Following the discussion in the 'frame apply' patch and the patch proposed
in https://sourceware.org/ml/gdb-patches/2018-06/msg00170.html
the idea is rather to speak about 'frame level' to identify a frame,
rather than 'frame number'.

This patch changes a few occurences of 'frame number' (or 'number') to
'frame level' (or 'level') in the code and in gdb.texinfo.

Note that the doc still has some references to 'trace frame number',
but I think that this is really a number that is numbering a set
of traced frames, and it is not a level. So, such occurences are
kept unchanged.

gdb/doc/ChangeLog
2018-07-12  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.texinfo (Stack Frames):
	Change 'frame number' to 'frame level'.
	(Backtrace): Likewise.
	(Selecting a Frame): Likewise.
	(GDB/MI Stack Manipulation): Likewise.

gdb/ChangeLog
	* stack.c (backtrace_command_1): Change 'frame number' to
	'frame level'.
	(_initialize_stack): Likewise.
---
 gdb/doc/gdb.texinfo | 25 ++++++++++++-------------
 gdb/stack.c         |  6 +++---
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index b36a39b5b4..b0d208a121 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -7393,11 +7393,10 @@ address serves as the address of the frame.  Usually this address is kept
 in a register called the @dfn{frame pointer register}
 (@pxref{Registers, $fp}) while execution is going on in that frame.
 
-@cindex frame number
-@value{GDBN} assigns numbers to all existing stack frames, starting with
+@cindex frame level
+In @value{GDBN}, each existing stack frame has a level, starting with
 zero for the innermost frame, one for the frame that called it,
-and so on upward.  These numbers do not really exist in your program;
-they are assigned by @value{GDBN} to give you a way of designating stack
+and so on upward.  These levels give you a way of designating stack
 frames in @value{GDBN} commands.
 
 @c The -fomit-frame-pointer below perennially causes hbox overflow
@@ -7413,7 +7412,7 @@ This is occasionally done with heavily used library functions to save
 the frame setup time.  @value{GDBN} has limited facilities for dealing
 with these function invocations.  If the innermost function invocation
 has no stack frame, @value{GDBN} nevertheless regards it as though
-it had a separate frame, which is numbered zero as usual, allowing
+it had a separate frame, which has a level zero as usual, allowing
 correct tracing of the function call chain.  However, @value{GDBN} has
 no provision for frameless functions elsewhere in the stack.
 
@@ -7486,7 +7485,7 @@ apply all backtrace}, @value{GDBN} will display the backtrace for all
 the threads; this is handy when you debug a core dump of a
 multi-threaded program.
 
-Each line in the backtrace shows the frame number and the function name.
+Each line in the backtrace shows the frame level and the function name.
 The program counter value is also shown---unless you use @code{set
 print address off}.  The backtrace also shows the source file name and
 line number, as well as the arguments to the function.  The program
@@ -7633,16 +7632,16 @@ of the stack frame just selected.
 @kindex f @r{(@code{frame})}
 @item frame @var{n}
 @itemx f @var{n}
-Select frame number @var{n}.  Recall that frame zero is the innermost
+Select frame level @var{n}.  Recall that frame zero is the innermost
 (currently executing) frame, frame one is the frame that called the
-innermost one, and so on.  The highest-numbered frame is the one for
+innermost one, and so on.  The highest-level frame is the one for
 @code{main}.
 
 @item frame @var{stack-addr} [ @var{pc-addr} ]
 @itemx f @var{stack-addr} [ @var{pc-addr} ]
 Select the frame at address @var{stack-addr}.  This is useful mainly if the
 chaining of stack frames has been damaged by a bug, making it
-impossible for @value{GDBN} to assign numbers properly to all frames.  In
+impossible for @value{GDBN} to assign levels properly to all frames.  In
 addition, this can be useful when your program has multiple stacks and
 switches between them.  The optional @var{pc-addr} can also be given to
 specify the value of PC for the stack frame.
@@ -7651,19 +7650,19 @@ specify the value of PC for the stack frame.
 @item up @var{n}
 Move @var{n} frames up the stack; @var{n} defaults to 1.  For positive
 numbers @var{n}, this advances toward the outermost frame, to higher
-frame numbers, to frames that have existed longer.
+frame levels, to frames that have existed longer.
 
 @kindex down
 @kindex do @r{(@code{down})}
 @item down @var{n}
 Move @var{n} frames down the stack; @var{n} defaults to 1.  For
 positive numbers @var{n}, this advances toward the innermost frame, to
-lower frame numbers, to frames that were created more recently.
+lower frame levels, to frames that were created more recently.
 You may abbreviate @code{down} as @code{do}.
 @end table
 
 All of these commands end by printing two lines of output describing the
-frame.  The first line shows the frame number, the function name, the
+frame.  The first line shows the frame level, the function name, the
 arguments, and the source file and line number of execution in that
 frame.  The second line shows the text of that source line.
 
@@ -30074,7 +30073,7 @@ following info:
 
 @table @samp
 @item @var{level}
-The frame number, 0 being the topmost frame, i.e., the innermost function.
+The frame level, 0 being the topmost frame, i.e., the innermost function.
 @item @var{addr}
 The @code{$pc} value for that frame.
 @item @var{func}
diff --git a/gdb/stack.c b/gdb/stack.c
index e51c689f43..c1bcb7b169 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1763,7 +1763,7 @@ backtrace_command_1 (const char *count_exp, frame_filter_flags flags,
 	{
 	  py_start = 0;
 	  /* The argument to apply_ext_lang_frame_filter is the number
-	     of the final frame to print, and frames start at 0.  */
+	     of frames to print, and frame levels start at 0.  */
 	  py_end = count - 1;
 	}
     }
@@ -2746,7 +2746,7 @@ This is useful in command scripts."));
 Select and print a stack frame.\nWith no argument, \
 print the selected stack frame.  (See also \"info frame\").\n\
 An argument specifies the frame to select.\n\
-It can be a stack frame number or the address of the frame."),
+It can be a stack frame level or the address of the frame."),
 		  &frame_cmd_list, "frame ", 1, &cmdlist);
 
   add_com_alias ("f", "frame", class_stack, 1);
@@ -2792,7 +2792,7 @@ shortcut for 'frame apply all -s COMMAND'"));
   add_com_suppress_notification ("select-frame", class_stack, select_frame_command, _("\
 Select a stack frame without printing anything.\n\
 An argument specifies the frame to select.\n\
-It can be a stack frame number or the address of the frame."),
+It can be a stack frame level or the address of the frame."),
 		 &cli_suppress_notification.user_selected_context);
 
   add_com ("backtrace", class_stack, backtrace_command, _("\
-- 
2.18.0


             reply	other threads:[~2018-07-12 22:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-12 22:15 Philippe Waroquiers [this message]
2018-07-13  6:52 ` Eli Zaretskii
2018-07-13  7:23   ` Philippe Waroquiers

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=20180712221536.26845-1-philippe.waroquiers@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --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