From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21392 invoked by alias); 19 Jun 2005 03:39:34 -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 21376 invoked by uid 22791); 19 Jun 2005 03:39:29 -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; Sun, 19 Jun 2005 03:39:29 +0000 Received: from farnswood.snap.net.nz (p180-tnt1.snap.net.nz [202.124.110.180]) by viper.snap.net.nz (Postfix) with ESMTP id 4FE6253D167; Sun, 19 Jun 2005 15:39:17 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 0207F62A99; Sun, 19 Jun 2005 04:39:43 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17076.59646.873454.551250@farnswood.snap.net.nz> Date: Sun, 19 Jun 2005 03:39:00 -0000 To: Daniel Jacobowitz Cc: Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [PATCH] -stack-info-frames In-Reply-To: <20050618232032.GA28368@nevyn.them.org> References: <17075.21529.964955.923197@farnswood.snap.net.nz> <20050617230130.GB21178@nevyn.them.org> <20050617231425.GA22254@nevyn.them.org> <17075.30993.384316.356236@farnswood.snap.net.nz> <20050618015756.GA30430@nevyn.them.org> <17075.57612.684597.392526@farnswood.snap.net.nz> <20050618155742.GB3663@nevyn.them.org> <17076.42233.730605.834264@farnswood.snap.net.nz> <20050618232032.GA28368@nevyn.them.org> X-SW-Source: 2005-06/txt/msg00291.txt.bz2 > > Yes, unless Apple's proposed merge will provide the necessary information. > > Let's not wait on that. You've demonstrated a use for > -stack-info-frame relative to the current source base. That's plenty > good enough for me. > > Of course now we need to re-add the documentation (with example this > time). A test case would be nice too. Since we've decided that we do > want this feature, could you put that together? OK. I've committed the -stack-info-frame part of the change that posted (Sat, 18 Jun 2005 10:52:09 +1200). Perhaps that doesn't follow the letter of the law but I hope it follows the spirit. In any case, I find it easier to make further changes to the repository than juggle patches (as demonstrated shown with my earlier mangling). This commit is slightly different in two respects: 1) mi_cmd_stack_info_frame uses print_frame_info instead of print_stack_frame. This follows mi_cmd_stack_list_frames and means that the argument values aren't printed. 2) The documentation for -stack-info-frame previously said (before I removed it) "Get info on the current frame.". I've corrected this to "Get info on the selected frame." I've also removed the argument values from the example as explained in 1). I hope this is acceptable. Nick 2005-06-19 Nick Roberts * mi/mi-cmd-stack.c (mi_cmd_stack_info_frame): New function. * mi/mi-cmds.c (mi_cmds): Replace entry for -stack-info-frame. Make it use mi_cmd_stack_info_frame * mi/mi-cmds.h (mi_cmd_stack_info_frame): New declaration. * gdb.texinfo (GDB/MI Stack Manipulation): Re-instate -stack-info-frame with example. Say that it gets info on selected frame, not current frame. *** /home/nick/src/gdb/mi/mi-cmd-stack.c.~1.26~ 2005-06-19 15:34:00.000000000 +1200 --- /home/nick/src/gdb/mi/mi-cmd-stack.c 2005-06-19 14:45:13.000000000 +1200 *************** *** 329,331 **** --- 329,341 ---- 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_frame_info (get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 0); + return MI_CMD_DONE; + } *** /home/nick/src/gdb/mi/mi-cmds.c.~1.17~ 2005-06-19 15:33:32.000000000 +1200 --- /home/nick/src/gdb/mi/mi-cmds.c 2005-06-19 13:57:36.000000000 +1200 *************** *** 107,112 **** --- 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}, *** /home/nick/src/gdb/mi/mi-cmds.h.~1.15~ 2005-06-19 15:34:22.000000000 +1200 --- /home/nick/src/gdb/mi/mi-cmds.h 2005-06-19 13:58:18.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.269~ 2005-06-19 15:03:43.000000000 +1200 --- /home/nick/src/gdb/doc/gdb.texinfo~ 2005-06-19 14:57:04.000000000 +1200 *************** *** 19223,19228 **** --- 19223,19257 ---- @node GDB/MI Stack Manipulation @section @sc{gdb/mi} Stack Manipulation Commands + + @subheading The @code{-stack-info-frame} Command + @findex -stack-info-frame + + @subsubheading Synopsis + + @smallexample + -stack-info-frame + @end smallexample + + Get info on the selected frame. + + @subsubheading @value{GDBN} Command + + The corresponding @value{GDBN} command is @samp{info frame} or @samp{frame} + (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