public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCHv2 1/2] gdb: Split func_command into two parts.
Date: Fri, 18 May 2018 19:57:00 -0000	[thread overview]
Message-ID: <3378e45e-2da2-6eea-814a-86e6e565bf7a@redhat.com> (raw)
In-Reply-To: <d34fc1596b3adba489de389eec14028982d85c40.1525797846.git.andrew.burgess@embecosm.com>

On 05/08/2018 05:58 PM, Andrew Burgess wrote:
> The func_command function is used to emulate the dbx 'func' command.
> However, finding a stack frame based on function name might be a useful
> feature, and so the core of func_command is now split out into a
> separate function.
> 
> gdb/ChangeLog:
> 
>         * stack.c (select_and_print_frame): Delete.
>         (func_command): Most content moved into new function
>         find_frame_for_function, use new function, print result, add
>         function comment.
> 	(find_frame_for_function): New function, now returns a result.

This LGTM, with a couple minor nits.

>  /* Return the symbol-block in which the selected frame is executing.
>     Can return zero under various legitimate circumstances.
> @@ -2460,19 +2450,19 @@ struct function_bounds
>    CORE_ADDR low, high;
>  };
>  
> -static void
> -func_command (const char *arg, int from_tty)
> +static struct frame_info *
> +find_frame_for_function (const char *function_name)

There's a comment above the structure that is describing
what the func_command function did.  That needs to be
updated to describe what the new function does.

> +
> +/* Implements the dbx 'func' command.  */
> +
> +static void
> +func_command (const char *arg, int from_tty)
> +{
> +  struct frame_info *frame;
> +
> +  if (arg == NULL)
> +    return;
> +
> +  frame = find_frame_for_function (arg);

You can declare and initialize at the same time:

func_command (const char *arg, int from_tty)
{
  if (arg == NULL)
    return;

  frame_info *frame = find_frame_for_function (arg);

Thanks,
Pedro Alves

  reply	other threads:[~2018-05-18 19:38 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08 16:58 [PATCHv2 0/2] Changes to frame selection Andrew Burgess
2018-05-08 16:58 ` [PATCHv2 1/2] gdb: Split func_command into two parts Andrew Burgess
2018-05-18 19:57   ` Pedro Alves [this message]
2018-05-21 15:52     ` Andrew Burgess
2018-05-21 16:06       ` Pedro Alves
2018-05-08 16:59 ` [PATCHv2 2/2] gdb: Change how frames are selected for 'frame' and 'info frame' Andrew Burgess
2018-05-11 15:44   ` Eli Zaretskii
2018-05-21 12:16     ` Andrew Burgess
2018-05-21 17:46       ` Eli Zaretskii
2018-06-05 18:53         ` Andrew Burgess
2018-06-05 21:16           ` Philippe Waroquiers
2018-06-06  8:22             ` Andrew Burgess
2018-06-06 14:56               ` Eli Zaretskii
2018-06-07 16:19   ` [PATCHv3] " Andrew Burgess
2018-06-29 12:23     ` Andrew Burgess
2018-07-17 15:58     ` [PATCHv4] " Andrew Burgess
2018-07-23 20:46       ` Philippe Waroquiers
2018-07-25 18:14         ` Andrew Burgess
     [not found]           ` <cover.1534197765.git.andrew.burgess@embecosm.com>
2018-08-13 22:20             ` [PATCHv5_B 2/2] " Andrew Burgess
2018-08-13 22:20           ` [PATCHv5 0/2] " Andrew Burgess
2018-08-14 10:31             ` Philippe Waroquiers
2018-08-21 13:10               ` Joel Brobecker
2018-08-27 11:04             ` Andrew Burgess
2018-08-27 15:23               ` Eli Zaretskii
2018-08-28  8:43                 ` Andrew Burgess
2018-08-28  9:08                   ` Eli Zaretskii
2018-08-28 18:03                     ` [PATCHv6] " Andrew Burgess
2018-08-28 18:20                       ` Eli Zaretskii
2018-09-05  7:46                       ` PING: " Andrew Burgess
2018-09-13 18:02                       ` Pedro Alves
2018-09-18 23:01                         ` Andrew Burgess
2018-09-19 16:26                           ` Pedro Alves
2018-09-26 23:06                             ` Andrew Burgess
2018-09-27 20:58                               ` Pedro Alves
2018-08-13 22:20           ` [PATCHv5_A 1/2] " Andrew Burgess

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=3378e45e-2da2-6eea-814a-86e6e565bf7a@redhat.com \
    --to=palves@redhat.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).