binutils-gdb/gdbsupport
Tom de Vries 77252bf26e [gdb/build] Add CXX_DIALECT to CXX
Say we use a gcc version that (while supporting c++11) does not support c++11
by default, and needs an -std setting to enable it.

If gdb would use the default AX_CXX_COMPILE_STDCXX from autoconf-archive, then
we'd have:
...
CXX="g++ -std=gnu++11"
...

That mechanism however has the following problem (quoting from commit
0bcda68539):
...
the top level Makefile passes CXX down to subdirs, and that overrides whatever
gdb/Makefile may set CXX to.  The result would be that a make invocation from
the build/gdb/ directory would use "g++ -std=gnu++11" as expected, while a
make invocation at the top level would not.
...

Commit 0bcda68539 fixes this by using a custom AX_CXX_COMPILE_STDCXX which
does:
...
CXX=g++
CXX_DIALECT=-std=gnu++11
...

The problem reported in PR28318 is that using the custom instead of the
default AX_CXX_COMPILE_STDCXX makes the configure test for std::thread
support fail.

We could simply add $CXX_DIALECT to the test for std::thread support, but
that would have to be repeated for each added c++ support test.

Instead, fix this by doing:
...
CXX="g++ -std=gnu++11"
CXX_DIALECT=-std=gnu++11
...

This is somewhat awkward, since it results in -std=gnu++11 occuring twice in
some situations:
...
$ touch src/gdb/dwarf2/read.c
$ ( cd build/gdb; make V=1 dwarf2/read.o )
g++-4.8 -std=gnu++11 -x c++ -std=gnu++11 ...
...

However, both settings are needed:
 - the switch in CXX for the std::thread tests (and other tests)
 - the switch in CXX_DIALECT so it can be appended in Makefiles, to
   counteract the fact that the top-level Makefile overrides CXX

