Commit Graph

112523 Commits

Author SHA1 Message Date
Joel Brobecker
4f3e26ac6e Set GDB version number to 13.1.
This commit changes gdb/version.in to 13.1.
gdb-13.1-release
2023-02-19 17:45:06 +04:00
GDB Administrator
9761733ec7 Automatic date update in version.in 2023-02-19 00:00:50 +00:00
Tom Tromey
7f4307436f Fix "start" for D, Rust, etc
The new DWARF indexer broke "start" for some languages.

For D, it is broken because, while the code in cooked_index_shard::add
specifically excludes Ada, it fails to exclude D.  This means that the
C "main" will be detected as "main" here -- whereas what is intended
is for the code in find_main_name to use d_main_name to find the name.

The Rust compiler, on the other hand, uses DW_AT_main_subprogram.
However, the code in dwarf2_build_psymtabs_hard fails to create a
fully-qualified name, so the name always ends up as plain "main".

For D and Ada, a very simple approach suffices: remove the check
against "main" from cooked_index_shard::add.  This also has the
benefit of slightly speeding up DWARF indexing.  I assume this
approach will work for Pascal and Modula-2 as well, but I don't have a
way to test those at present.

For Rust, though, this is not sufficient.  And, computing the
fully-qualified name in dwarf2_build_psymtabs_hard will crash, because
cooked_index_entry::full_name uses the canonical name -- and that is
not computed until after canonicalization.

However, we don't want to wait for canonicalization to be done before
computing the main name.  That would remove any benefit from doing
canonicalization is the background.

This patch solves this dilemma by noticing that languages using
DW_AT_main_subprogram are, currently, disjoint from languages
requiring canonicalization.  Because of this, we can add a parameter
to full_name to let us avoid crashes, slowdowns, and races here.

This is kind of tricky and ugly, so I've tried to comment it
sufficiently.

While doing this, I had to change gdb.dwarf2/main-subprogram.exp.  A
different possibility here would be to ignore the canonicalization
needs of C in this situation, because those only affect certain types.
However, I chose this approach because the test case is artificial
anyhow.

A long time ago, in an earlier threading attempt, I changed the global
current_language to be a function (hidden behind a macro) to let us
attempt lazily computing the current language.  Perhaps this approach
could still be made to work.  However, that also seemed rather tricky,
more so than this patch.

Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30116
(cherry picked from commit 47fe57c928)
2023-02-18 16:30:31 -07:00
GDB Administrator
c7c263ea9c Automatic date update in version.in 2023-02-18 00:00:27 +00:00
GDB Administrator
ba1572b512 Automatic date update in version.in 2023-02-17 00:00:39 +00:00
GDB Administrator
34c8bf99b6 Automatic date update in version.in 2023-02-16 00:00:38 +00:00
GDB Administrator
53622d843b Automatic date update in version.in 2023-02-15 00:00:44 +00:00
GDB Administrator
3053fcf3d1 Automatic date update in version.in 2023-02-14 00:00:44 +00:00
Keith Seitz
c594b6f7d5 Fix doc build dependencies for --with-system-readline
PR build/30108 concerns building gdb documentation with
--with-sytem-readline.  If the in-tree readline directory is
missing, though, the docs will fail to build:

make[4]: Entering directory '/home/keiths/work/readline-doc-issue/linux/gdb/doc'
make[4]: *** No rule to make target '../../../src/gdb/doc/../../readline/readline/doc/rluser.texi', needed by 'gdb.info'.  Stop.

The listed file (and hsuser.texi) are conditionally included by gdb.texinfo.
When system readline is used, gdb/configure.ac will leave
READLINE_TEXI_INCFLAGS empty, causing doc/Makefile.in to output a line to
$BUILD/doc/GDBvn.texi with "@set SYSTEM_READLINE".  This surpresses the
inclusion of the missing files. They are not needed or used in this
scenario.

However, GDB_DOC_SOURCE_INCLUDES always lists these two files as dependencies,
thus provoking the build error whenever readline/ is missing.

