diff options
author | Pedro Alves <palves@redhat.com> | 2017-02-23 16:14:08 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-02-23 16:14:08 +0000 |
commit | 07e253aa3b7a530f22b84053e661842ccd9da2ea (patch) | |
tree | 20dc7cea2b67f76f68844e81e5c035fb8413a551 /gdb/configure.ac | |
parent | 1e9d41d49f7f0b9e7381e8bf8ce848f8a33b8fde (diff) | |
download | binutils-gdb-07e253aa3b7a530f22b84053e661842ccd9da2ea.tar.gz |
Introduce gdb::function_view
This commit adds a new function_view type. This type holds a
non-owning reference to a callable. It is meant to be used as
callback type of functions, instead of using the C-style pair of
function pointer and 'void *data' arguments. function_view allows
passing references to stateful function objects / lambdas with
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, put into a new gdb/unittests/ subdir.
gdb/ChangeLog:
2017-02-23 Pedro Alves <palves@redhat.com>
* Makefile.in (SUBDIR_UNITTESTS_SRCS, SUBDIR_UNITTESTS_OBS): New.
(%.o) <unittests/%.c>: New pattern.
* configure.ac ($development): Add $(SUBDIR_UNITTESTS_OBS) to
CONFIG_OBS, and $(SUBDIR_UNITTESTS_SRCS) to CONFIG_SRCS.
* common/function-view.h: New file.
* unittests/function-view-selftests.c: New file.
* configure: Regenerate.
Diffstat (limited to 'gdb/configure.ac')
-rw-r--r-- | gdb/configure.ac | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac index d2d854dc953..50f6f592ba6 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -2350,6 +2350,8 @@ AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "UTF-8", if $development; then AC_DEFINE(GDB_SELF_TEST, 1, [Define if self-testing features should be enabled]) + CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS)" + CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS)" fi GDB_AC_TRANSFORM([gdb], [GDB_TRANSFORM_NAME]) |