From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31583 invoked by alias); 17 Jun 2005 22:51:39 -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 31468 invoked by uid 22791); 17 Jun 2005 22:51:25 -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; Fri, 17 Jun 2005 22:51:25 +0000 Received: from farnswood.snap.net.nz (p18-tnt1.snap.net.nz [202.124.110.18]) by viper.snap.net.nz (Postfix) with ESMTP id 3472C53EC17; Sat, 18 Jun 2005 10:51:21 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 3DC6C62A99; Fri, 17 Jun 2005 23:52:13 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17075.21529.964955.923197@farnswood.snap.net.nz> Date: Fri, 17 Jun 2005 22:51:00 -0000 To: Daniel Jacobowitz , gdb-patches@sources.redhat.com Subject: [PATCH] -stack-info-frames X-SW-Source: 2005-06/txt/msg00264.txt.bz2 Here's a patch for -stack-info-frames. Having just read Jason's e-mail about how quick "-stack-list-frames 0 0" is, I'm not sure its necessary. I thought I'd send it anyway. Even if we decide not to implement -stack-info-frames, could you please approve the other parts: Not testing for stack, and not allowing an argument (mi_cmd_stack_select_frame). Nick 2005-06-18 Nick Roberts * mi/mi-cmd-stack.c (mi_cmd_stack_info_frame): New function. (mi_cmd_stack_list_frames, mi_cmd_stack_info_depth): Don't test for stack. (mi_cmd_stack_select_frame): Do not allow an argument. Don't test for stack. * mi/mi-cmds.c (mi_cmds): Add mi_cmd_stack_info_frame to entry for -stack-info-frame. * mi/mi-cmds.h (mi_cmd_stack_info_frame): New declaration. * gdb.texinfo (GDB/MI Stack Manipulation): Update description of -stack-info-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-18 01:20:30.000000000 +1200 *************** *** 47,55 **** struct cleanup *cleanup_stack; struct frame_info *fi; - if (!target_has_stack) - error (_("mi_cmd_stack_list_frames: No stack.")); - if (argc > 2 || argc == 1) error (_("mi_cmd_stack_list_frames: Usage: [FRAME_LOW FRAME_HIGH]")); --- 47,52 ---- *************** *** 104,112 **** int i; struct frame_info *fi; - if (!target_has_stack) - error (_("mi_cmd_stack_info_depth: No stack.")); - if (argc > 1) error (_("mi_cmd_stack_info_depth: Usage: [MAX_DEPTH]")); --- 101,106 ---- *************** *** 329,344 **** 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]")); ! /* with no args, don't change frame */ ! if (argc == 0) ! select_frame_command (0, 1 /* not used */ ); ! else ! select_frame_command (argv[0], 1 /* not used */ ); return MI_CMD_DONE; } --- 323,341 ---- enum mi_cmd_result mi_cmd_stack_select_frame (char *command, char **argv, int argc) { ! if (argc == 0 || argc > 1) ! error (_("mi_cmd_stack_select_frame: Usage: FRAME_SPEC")); ! select_frame_command (argv[0], 1 /* not used */ ); ! return MI_CMD_DONE; ! } ! enum mi_cmd_result ! mi_cmd_stack_info_frame (char *command, char **argv, int argc) ! { ! if (argc > 0) ! error (_("mi_cmd_stack_info_frame: No arguments required")); ! ! print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS); return MI_CMD_DONE; } *** /home/nick/src/gdb/mi/mi-cmds.c.~1.16.~ 2005-02-13 00:36:20.000000000 +1300 --- /home/nick/src/gdb/mi/mi-cmds.c 2005-06-18 00:55:55.000000000 +1200 *************** *** 107,113 **** { "signal-list-handle-actions", { NULL, 0 }, NULL, NULL }, { "signal-list-signal-types", { NULL, 0 }, NULL, NULL }, { "stack-info-depth", { NULL, 0 }, 0, mi_cmd_stack_info_depth}, ! { "stack-info-frame", { NULL, 0 }, NULL, NULL }, { "stack-list-arguments", { NULL, 0 }, 0, mi_cmd_stack_list_args}, { "stack-list-exception-handlers", { NULL, 0 }, NULL, NULL }, { "stack-list-frames", { NULL, 0 }, 0, mi_cmd_stack_list_frames}, --- 107,113 ---- { "signal-list-handle-actions", { NULL, 0 }, NULL, NULL }, { "signal-list-signal-types", { NULL, 0 }, NULL, NULL }, { "stack-info-depth", { NULL, 0 }, 0, mi_cmd_stack_info_depth}, ! { "stack-info-frame", { NULL, 0 }, 0, mi_cmd_stack_info_frame}, { "stack-list-arguments", { NULL, 0 }, 0, mi_cmd_stack_list_args}, { "stack-list-exception-handlers", { NULL, 0 }, NULL, NULL }, { "stack-list-frames", { NULL, 0 }, 0, mi_cmd_stack_list_frames}, diff -c /home/nick/src/gdb/mi/mi-cmds.h.\~1.15.\~ /home/nick/src/gdb/mi/mi-cmds.h *** /home/nick/src/gdb/mi/mi-cmds.h.~1.15.~ 2005-01-25 22:30:39.000000000 +1300 --- /home/nick/src/gdb/mi/mi-cmds.h 2005-06-18 10:48:59.000000000 +1200 *************** *** 87,92 **** --- 87,93 ---- extern mi_cmd_argv_ftype mi_cmd_gdb_exit; extern mi_cmd_argv_ftype mi_cmd_interpreter_exec; extern mi_cmd_argv_ftype mi_cmd_stack_info_depth; + extern mi_cmd_argv_ftype mi_cmd_stack_info_frame; extern mi_cmd_argv_ftype mi_cmd_stack_list_args; extern mi_cmd_argv_ftype mi_cmd_stack_list_frames; extern mi_cmd_argv_ftype mi_cmd_stack_list_locals; ** /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-18 01:55:52.000000000 +1200 *************** *** 19205,19211 **** (without arguments). @subsubheading Example ! N.A. @subheading The @code{-stack-info-depth} Command @findex -stack-info-depth --- 19205,19220 ---- (without arguments). @subsubheading Example ! ! @smallexample ! (@value{GDBP}) ! -stack-info-frame ! ^done,frame=@{level="1",addr="0x0001076c",func="callee3", ! args=[@{name="strarg",value="0x11940 \"A string argument.\""@}], ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c", ! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="17"@} ! (@value{GDBP}) ! @end smallexample @subheading The @code{-stack-info-depth} Command @findex -stack-info-depth