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]

Re: -stack-list-frames HIGH_FRAME changes


On Friday 08 September 2006 02:35, Nick Roberts wrote:
> > Checked in.
>
> I can't remember that far back but was there any reason for not making the
> same change to -stack-list-arguments?

Other than the fact that KDevelop does not need -stack-list-arguments at the 
moment, so I even did not look at -stack-list-arguments? I think there are no 
other reasons. 

Here we go, OK?

- Volodya

./Changelog:
2006-05-05  Vladimir Prus  <ghost@lvk.cs.msu.su>

        * mi/mi-cmd-stack.c (mi_cmd_stack_list_args): Don't emit error
        if high requested frame number is larger then number of available 
        frames.


doc/ChangeLog
2006-05-05  Vladimir Prus  <ghost@lvk.cs.msu.su>

        * gdb.texinfo (GDB/MI Stack Manipulation): Mention that
        -stack-list-arguments HIGH_FRAME argument can be larger then the
        actual number of frames.


testsuite/ChangeLog

2006-05-05  Vladimir Prus  <ghost@lvk.cs.msu.su>

        * gdb.mi/mi-stack.exp (test_stack_args_listing): Test that
        HIGH_FRAME argument to -stack-list-arguments can be larger than
        the number of frames.
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.351
diff -u -r1.351 gdb.texinfo
--- doc/gdb.texinfo	7 Sep 2006 16:40:18 -0000	1.351
+++ doc/gdb.texinfo	8 Sep 2006 06:24:41 -0000
@@ -19230,8 +19230,12 @@
 
 Display a list of the arguments for the frames between @var{low-frame}
 and @var{high-frame} (inclusive).  If @var{low-frame} and
-@var{high-frame} are not provided, list the arguments for the whole call
-stack.
+@var{high-frame} are not provided, list the arguments for the whole
+call stack. If the two arguments are equal, it shows the single frame
+at the corresponding level.  It is an error if @var{low-frame} is
+larger than the actual number of frames.  On the other hand,
+@var{high-frame} may be larger then the actual number of frames, in
+which case only existing frames will be returned.
 
 The @var{show-values} argument must have a value of 0 or 1.  A value of
 0 means that only the names of the arguments are listed, a value of 1
Index: mi/mi-cmd-stack.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-stack.c,v
retrieving revision 1.30
diff -u -r1.30 mi-cmd-stack.c
--- mi/mi-cmd-stack.c	7 Sep 2006 16:40:18 -0000	1.30
+++ mi/mi-cmd-stack.c	8 Sep 2006 06:24:41 -0000
@@ -205,8 +205,6 @@
     }
 
   do_cleanups (cleanup_stack_args);
-  if (i < frame_high)
-    error (_("mi_cmd_stack_list_args: Not enough frames in stack."));
 
   return MI_CMD_DONE;
 }
Index: testsuite/gdb.mi/mi-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stack.exp,v
retrieving revision 1.21
diff -u -r1.21 mi-stack.exp
--- testsuite/gdb.mi/mi-stack.exp	7 Sep 2006 16:40:19 -0000	1.21
+++ testsuite/gdb.mi/mi-stack.exp	8 Sep 2006 06:24:41 -0000
@@ -122,6 +122,10 @@
     mi_gdb_test "234-stack-list-arguments" \
 	    "&.*234\\^error,msg=\"mi_cmd_stack_list_args: Usage.*PRINT_VALUES.*FRAME_LOW FRAME_HIGH.*\"" \
 	    "stack args listing wrong"
+
+    mi_gdb_test "235-stack-list-arguments 1 1 3" \
+	    "235\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"2\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"3\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\]\}\\\]" \
+                "stack args listing 1 1 300"
 }
 
 proc test_stack_info_depth {} {

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