The code added in gdb/ax_cxx_compile_stdcxx.m4 is copied from the default
AX_CXX_COMPILE_STDCXX from autoconf-archive.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28318
2021-10-04 18:51:09 +02:00
..
.dir-locals.el gdb: additional settings for emacs in .dir-locals.el 2021-05-17 20:47:46 +01:00
.gitattributes gdb, gdbserver, gdbsupport: add .gitattributes files 2020-03-05 15:59:22 +01:00
acinclude.m4 gdb: move ptrace.m4 to gdbsupport 2020-10-25 21:08:49 -04:00
aclocal.m4 gdb: use AC_PROG_CC_STDC instead of AM_PROG_CC_STDC 2020-10-31 08:30:57 -04:00
agent.cc Remove defaulted 'tid' parameter to ptid_t constructor 2021-09-23 09:30:54 -06:00
agent.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
alt-stack.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-view.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ax.def Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
block-signals.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
break-common.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
btrace-common.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
btrace-common.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
buffer.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
buffer.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
byte-vector.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ChangeLog-2020-2021 gdb: move remaining ChangeLogs to legacy files 2021-07-26 12:20:33 +01:00
check-defines.el Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cleanups.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cleanups.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-debug.cc gdb: add remote_debug_printf 2021-01-22 12:43:27 -05:00
common-debug.h gdbsupport: allow passing format string to scoped_debug_start_end 2021-04-24 19:26:41 -04:00
common-defs.h [gdb/build] Disable attribute nonnull 2021-07-30 14:07:40 +02:00
common-exceptions.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-exceptions.h Replace exception_print_same with operator!= 2021-07-30 08:42:39 -06:00
common-gdbthread.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-inferior.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-inferior.h gdb: make inferior::m_cwd an std::string 2021-07-23 15:38:54 -04:00
common-regcache.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-regcache.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-types.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-utils.cc New memory-tag commands 2021-03-24 14:57:53 -03:00
common-utils.h New memory-tag commands 2021-03-24 14:57:53 -03:00
common.m4 gdbsupport/common.m4: check for sigtimedwait 2021-07-05 09:54:35 -04:00
config.in gdbsupport: remove attempt to define TARGET_WORD_SIZE 2021-10-04 10:52:35 +01:00
configure [gdb/build] Add CXX_DIALECT to CXX 2021-10-04 18:51:09 +02:00
configure.ac gdbsupport: remove attempt to define TARGET_WORD_SIZE 2021-10-04 10:52:35 +01:00
create-version.sh Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
def-vector.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
default-init-alloc.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
eintr.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
enum-flags.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
environ.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
environ.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
errors.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
errors.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
event-loop.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
event-loop.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
fileio.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
fileio.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
filestuff.cc gdbsupport: make gdb_open_cloexec return scoped_fd 2021-09-30 15:21:48 -04:00
filestuff.h gdbsupport: make gdb_mkostemp_cloexec return a scoped_fd 2021-09-30 15:21:48 -04:00
filtered-iterator.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
format.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
format.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
forward-scope-exit.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
function-view.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_assert.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_binary_search.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_file.h gdbsupport: move gdb_file_up to its own file 2021-09-30 15:21:48 -04:00
gdb_locale.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_optional.h gdbsupport: add debug assertions in gdb::optional::get 2021-08-03 08:50:56 -04:00
gdb_proc_service.h gdbsupport/gdb_proc_service.h: use decltype instead of typeof 2021-09-20 07:59:53 -04:00
gdb_ref_ptr.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_select.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_setjmp.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_signals.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_splay_tree.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_string_view.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_string_view.tcc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_sys_time.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_tilde_expand.cc Improve gdb_tilde_expand logic. 2021-01-23 17:17:38 +00:00
gdb_tilde_expand.h Improve gdb_tilde_expand logic. 2021-01-23 17:17:38 +00:00
gdb_unique_ptr.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_unlinker.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_vecs.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_vecs.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_wait.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb_wait.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb-dlfcn.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb-dlfcn.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb-safe-ctype.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
gdb-sigmask.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
hash_enum.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
host-defs.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
intrusive_list.h gdb: use intrusive list for step-over chain 2021-07-12 20:46:52 -04:00
iterator-range.h gdb: introduce iterator_range, remove next_adapter 2021-07-06 15:02:05 -04:00
job-control.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
job-control.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Makefile.am Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Makefile.in gdbsupport: re-generate configure & friends 2021-05-08 21:27:49 -04:00
netstuff.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
netstuff.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
new-op.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
next-iterator.h gdb: introduce iterator_range, remove next_adapter 2021-07-06 15:02:05 -04:00
observable.h gdbsupport: allow to specify dependencies between observers 2021-04-27 11:22:32 -04:00
offset-type.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
parallel-for.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
pathstuff.cc gdb: check for empty strings in get_standard_cache_dir/get_standard_config_dir 2021-01-08 13:46:56 -05:00
pathstuff.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
poison.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
preprocessor.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
print-utils.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
print-utils.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ptid.cc Change ptid_t::tid to ULONGEST 2021-09-23 09:30:54 -06:00
ptid.h Change ptid_t::tid to ULONGEST 2021-09-23 09:30:54 -06:00
ptrace.m4 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
README
refcounted-object.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
reference-to-pointer-iterator.h gdb: use intrusive list for step-over chain 2021-07-12 20:46:52 -04:00
rsp-low.cc New memory-tag commands 2021-03-24 14:57:53 -03:00
rsp-low.h New memory-tag commands 2021-03-24 14:57:53 -03:00
run-time-clock.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
run-time-clock.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
safe-iterator.h gdb: make all_inferiors_safe actually work 2021-07-17 08:54:40 -04:00
safe-strerror.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
scope-exit.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
scoped_fd.h gdbsupport: move gdb_file_up to its own file 2021-09-30 15:21:48 -04:00
scoped_ignore_signal.h gdb: fall back on sigpending + sigwait if sigtimedwait is not available 2021-07-05 09:54:58 -04:00
scoped_ignore_sigttou.h Don't call sigtimedwait for scoped_ignore_sigttou 2021-06-17 19:39:08 +01:00
scoped_mmap.cc gdbsupport: make gdb_open_cloexec return scoped_fd 2021-09-30 15:21:48 -04:00
scoped_mmap.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
scoped_restore.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
search.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
search.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
selftest.cc [gdb] Add maint selftest -verbose option 2021-09-22 11:47:50 +02:00
selftest.h [gdb] Add maint selftest -verbose option 2021-09-22 11:47:50 +02:00
selftest.m4 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
signals-state-save-restore.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
signals-state-save-restore.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
signals.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
symbol.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tdesc.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tdesc.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
thread-pool.cc Use rvalue reference in thread_pool::post_task 2021-04-30 10:04:56 -06:00
thread-pool.h Use rvalue reference in thread_pool::post_task 2021-04-30 10:04:56 -06:00
traits.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
underlying.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
valid-expr.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
version.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
warning.m4 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
x86-xstate.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
xml-utils.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
xml-utils.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00

This is a helper library that is used by gdb and gdbserver.

To send patches, follow the gdb patch submission instructions in
../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.