• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/cbiesinger/parallel-minsyms-mutex
RSS
Rev. Time Author
b4fbb96 users/cbiesinger/parallel-minsyms-mutex 2019-10-04 03:17:12 Christian Biesinger

Precompute hash value for symbol_set_names

We can also compute the hash for the mangled name on a background
thread so make this function even faster (about a 7% speedup).

gdb/ChangeLog:

2019-10-03 Christian Biesinger <cbiesinger@google.com>

* minsyms.c (minimal_symbol_reader::install): Also compute the hash
of the mangled name on the background thread.
* symtab.c (symbol_set_names): Allow passing in the hash of the
linkage_name.
* symtab.h (symbol_set_names): Likewise.

e1f6a52 2019-10-04 03:15:36 Christian Biesinger

Don't use the mutex for each symbol_set_names call

This avoids the lock contention that was seen with tromey's patch (it
moves it to a once- per-thread lock call from a once-per-symbol call).

It speeds up "attach to Chrome's content_shell binary" from 50 sec -> 30
sec (32%).

See https://sourceware.org/ml/gdb-patches/2019-10/msg00087.html for some
more speed measurements.

gdb/ChangeLog:

2019-09-28 Christian Biesinger <cbiesinger@google.com>

* minsyms.c (minimal_symbol_reader::install): Only do
demangling on the background thread; still call
symbol_set_names on the main thread.
* symtab.c (symbol_find_demangled_name): Make public,
so that minsyms.c can call it.
(symbol_set_names): Remove mutex. Avoid demangle call
if the demangled name is already set.
* symtab.h (symbol_find_demangled_name): Make public.

fee9737 2019-10-02 04:38:26 Tom Tromey

Use run_on_main_thread in gdb.post_event

This changes gdb.post_event to use the new run_on_main_thread
function. This is somewhat tricky because the Python GIL must be held
while manipulating reference counts.

2019-09-30 Tom Tromey <tom@tromey.com>

* python/python.c (class gdbpy_gil): New.
(struct gdbpy_event): Add constructor, destructor, operator().
(gdbpy_post_event): Use run_on_main_thread.
(gdbpy_initialize_events): Remove.
(do_start_initialization): Update.


792581b 2019-10-02 04:38:26 Tom Tromey

Add maint set/show max-worker-threads

This adds maint commands to control the maximum number of worker
threads that gdb can use.

2019-09-30 Tom Tromey <tom@tromey.com>

* NEWS: Add entry.
* maint.c (_initialize_maint_cmds): Add "max-worker-threads" maint
commands.

gdb/doc/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* gdb.texinfo (Maintenance Commands): Document new maint
commands.


cec2f67 2019-10-02 04:38:24 Tom Tromey

Demangle minsyms in parallel

This patch introduces a simple parallel for_each and changes the
minimal symbol reader to use it when computing the demangled name for
a minimal symbol. This yields a speedup when reading minimal symbols.

gdb/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* minsyms.c (minimal_symbol_reader::install): Use
parallel_for_each.
* gdbsupport/parallel-for.h: New file.
* gdbsupport/parallel-for.c: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add gdbsupport/parallel-for.h.
(COMMON_SFILES): Add gdbsupport/parallel-for.c.

8c0fae4 2019-10-01 11:30:39 Tom Tromey

Introduce thread-safe way to handle SIGSEGV

The gdb demangler installs a SIGSEGV handler in order to protect gdb
from demangler bugs. However, this is not thread-safe, as signal
handlers are global to the process.

This patch changes gdb to always install a global SIGSEGV handler, and
then lets threads indicate their interest in handling the signal by
setting a thread-local variable.

This patch then arranges for the demangler code to use this; being
sure to arrange for calls to warning and the like to be done on the
main thread.

One thing I wondered while writing this patch is if there are any
systems that do not have "sigaction". If gdb could assume this, it
would simplify this code.

gdb/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* event-top.h (thread_local_segv_handler): Declare.
* event-top.c (thread_local_segv_handler): New global.
(install_handle_sigsegv, handle_sigsegv): New functions.
(async_init_signals): Install SIGSEGV handler.
* cp-support.c (gdb_demangle_jmp_buf): Change type. Now
thread-local.
(report_failed_demangle): New function.
(gdb_demangle): Make core_dump_allowed atomic. Remove signal
handler-setting code, instead use segv_handler. Run warning code
on main thread.

