From: Nick Roberts <nickrob@snap.net.nz>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] -stack-select-frame
Date: Fri, 17 Jun 2005 03:07:00 -0000 [thread overview]
Message-ID: <17074.16093.924351.774111@farnswood.snap.net.nz> (raw)
In-Reply-To: <20050616234728.GA14260@nevyn.them.org>
> > -stack-select-frame without an argument currently works like the CLI
> > command "frame" without the output. All "frame" does is output the
> > current frame, so without output its a bit of a no-op.
>
> OK, so obviously that's a loss. Either we should:
> - reject it without an argument
> - make it print without an argument
> - make it print always
>
> You did the last of those. I'm trying to figure out if other users of
> -stack-select-frame want that behavior.
>
> > > Could you explain why you think we need output here?
> >
> > If you have a backtrace then, no, you don't need the output and the
> > frontend can ignore it. However, I presume "-stack-select-frame" runs
> > more quickly than "-stack-list-frames" so, if you don't need a backtrace,
> > its probably best not to require one.
>
> We've already got -stack-info-frame. If you want to avoid
> -stack-list-frames, is it unreasonable to do the two round trips for
> -stack-select-frame / -stack-info-frame? From Jason's measurements, it
> sounds like that isn't a problem.
-stack-info-frame hasn't been implemented yet (I've think we've been here
before) but it would probably be quite easy to implement and I guess it
could work like I've made -stack-select-frame without an argument work.
However, the documentation suggests that it should work like "info frame",
so perhaps its expected to have more information.
Its also just occurred to me that "-stack-list-frames 0 0" is similar too.
> Not that it would be a terrible change to print out the frame. It's
> just a question of whether there's benefit. It'll make
> -stack-select-frame (again, only marginally) slower.
How about installing your second choice, just printing the frame when there is
no argument? I presume that when Apple use -stack-select-frame, it is always
with an argument (doco will change to match):
More generally I think it would be a good idea to mention in the manual
that MI is still undergoing change to reduce the obligation to maintain
legacy code.
*** /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-17 14:57:19.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,343 ****
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,337 ----
enum mi_cmd_result
mi_cmd_stack_select_frame (char *command, char **argv, int argc)
{
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 */ );
! print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS);
! }
else
select_frame_command (argv[0], 1 /* not used */ );
return MI_CMD_DONE;
next prev parent reply other threads:[~2005-06-17 3:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-16 3:36 Nick Roberts
2005-06-16 4:42 ` Daniel Jacobowitz
2005-06-16 6:41 ` Nick Roberts
2005-06-16 13:21 ` Daniel Jacobowitz
2005-06-16 22:58 ` Nick Roberts
2005-06-16 23:20 ` Bob Rossi
2005-06-16 23:47 ` Daniel Jacobowitz
2005-06-17 3:07 ` Nick Roberts [this message]
2005-06-17 3:21 ` Daniel Jacobowitz
2005-06-17 7:37 ` Nick Roberts
2005-06-17 10:15 ` Eli Zaretskii
2005-06-17 13:33 ` Daniel Jacobowitz
2005-06-18 8:56 ` Eli Zaretskii
2005-06-17 9:55 ` Eli Zaretskii
2005-06-17 9:46 ` Eli Zaretskii
2005-06-16 18:23 ` Eli Zaretskii
2005-06-16 20:15 ` Jason Molenda
2005-06-16 23:04 ` Nick Roberts
2005-06-16 23:30 ` Jason Molenda
2005-06-17 7:22 ` Nick Roberts
2005-06-17 13:30 ` Daniel Jacobowitz
2005-06-17 19:48 ` Jason Molenda
2005-06-17 22:35 ` Stan Shebs
2005-06-17 22:59 ` Daniel Jacobowitz
2005-06-17 23:31 ` Nick Roberts
[not found] <1119003319.5434.ezmlm@sources.redhat.com>
2005-06-17 17:45 ` Jim Ingham
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=17074.16093.924351.774111@farnswood.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
/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