This patch fixes this by creating (essentially) a conditional setting of the
dependencies to be included from readline.
2023-02-13 06:20:58 -08:00
GDB Administrator
6e92595dc2 Automatic date update in version.in 2023-02-13 00:00:26 +00:00
GDB Administrator
62f2dfcc74 Automatic date update in version.in 2023-02-12 00:00:26 +00:00
GDB Administrator
4b69f04bd8 Automatic date update in version.in 2023-02-11 00:00:32 +00:00
GDB Administrator
a0f9e84579 Automatic date update in version.in 2023-02-10 00:00:34 +00:00
GDB Administrator
8364dca17d Automatic date update in version.in 2023-02-09 00:00:43 +00:00
GDB Administrator
257660c3de Automatic date update in version.in 2023-02-08 00:00:45 +00:00
GDB Administrator
e045e0fa77 Automatic date update in version.in 2023-02-07 00:00:45 +00:00
GDB Administrator
5f157ecd60 Automatic date update in version.in 2023-02-06 00:00:44 +00:00
GDB Administrator
9a7d273178 Automatic date update in version.in 2023-02-05 00:00:37 +00:00
GDB Administrator
3199e96dae Automatic date update in version.in 2023-02-04 00:00:28 +00:00
GDB Administrator
39d4bba77d Automatic date update in version.in 2023-02-03 00:00:42 +00:00
Joel Brobecker
83f1f651c7 Bump GDB's version number to 13.0.91.DATE-git.
This commit changes gdb/version.in to 13.0.91.DATE-git.
2023-02-02 09:23:37 +04:00
Nick Clifton
16c45b9ab6 Ensure that libbacktrace/allocfail.sh is not deleted when creating release tarballs.
* Makefile.am (CLEANFILES): Import patch from upstream to prevent
        allocafail.sh from being removed when running 'make clean'.

(cherry picked from commit edf64cd235)
2023-02-02 08:54:49 +04:00
Joel Brobecker
a27bbd9878 Set GDB version number to 13.0.91.
This commit changes gdb/version.in to 13.0.91.
2023-02-02 07:55:07 +04:00
Joel Brobecker
cc49130bda gdb/NEWS: Change "Changes since GDB 12" to "Changes in GDB 13".
Now that the version number is confirmed to GDB 13, this commit
updates the gdb/NEWS file accordingly, as per GDB's release procedures.
2023-02-02 07:49:08 +04:00
GDB Administrator
7b48b6d70a Automatic date update in version.in 2023-02-02 00:00:28 +00:00
GDB Administrator
59f9d0c5cb Automatic date update in version.in 2023-02-01 00:00:45 +00:00
Torbjörn SVENSSON
7944d45790 gdb/arm: Use new dwarf2 function cache
This patch resolves the performance issue reported in pr/29738 by
caching the values for the stack pointers for the inner frame.  By
doing so, the impact can be reduced to checking the state and
returning the appropriate value.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Signed-off-by: Yvan Roux <yvan.roux@foss.st.com>
2023-01-31 13:39:01 +00:00
Torbjörn SVENSSON
2d36c9404e gdb: dwarf2 generic implementation for caching function data
When there is no dwarf2 data for a register, a function can be called
to provide the value of this register.  In some situations, it might
not be trivial to determine the value to return and it would cause a
performance bottleneck to do the computation each time.

This patch allows the called function to have a "cache" object that it
can use to store some metadata between calls to reduce the performance
impact of the complex logic.

The cache object is unique for each function and frame, so if there are
more than one function pointer stored in the dwarf2_frame_cache->reg
array, then the appropriate pointer will be supplied (the type is not
known by the dwarf2 implementation).

dwarf2_frame_get_fn_data can be used to retrieve the function unique
cache object.
dwarf2_frame_allocate_fn_data can be used to allocate and retrieve the
function unique cache object.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Signed-off-by: Yvan Roux <yvan.roux@foss.st.com>
2023-01-31 13:38:44 +00:00
GDB Administrator
ccb99ed2cb Automatic date update in version.in 2023-01-31 00:00:36 +00:00
Tom Tromey
7ba1fc5a18 Fix comparator bug in cooked index
Simon pointed out that the cooked index template-matching patch
introduced a failure in libstdc++ debug mode.  In particular, the new
code violates the assumption of std::lower_bound and std::upper_bound
that the range is sorted with respect to the comparison.

When I first debugged this, I thought the problem was unfixable as-is
and that a second layer of filtering would have to be done.  However,
on irc, Simon pointed out that it could perhaps be solved if the
comparison function were assured that one operand always came from the
index, with the other always being the search string.

