From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20048 invoked by alias); 16 Jun 2005 03:36:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20023 invoked by uid 22791); 16 Jun 2005 03:36:10 -0000 Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 16 Jun 2005 03:36:10 +0000 Received: from farnswood.snap.net.nz (p20-tnt2.snap.net.nz [202.124.108.20]) by viper.snap.net.nz (Postfix) with ESMTP id 7B705554880 for ; Thu, 16 Jun 2005 15:36:06 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id E263362A99; Thu, 16 Jun 2005 04:37:08 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17072.62436.183299.55978@farnswood.snap.net.nz> Date: Thu, 16 Jun 2005 03:36:00 -0000 To: gdb-patches@sources.redhat.com Subject: [PATCH] -stack-select-frame X-SW-Source: 2005-06/txt/msg00215.txt.bz2 Last year I submitted a dreadful patch for -stack-select-frame (thread subject: How does GDB/MI give the current frame). Here, hopefully, is a much more sensible one. The idea is the same: that -stack-select-frame tells the frontend what the current or selected frame is. The current documentation for -stack-select-frame is slightly wrong because the argument FRAMENUM is optional. I've corrected this and explained what the patch does. Nick 2005-06-16 Nick Roberts * mi/mi-cmd-stack.c (mi_cmd_stack_select_frame): Don't test for stack. Print frame details. * gdb.texinfo (GDB/MI Stack Manipulation): Revise description of -stack-select-frame. *** /home/nick/src/gdb/mi/mi-cmd-stack.c.~1.25.~ 2005-02-13 00:36:20.000000000 +1300 --- /home/nick/src/gdb/mi/mi-cmd-stack.c 2005-06-16 14:28:29.000000000 +1200 *************** *** 329,337 **** enum mi_cmd_result mi_cmd_stack_select_frame (char *command, char **argv, int argc) { - if (!target_has_stack) - error (_("mi_cmd_stack_select_frame: No stack.")); - if (argc > 1) error (_("mi_cmd_stack_select_frame: Usage: [FRAME_SPEC]")); --- 329,334 ---- *************** *** 340,344 **** --- 337,342 ---- select_frame_command (0, 1 /* not used */ ); else select_frame_command (argv[0], 1 /* not used */ ); + print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS); return MI_CMD_DONE; } *** /home/nick/src/gdb/doc/gdb.texinfo.~1.261.~ 2005-06-16 14:36:11.000000000 +1200 --- /home/nick/src/gdb/doc/gdb.texinfo 2005-06-16 15:01:18.000000000 +1200 *************** *** 19473,19483 **** @subsubheading Synopsis @smallexample ! -stack-select-frame @var{framenum} @end smallexample ! Change the current frame. Select a different frame @var{framenum} on ! the stack. @subsubheading @value{GDBN} Command --- 19473,19484 ---- @subsubheading Synopsis @smallexample ! -stack-select-frame [ @var{framenum} ] @end smallexample ! Select a different frame @var{framenum} on the stack and print its ! details. If the argument @var{framenum} is not specified, just print ! the details of the current frame. @subsubheading @value{GDBN} Command *************** *** 19489,19495 **** @smallexample (@value{GDBP}) -stack-select-frame 2 ! ^done (@value{GDBP}) @end smallexample --- 19490,19497 ---- @smallexample (@value{GDBP}) -stack-select-frame 2 ! ^done,frame=@{level="2",addr="0x000107a4",func="foo", ! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line=line="14"@}, (@value{GDBP}) @end smallexample