0e0174f 2019-10-01 11:30:39 Tom Tromey

Introduce run_on_main_thread

This introduces a way for a callback to be run on the main thread.

gdb/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* unittests/main-thread-selftests.c: New file.
* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
main-thread-selftests.c.
* ser-event.h (run_on_main_thread): Declare.
* ser-event.c (runnable_event, runnables, runnable_mutex): New
globals.
(run_events, run_on_main_thread, _initialize_ser_event): New
functions.

7e3ed55 2019-10-01 11:30:39 Tom Tromey

Lock the demangled hash table

This introduces a lock that is used when modifying the demangled hash
table.

gdb/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* symtab.c (demangled_mutex): New global.
(symbol_set_names): Use a lock_guard.

64a0d2a 2019-10-01 11:30:39 Tom Tromey

Introduce alternate_signal_stack RAII class

This introduces a new RAII class that temporarily installs an
alternate signal stack (on systems that have sigaltstack); then
changes the one gdb use of sigaltstack to use this class instead.

This will be used in a later patch, when creating new threads that may
want to handle SIGSEGV.

gdb/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* main.c (setup_alternate_signal_stack): Remove.
(captured_main_1): Use gdb::alternate_signal_stack.
* gdbsupport/alt-stack.h: New file.

236bb4b 2019-10-01 11:30:39 Tom Tromey

Add RAII class for blocking gdb signals

This adds configury support and an RAII class that can be used to
temporarily block signals that are used by gdb. (This class is not
used in this patch, but it split out for easier review.)

The idea of this patch is that these signals should only be delivered
to the main thread. So, when creating a background thread, they are
temporarily blocked; the blocked state is inherited by the new thread.

gdb/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* gdbsupport/common.m4 (GDB_AC_COMMON): Check for
pthread_sigmask.
* configure: Rebuild.
* gdbsupport/block-signals.h: New file.

gdb/gdbserver/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* configure: Rebuild.

43a189f 2019-10-01 11:30:39 Tom Tromey

Add configure check for std::thread

This adds a configure check for std::thread. This is needed because
std::thread is not available on some systems, like some versions of
mingw and DJGPP.

This also adds configury to make sure that a threaded gdb links
against the correct threading library (-lpthread or the like), and
passes the right flags (e.g., -pthread) to the compilations.

gdb/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* acinclude.m4: Include ax_pthread.m4.
* Makefile.in (PTHREAD_CFLAGS, PTHREAD_LIBS): New variables.
(INTERNAL_CFLAGS_BASE): Use PTHREAD_CFLAGS.
(CLIBS): Use PTHREAD_LIBS.
(aclocal_m4_deps): Add ax_pthread.m4.
* config.in, configure: Rebuild.
* gdbsupport/common.m4 (GDB_AC_COMMON): Check for std::thread.

gdb/gdbserver/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* acinclude.m4: Include ax_pthread.m4.
* config.in, configure: Rebuild.

15c2f63 2019-10-01 11:30:39 Tom Tromey

Defer minimal symbol name-setting

Currently the demangled name of a minimal symbol is set when creating
the symbol. However, there is no intrinsic need to do this. This
patch instead arranges for the demangling to be done just before the
minsym hash tables are filled. This will be useful in a later patch.

gdb/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* symtab.h (struct minimal_symbol) <name_set>: New member.
* minsyms.c (minimal_symbol_reader::record_full): Copy name.
Don't call symbol_set_names.
(minimal_symbol_reader::install): Call symbol_set_names.

536a122 2019-10-01 11:30:39 Tom Tromey

Use m4_include, not sinclude in .m4 files

Pedro pointed out that sinclude does not error if a file is missing.
This patch changes gdb to only use m4_include, which seems more
correct.

gdb/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* configure: Rebuild.
* acinclude.m4: Use m4_include, not sinclude.

gdb/gdbserver/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* configure: Rebuild.
* acinclude.m4: Use m4_include, not sinclude.

gdb/testsuite/ChangeLog
2019-09-30 Tom Tromey <tom@tromey.com>

* configure: Rebuild.
* aclocal.m4: Use m4_include, not sinclude.

8fe0f95 2019-10-01 10:00:41 Ali Tamur

[PATCH v2 2/4] DWARF 5 support: Handle DW_FORM_strx

