Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH v1.1 1/3] Introduce gdb::function_view
Date: Wed, 22 Feb 2017 22:12:00 -0000	[thread overview]
Message-ID: <20170222221158.hqfnyyvyqqxetygk@localhost> (raw)
In-Reply-To: <20baebcd-0f6a-89ca-ef34-503795171d43@redhat.com>

On 17-02-22 17:49:22, Pedro Alves wrote:
> On 02/22/2017 05:40 PM, Pedro Alves wrote:
> 
> > I'll send the updated (squashed) patch as a reply.
> 
> Here is is.  Thanks for the quick review!
> 
> From 997f0e94cbd2d1cdb4bf7612df1de72ce1a6eb56 Mon Sep 17 00:00:00 2001
> From: Pedro Alves <palves@redhat.com>
> Date: Wed, 22 Feb 2017 17:43:09 +0000
> Subject: [PATCH] Introduce gdb::function_view
> 
> This commit adds new function_view type.  This type holds a a

Double "a" at the end.

> non-owning reference to a callable.  It is meant to be used as
> callback type of functions, instead of using C-style pair of function
> pointer and 'void *data' arguments.  function_view allows passing
> references to stateful function objects / lambdas w/ captures as
> callbacks efficiently, while function pointer + 'void *' does not.
> 
> See the intro in the new function-view.h header for more.
> 
> Unit tests included.  I added a new gdb/unittests/ subdir this time,
> instead of putting the tests under gdb/.  If this is agreed to be a
> good idea, some of the current selftests that exercise gdb/common/
> things but live in gdb/ could move here (e.g., gdb/utils-selftests.c).

I wanted to add gdb/unittests for a while, but didn't have a chance to
do so.  Yes, it is a good idea to me.  How is GDB unit tests, like
disasm-selftests.c?  Do you want to move it to gdb/unittests/?

> +   C++11 gave us std::function as type-erased wrapper around arbitrary
> +   callables, however, std::function is not an ideal fit for transient
> +   callbacks such as the use case above.  For this use case, which is
> +   quite pervasive, a function_view is a better choice, because while
> +   while function_view is light and does not require any heap

Double "while"s.

> +namespace gdb {
> +

This is a new namespace in gdb source.  What is the rule of using this
namespace?

-- 
Yao 


  reply	other threads:[~2017-02-22 22:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22 14:50 [PATCH 0/3] Introduce gdb::function_view & fix completion bug Pedro Alves
2017-02-22 14:50 ` [PATCH 3/3] Fix gdb.base/completion.exp with --target_board=dwarf4-gdb-index Pedro Alves
2017-02-23 16:02   ` Yao Qi
2017-02-23 17:12     ` Pedro Alves
2017-02-23 17:24     ` [PATCH v2 0/2] " Pedro Alves
2017-02-23 17:24       ` [PATCH v2 2/2] " Pedro Alves
2017-02-24 15:34         ` Yao Qi
2017-02-24 17:15           ` Pedro Alves
2017-02-23 17:24       ` [PATCH v2 1/2] symtab.c: Small refactor Pedro Alves
2017-02-23 21:45         ` Yao Qi
2017-02-24 17:45           ` Pedro Alves
2017-02-22 14:50 ` [PATCH 1/3] Introduce gdb::function_view Pedro Alves
2017-02-22 15:15   ` Simon Marchi
2017-02-22 17:40     ` Pedro Alves
2017-02-22 17:49       ` [PATCH v1.1 " Pedro Alves
2017-02-22 22:12         ` Yao Qi [this message]
2017-02-23 14:49           ` Pedro Alves
2017-02-23 15:11             ` Yao Qi
2017-02-23 15:20               ` Pedro Alves
2017-02-23 15:34                 ` Yao Qi
2017-02-22 22:23         ` Yao Qi
2017-02-23 14:50           ` [PATCH v1.2 " Pedro Alves
2017-02-23 14:58             ` Yao Qi
2017-02-23 14:59               ` Pedro Alves
2017-02-22 18:02       ` [PATCH " Simon Marchi
2017-02-22 14:50 ` [PATCH 2/3] Use gdb::function_view in iterate_over_symtabs & co Pedro Alves
2017-02-22 22:40   ` Yao Qi

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=20170222221158.hqfnyyvyqqxetygk@localhost \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=simon.marchi@polymtl.ca \
    /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