This patch implements this idea.

First, a new mode is introduced: a sorting mode for
cooked_index_entry::compare.  In this mode, strings are compared
case-insensitively, but we're careful to always sort '<' before any
other printable character.  This way, two names like "func" and
"func<param>" will be sorted next to each other -- i.e., "func1" will
not be seen between them.  This is important when searching.

Second, the compare function is changed to work in a strcmp-like way.
This makes it easier to test and (IMO) understand.

Third, the compare function is modified so that in non-sorting modes,
the index entry is always the first argument.  This allows consistency
in compares.

I regression tested this in libstdc++ debug mode on x86-64 Fedora 36.
It fixes the crash that Simon saw.

This is v2.  I believe it addresses the review comments, except for
the 'enum class' change, as I mentioned in email on the list.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

(cherry picked from commit c121e82c39)
2023-01-30 10:49:55 -07:00
GDB Administrator
f36a570ad4 Automatic date update in version.in 2023-01-30 00:00:51 +00:00
GDB Administrator
ce6dea4c4c Automatic date update in version.in 2023-01-29 00:01:35 +00:00
GDB Administrator
c6a722b3c3 Automatic date update in version.in 2023-01-28 00:01:00 +00:00
GDB Administrator
0dd4a8af81 Automatic date update in version.in 2023-01-27 00:00:34 +00:00
GDB Administrator
e0f4beb3a0 Automatic date update in version.in 2023-01-26 00:00:33 +00:00
GDB Administrator
12dd2ec62f Automatic date update in version.in 2023-01-25 00:00:51 +00:00
GDB Administrator
b07439230b Automatic date update in version.in 2023-01-24 00:00:57 +00:00
GDB Administrator
a0ab91c141 Automatic date update in version.in 2023-01-23 00:00:53 +00:00
GDB Administrator
7f2778a363 Automatic date update in version.in 2023-01-22 00:00:30 +00:00
GDB Administrator
378135c586 Automatic date update in version.in 2023-01-21 00:00:33 +00:00
GDB Administrator
80e3c0c758 Automatic date update in version.in 2023-01-20 00:00:38 +00:00
GDB Administrator
6008f313d3 Automatic date update in version.in 2023-01-19 00:00:48 +00:00
GDB Administrator
ca1b45b87c Automatic date update in version.in 2023-01-18 00:00:49 +00:00
Tom Tromey
83d3152401 Fix parameter-less template regression in new DWARF reader
PR c++/29896 points out a regression in the new DWARF reader.  It does
not properly handle a case like "break fn", where "fn" is a template
function.

This happens because the new index uses strncasecmp to compare.
However, to make this work correctly, we need a custom function that
ignores template parameters.

This patch adds a custom comparison function and fixes the bug.  A new
test case is included.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29896

(cherry picked from commit ac37b79cc4)
2023-01-17 07:07:00 -07:00
Tom Tromey
947b698401 Move hash_entry and eq_entry into cooked_index::do_finalize
I was briefly confused by the hash_entry and eq_entry functions in the
cooked index.  They are only needed in a single method, and that
method already has a couple of local lambdas for a different hash
table.  So, it seemed cleaner to move these there as well.

(cherry picked from commit 5a89072f36)
2023-01-17 07:06:58 -07:00
Tom Tromey
6107546876 Avoid submitting empty tasks in parallel_for_each
I found that parallel_for_each would submit empty tasks to the thread
pool.  For example, this can happen if the number of tasks is smaller
than the number of available threads.  In the DWARF reader, this
resulted in the cooked index containing empty sub-indices.  This patch
arranges to instead shrink the result vector and process the trailing
entries in the calling thread.

(cherry picked from commit 63078a0498)
2023-01-17 07:06:56 -07:00
GDB Administrator
2ec9694617 Automatic date update in version.in 2023-01-17 00:01:16 +00:00
GDB Administrator
5d53fb99d5 Automatic date update in version.in 2023-01-16 00:01:01 +00:00
GDB Administrator
e6a3c6ab33 Automatic date update in version.in 2023-01-15 00:01:00 +00:00
GDB Administrator
b6762b3d7c Automatic date update in version.in 2023-01-14 00:00:38 +00:00