* Handle DW_FORM_strx forms everywhere.

Tested with CC=/usr/bin/gcc (version 8.3.0) against master branch (also with
-gsplit-dwarf and -gdwarf-4 flags) and there was no increase in the set of
tests that fails.

This is part of an effort to support DWARF 5 in gdb.

gdb/ChangeLog:

* dwarf2read.c (skip_one_die): Handle DW_FORM_strx forms.
(dwarf2_string_attr): Likewise.

af79fcc 2019-10-01 09:00:41 GDB Administrator

Automatic date update in version.in

5f48f8f 2019-10-01 06:00:52 Ali Tamur

Remove extra whitespaces at the end of lines.

gdb/ChangeLog:

* dwarf2read.c (process_full_comp_unit): Remove whitespace at the EOL.
(process_full_type_unit): Likewise.
(dump_die_shallow): Likewise.
(cu_debug_loc_section): Likewise.

6fb0862 2019-10-01 03:32:32 Christian Biesinger

Use std::sort instead of qsort in minsyms.c

This has better typesafety and is also marginally faster (either
due to inlining or because it avoids indirection through a
function pointer).

Note that in this change:
- return 1; /* fn1 has no name, so it is "less". */
+ return true; /* fn1 has no name, so it is "less". */
else if (name1) /* fn2 has no name, so it is "less". */
- return -1;
+ return false;
I am fairly sure the old code was wrong (ie. code didn't match the
comment and the comment seemed correct), so I fixed it.

gdb/ChangeLog:

2019-09-28 Christian Biesinger <cbiesinger@google.com>

* minsyms.c (compare_minimal_symbols): Rename to...
(minimal_symbol_is_less_than): ...this, and adjust to STL
conventions (return bool, take arguments as references)
(minimal_symbol_reader::install): Call std::sort instead
of qsort.

4a56a52 2019-10-01 01:34:36 Tom Tromey

Disable all warnings in gdb.rust/traits.rs

With rustc 1.37, I started seeing compiler warnings from the traits.rs
test case:

warning: trait objects without an explicit `dyn` are deprecated

It seems to me that we generally do not want warnings in these test
cases. At some point, we'll probably have to patch traits.rs to use
the "dyn" keyword; by that time I expect that all the Rust compilers
in common use will support it. In the meantime it seemed simplest to
simply disable all warnings in this file.

gdb/testsuite/ChangeLog
2019-09-30 Tom Tromey <tromey@adacore.com>

* gdb.rust/traits.rs: Disable all warnings.

c7ee338 2019-10-01 01:21:46 Christian Biesinger

Improve some comments about msymbol handling

This just clarifies some comments about the hashtables involved
in msymbols.

gdb/ChangeLog:

2019-09-29 Christian Biesinger <cbiesinger@google.com>

* minsyms.h (msymbol_hash): Document that this is a case-insensitive
hash and why.
* objfiles.h (struct objfile_per_bfd_storage) <demangled_names_hash,
msymbol_hash, msymbol_demangled_hash>: Improve comments.

703a86c 2019-10-01 00:49:57 Simon Marchi

gdb: re-write add_psymbol_to_list doc, move it to header file

The comment above the add_psymbol_to_list function seems outdated and
misleading, here's an attempt at improving it.

gdb/ChangeLog:

* psymtab.c (add_psymbol_to_list): Move comment to psympriv.h.
* psympriv.h (add_psymbol_to_list): Move comment here and update
it.

663f67d 2019-09-30 13:48:14 Alan Modra

PR25046, readelf "Reading xxx bytes extends past end of file for dynamic section"

PR 25046
* readelf.c (process_program_headers): Clear dynamic_addr and
dynamic_size earlier.

0925bc8 2019-09-30 09:00:33 GDB Administrator

Automatic date update in version.in

0df0352 2019-09-30 06:58:21 Tom de Vries

[gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir

When running a test-case gdb.base/foo.exp with cc-with-dwz-m, a file
build/gdb/testsuite/outputs/gdb.base/foo/foo.dwz will be created, alongside
executable build/gdb/testsuite/outputs/gdb.base/foo/foo.

This can cause problems in f.i. test-cases that test file name completion.

Make these problems less likely by moving foo.dwz to a .tmp subdir:
build/gdb/testsuite/outputs/gdb.base/foo/.tmp/foo.dwz.

Tested on x86_64-linux.

gdb/ChangeLog:

2019-09-29 Tom de Vries <tdevries@suse.de>

* contrib/cc-with-tweaks.sh (get_tmpdir): New function.
Use $tmpdir/$(basename "$output_file").dwz instead of
"${output_file}.dwz".

gdb/testsuite/ChangeLog:

2019-09-29 Tom de Vries <tdevries@suse.de>

* gdb.dwarf2/gdb-index.exp: Handle new location of .dwz file.

73d9a91 2019-09-30 06:51:50 Tom de Vries

[gdb/testsuite] Make pass message unique in gdb-index.exp for cc-with-dwz-m

With cc-with-dwz-m, we get:
...
PASS: gdb.dwarf2/gdb-index.exp: objcopy
PASS: gdb.dwarf2/gdb-index.exp: objcopy
...

Make the pass message unique by using with_test_prefix:
...
PASS: gdb.dwarf2/gdb-index.exp: objcopy
PASS: gdb.dwarf2/gdb-index.exp: modify dwz file: objcopy
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-09-29 Tom de Vries <tdevries@suse.de>

* gdb.dwarf2/gdb-index.exp: Use with_test_prefix for second objcopy.

612aac6 2019-09-29 09:00:40 GDB Administrator

Automatic date update in version.in

ad75efa 2019-09-29 03:48:22 Simon Marchi

gdb: include gdbarch.h in hppa-linux-nat.c

hppa-linux-nat.c fails to build due to the gdbarch stuff not being
declared, for example:

hppa-linux-nat.c: In function ‘void fetch_register(regcache*, int)’:
hppa-linux-nat.c:230:7: error: ‘gdbarch_cannot_fetch_register’ was not declared in this scope
if (gdbarch_cannot_fetch_register (gdbarch, regno))

Include gdbarch.h to fix it.

gdb/ChangeLog:

PR gdb/25045
* hppa-linux-nat.c: Include gdbarch.h.

ea8e302 2019-09-28 16:17:52 Alan Modra

PR16794, gold ignores R_386_GOTOFF addend

An R_386_GOTOFF relocation has an addend, typically used when a
symbol can be replaced by its section symbol plus an offset.
psymval->value(object,0) is quite wrong then, fix it.

PR 16794
* i386.cc (Target_i386::Relocate::relocate <R_386_GOTOFF>): Don't
ignore addend, apply using pcrel32.
* x86_64.cc (Target_x86_64::Relocate::relocate <R_X86_64_GOTOFF64>):
Similarly use pcrel64.

cd5f43f 2019-09-28 09:00:25 GDB Administrator

Automatic date update in version.in

060b3ab 2019-09-28 00:04:59 Tom de Vries

[gdb/testsuite] Fix incomplete regexps in step-precsave.exp

The commit 68f7d34dd50 "[gdb/testsuite] Add KFAIL for missing support of
reverse-debugging of vmovd" rewrites a gdb_test into a gdb_test_multiple but
forgets to add the $gdb_prompt part in the regexp.

Add the missing parts of the regexps.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-09-27 Tom de Vries <tdevries@suse.de>

* gdb.reverse/step-precsave.exp: Add missing $gdb_prompt in regexps.

68f7d34 2019-09-27 17:36:18 Tom de Vries

[gdb/testsuite] Add KFAIL for missing support of reverse-debugging of vmovd

On my openSUSE Leap 15.1 system I run into:
...
(gdb) PASS: gdb.reverse/step-precsave.exp: turn on process record
break 76^M
Breakpoint 2 at 0x400654: file step-reverse.c, line 76.^M
(gdb) PASS: gdb.reverse/step-precsave.exp: breakpoint at end of main
continue^M
Continuing.^M
Process record does not support instruction 0xc5 at address 0x7ffff783fc70.^M
Process record: failed to record execution log.^M
^M
Program stopped.^M
0x00007ffff783fc70 in __memset_avx2_unaligned_erms () from /lib64/libc.so.6^M
(gdb) FAIL: gdb.reverse/step-precsave.exp: run to end of main
...

The problem is that the vmovd instruction is not supported in
reverse-debugging (PR record/23188).

Add a KFAIL for this PR.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-09-27 Tom de Vries <tdevries@suse.de>

PR record/23188
* gdb.reverse/step-precsave.exp: Add kfail for PR record/23188.