]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
20 months agoAutomatic date update in version.in
GDB Administrator [Sun, 26 Nov 2023 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Sat, 25 Nov 2023 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Fri, 24 Nov 2023 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Thu, 23 Nov 2023 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Wed, 22 Nov 2023 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Tue, 21 Nov 2023 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Mon, 20 Nov 2023 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Sun, 19 Nov 2023 00:00:24 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Sat, 18 Nov 2023 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoIgnore static members in NoOpStructPrinter
Tom Tromey [Mon, 13 Nov 2023 21:03:58 +0000 (14:03 -0700)] 
Ignore static members in NoOpStructPrinter

Hannes' patch to show local variables in the TUI pointed out that
NoOpStructPrinter should ignore static members.  This patch implements
this.

(cherry picked from commit 4a1b9a4badc8954221926b231b81392fa625653c)

20 months agoImplement the notStopped DAP response
Tom Tromey [Tue, 7 Nov 2023 15:44:44 +0000 (08:44 -0700)] 
Implement the notStopped DAP response

DAP specifies that a request can fail with the "notStopped" message if
the inferior is running but the request requires that it first be
stopped.

This patch implements this for gdb.  Most requests are assumed to
require a stopped inferior, and the exceptions are noted by a new
'request' parameter.

You may notice that the implementation is a bit racy.  I think this is
inherent -- unless the client waits for a stop event before sending a
request, the request may be processed at any time relative to a stop.

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

Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
(cherry picked from commit cfd00e8050a58aacc6489ec0379908be1a12be73)

20 months agoRemove ExecutionInvoker
Tom Tromey [Mon, 6 Nov 2023 21:29:06 +0000 (14:29 -0700)] 
Remove ExecutionInvoker

ExecutionInvoker is no longer really needed, due to the previous DAP
refactoring.  This patch removes it in favor of an ordinary function.
One spot (the 'continue' request) could still have used it, but is
more succinctly expressed as a lambda.

Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
(cherry picked from commit 68caad9d0b06d0ac231ce083ff62410a5a1806c1)

20 months agoAutomatically run (most) DAP requests in gdb thread
Tom Tromey [Mon, 6 Nov 2023 20:31:17 +0000 (13:31 -0700)] 
Automatically run (most) DAP requests in gdb thread

Nearly every DAP request implementation forwards its work to the gdb
thread, using send_gdb_with_response.  This patch refactors the
'request' decorator to make this automatic, and to provide some
parameters so that the unusual requests can express their needs as
well.

In a few spots this simplifies the code by removing an unnecessary
helper function.  This could be done in more places as well if we
wanted.

The main motivation for this patch is that I thought it would be
helpful for cancellation.  I am still working on that, but meanwhile
the parameterization of 'request' makes it easy to handle the
'notStopped' response as well.

Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
(cherry picked from commit c98921b258b55272c5b4066d96441e4e07626eb2)

20 months agoHandle StackFrameFormat in DAP
Tom Tromey [Fri, 6 Oct 2023 19:40:39 +0000 (13:40 -0600)] 
Handle StackFrameFormat in DAP

DAP specifies a StackFrameFormat object that can be used to change how
the "name" part of a stack frame is constructed.  While this output
can already be done in a nicer way (and also letting the client choose
the formatting), nevertheless it is in the spec, so I figured I'd
implement it.

While implementing this, I discovered that the current code does not
correctly preserve frame IDs across requests.  I rewrote frame
iteration to preserve this, and it turned out to be simpler to combine
these patches.

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

(cherry picked from commit 1920148904fe5ca0035c1addf2376f9ab13ffd3d)

20 months agoAutomatic date update in version.in
GDB Administrator [Fri, 17 Nov 2023 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Thu, 16 Nov 2023 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoMinor cleanups in ada-nested.exp
Tom Tromey [Wed, 15 Nov 2023 14:50:19 +0000 (07:50 -0700)] 
Minor cleanups in ada-nested.exp

This changes ada-nested.exp to fix a test name (the test expects three
variables but is named "two"), and to iterate over all the variables
that are found.  It also adds a workaround to a problem Tom de Vries
found with an older version of GNAT -- it emits a duplicate "x".

(cherry picked from commit e1ccbfffb5e0121c084898ac63f042187621d4ec)

20 months agoAutomatic date update in version.in
GDB Administrator [Wed, 15 Nov 2023 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoUpdate gdb.Symbol.is_variable documentation
Tom Tromey [Tue, 31 Oct 2023 15:16:08 +0000 (09:16 -0600)] 
Update gdb.Symbol.is_variable documentation

Kévin found a bug in an earlier version of this series that was based
on a misconception I had about Symbol.is_variable.  This patch fixes
the documentation to explain the method a bit better.

Approved-By: Eli Zaretskii <eliz@gnu.org>
(cherry picked from commit 5006ea556dad71c4c868cf5705e007e72e3b02b4)

20 months agoHandle the static link in FrameDecorator
Tom Tromey [Mon, 30 Oct 2023 16:52:20 +0000 (10:52 -0600)] 
Handle the static link in FrameDecorator

A co-worker requested that the DAP scope for a nested function's frame
also show the variables from outer frames.  DAP doesn't directly
support this notion, so this patch arranges to put these variables
into the inner frames "Locals" scope.

I chose to do this only for DAP.  For CLI and MI, gdb currently does
not do this, so this preserves the behavior.

Note that an earlier patch (see commit 4a1311ba) removed some code
that seemed to do something similar.  However, that code did not
actually work.

(cherry picked from commit ebea770b19c09489fe5e2cb5c1fd568f0f21e17e)

20 months agoFix a bug in DAP scopes code
Tom Tromey [Mon, 30 Oct 2023 16:23:35 +0000 (10:23 -0600)] 
Fix a bug in DAP scopes code

While working on static links, I noticed that the DAP scopes code does
not handle the scenario where a frame decorator returns None.  This
situation should be handled identically to a frame decorator returning
an empty iterator.

(cherry picked from commit e9dacb1d6caa5770d3e1722adc0ec74ff13a7a89)

20 months agoAdd gdb.Frame.static_link method
Tom Tromey [Tue, 24 Oct 2023 14:05:06 +0000 (08:05 -0600)] 
Add gdb.Frame.static_link method

This adds a new gdb.Frame.static_link method to the gdb Python layer.
This can be used to find the static link frame for a given frame.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
(cherry picked from commit 4ead09a294adbb718d642874a554e78d931c2830)

20 months agoMove follow_static_link to frame.c
Tom Tromey [Tue, 24 Oct 2023 13:59:51 +0000 (07:59 -0600)] 
Move follow_static_link to frame.c

This moves the follow_static_link function to frame.c and exports it
for use elsewhere.  The API is changed slightly to make it more
generically useful.

(cherry picked from commit 19b83d5c9bac1db207dce26859c6ca84135615b0)

20 months agoAdd block::function_block
Tom Tromey [Tue, 24 Oct 2023 13:53:29 +0000 (07:53 -0600)] 
Add block::function_block

This adds the method block::function_block, to easily access a block's
enclosing function block.

(cherry picked from commit ba707cadae18a7cc8bb47a736d3d0438d44262a9)

20 months agoAdd two convenience methods to block
Tom Tromey [Tue, 24 Oct 2023 13:27:01 +0000 (07:27 -0600)] 
Add two convenience methods to block

This adds a couple of convenience methods, block::is_static_block and
block::is_global_block.

(cherry picked from commit edf1b9640bbc981c8a094d6ca29d444b1ed50a2c)

20 months agoAutomatic date update in version.in
GDB Administrator [Tue, 14 Nov 2023 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Mon, 13 Nov 2023 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Sun, 12 Nov 2023 00:00:26 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Sat, 11 Nov 2023 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Fri, 10 Nov 2023 00:00:22 +0000 (00:00 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Thu, 9 Nov 2023 00:01:01 +0000 (00:01 +0000)] 
Automatic date update in version.in

20 months agoAutomatic date update in version.in
GDB Administrator [Wed, 8 Nov 2023 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Tue, 7 Nov 2023 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Mon, 6 Nov 2023 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Sun, 5 Nov 2023 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Sat, 4 Nov 2023 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Fri, 3 Nov 2023 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Thu, 2 Nov 2023 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Wed, 1 Nov 2023 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

21 months agoImplement DAP setVariable request
Tom Tromey [Thu, 5 Oct 2023 12:27:50 +0000 (06:27 -0600)] 
Implement DAP setVariable request

This patch implements the DAP setVariable request.

setVariable is a bit odd in that it specifies the variable to modify
by passing in the variable's container and the name of the variable.
This approach can't handle variable shadowing (there are a couple of
open DAP bugs on this topic), so this patch renames duplicates to
avoid the problem.

(cherry picked from commit 87e3cc466e8ea352639beb6db40a36e339d608d1)

21 months agoAutomatic date update in version.in
GDB Administrator [Tue, 31 Oct 2023 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Mon, 30 Oct 2023 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Sun, 29 Oct 2023 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Sat, 28 Oct 2023 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Fri, 27 Oct 2023 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agogdb/nat/aarch64-scalable-linux-ptrace.h: Don't include itself
Thiago Jung Bauermann [Thu, 26 Oct 2023 00:27:09 +0000 (21:27 -0300)] 
gdb/nat/aarch64-scalable-linux-ptrace.h: Don't include itself

GCC doesn't complain, but it's still wrong.

21 months agoAutomatic date update in version.in
GDB Administrator [Thu, 26 Oct 2023 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Wed, 25 Oct 2023 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Tue, 24 Oct 2023 00:01:16 +0000 (00:01 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Mon, 23 Oct 2023 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Sun, 22 Oct 2023 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Sat, 21 Oct 2023 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Fri, 20 Oct 2023 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Thu, 19 Oct 2023 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Wed, 18 Oct 2023 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Tue, 17 Oct 2023 00:01:02 +0000 (00:01 +0000)] 
Automatic date update in version.in

21 months agoHave DAP handle non-Value results from 'children'
Tom Tromey [Fri, 6 Oct 2023 13:42:00 +0000 (07:42 -0600)] 
Have DAP handle non-Value results from 'children'

A pretty-printer's 'children' method may return values other than a
gdb.Value -- it may return any value that can be converted to a
gdb.Value.

I noticed that this case did not work for DAP.  This patch fixes the
problem.

21 months agoHandle gdb.LazyString in DAP
Tom Tromey [Wed, 4 Oct 2023 17:22:05 +0000 (11:22 -0600)] 
Handle gdb.LazyString in DAP

Andry pointed out that the DAP code did not properly handle
gdb.LazyString results from a pretty-printer, yielding:

    TypeError: Object of type LazyString is not JSON serializable

This patch fixes the problem, partly with a small patch in varref.py,
but mainly by implementing tp_str for LazyString.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
21 months agoFix register-setting response from DAP
Tom Tromey [Wed, 4 Oct 2023 18:58:32 +0000 (12:58 -0600)] 
Fix register-setting response from DAP

Andry noticed that given a DAP setExpression request, where the
expression to set is a register, DAP will return the wrong value -- it
will return the old value, not the updated one.

This happens because gdb.Value.assign (which was recently added for
DAP) does not update the value.

In this patch, I chose to have the assign method update the Value
in-place.  It's also possible to have it return a new value, but this
didn't seem very useful to me.

21 months agoAdd DAP scope cache
Tom Tromey [Wed, 27 Sep 2023 17:48:24 +0000 (11:48 -0600)] 
Add DAP scope cache

Andry Ogorodnik, a co-worker, noticed that multiple "scopes" requests
with the same frame would yield different variableReference values in
the response.

This patch adds a regression test for this, and adds a scope cache in
scopes.py, ensuring that multiple identical requests will get the same
response.

Tested-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
21 months agoOnly allow closure lookup by address if there are threads displaced-stepping
Luis Machado [Thu, 28 Sep 2023 10:08:29 +0000 (11:08 +0100)] 
Only allow closure lookup by address if there are threads displaced-stepping

Since commit 1e5ccb9c5ff4fd8ade4a8694676f99f4abf2d679, we have an assertion in
displaced_step_buffers::copy_insn_closure_by_addr that makes sure a closure
is available whenever we have a match between the provided address argument and
the buffer address.

That is fine, but the report in PR30872 shows this assertion triggering when
it really shouldn't. After some investigation, here's what I found out.

The 32-bit Arm architecture is the only one that calls
gdbarch_displaced_step_copy_insn_closure_by_addr directly, and that's because
32-bit Arm needs to figure out the thumb state of the original instruction
that we displaced-stepped through the displaced-step buffer.

Before the assertion was put in place by commit
1e5ccb9c5ff4fd8ade4a8694676f99f4abf2d679, there was the possibility of
getting nullptr back, which meant we were not doing a displaced-stepping
operation.

Now, with the assertion in place, this is running into issues.

It looks like displaced_step_buffers::copy_insn_closure_by_addr is
being used to return a couple different answers depending on the
state we're in:

1 - If we are actively displaced-stepping, then copy_insn_closure_by_addr
is supposed to return a valid closure for us, so we can determine the
thumb mode.

2 - If we are not actively displaced-stepping, then copy_insn_closure_by_addr
should return nullptr to signal that there isn't any displaced-step buffers
in use, because we don't have a valid closure (but we should always have
this).

Since the displaced-step buffers are always allocated, but not always used,
that means the buffers will always contain data. In particular, the buffer
addr field cannot be used to determine if the buffer is active or not.

For instance, we cannot set the buffer addr field to 0x0, as that can be a
valid PC in some cases.

My understanding is that the current_thread field should be a good candidate
to signal that a particular displaced-step buffer is active or not. If it is
nullptr, we have no threads using that buffer to displaced-step.  Otherwise,
it is an active buffer in use by a particular thread.

The following fix modifies the displaced_step_buffers::copy_insn_closure_by_addr
function so we only attempt to return a closure if the buffer has an assigned
current_thread and if the buffer address matches the address argument.

Alternatively, I think we could use a function to answer the question of
whether we're actively displaced-stepping (so we have an active buffer) or
not.

I've also added a testcase that exercises the problem. It should reproduce
reliably on Arm, as that is the only architecture that faces this problem
at the moment.

Regression-tested on Ubuntu 20.04. OK?

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30872
Approved-By: Simon Marchi <simon.marchi@efficios.com>
21 months agoAutomatic date update in version.in
GDB Administrator [Mon, 16 Oct 2023 00:00:57 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Sun, 15 Oct 2023 00:01:01 +0000 (00:01 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Sat, 14 Oct 2023 00:02:06 +0000 (00:02 +0000)] 
Automatic date update in version.in

21 months agoUse SVE_VQ_BYTES instead of __SVE_VQ_BYTES
Luis Machado [Fri, 13 Oct 2023 15:03:50 +0000 (16:03 +0100)] 
Use SVE_VQ_BYTES instead of __SVE_VQ_BYTES

__SVE_VQ_BYTES is only available if SVE definitions are available in
the system's headers, and this is not true for all systems.

For this purpose, we define SVE_VQ_BYTES.  This patch fixes the
name of the constant being used.

21 months agoMove -lsocket check to common.m4
Tom Tromey [Sun, 1 Oct 2023 15:16:13 +0000 (09:16 -0600)] 
Move -lsocket check to common.m4

A user pointed out that the -lsocket check in gdb should also apply to
gdbserver -- otherwise it can't find the Solaris socketpair.  This
patch makes the change.  It also removes a couple of redundant
function checks from gdb's configure.ac.

This was tested by the person who reported the bug.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30927
Approved-By: Pedro Alves <pedro@palves.net>
21 months agoAutomatic date update in version.in
GDB Administrator [Fri, 13 Oct 2023 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Thu, 12 Oct 2023 00:01:37 +0000 (00:01 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Wed, 11 Oct 2023 00:01:31 +0000 (00:01 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Tue, 10 Oct 2023 00:01:40 +0000 (00:01 +0000)] 
Automatic date update in version.in

21 months agoAutomatic date update in version.in
GDB Administrator [Mon, 9 Oct 2023 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

22 months agoBump GDB's version number to 14.0.91.DATE-git.
Joel Brobecker [Sun, 8 Oct 2023 08:35:29 +0000 (10:35 +0200)] 
Bump GDB's version number to 14.0.91.DATE-git.

This commit changes gdb/version.in to 14.0.91.DATE-git.

22 months agoSet GDB version number to 14.0.91.
Joel Brobecker [Sun, 8 Oct 2023 08:17:13 +0000 (10:17 +0200)] 
Set GDB version number to 14.0.91.

This commit changes gdb/version.in to 14.0.91.

22 months agogdb/NEWS: Change "since GDB 13" to "in GDB 14"
Joel Brobecker [Sun, 8 Oct 2023 08:13:18 +0000 (10:13 +0200)] 
gdb/NEWS: Change "since GDB 13" to "in GDB 14"

This commit updates the NEWS files for the upcoming GDB 14 release.

22 months agoSet development mode to "off" by default.
Joel Brobecker [Sun, 8 Oct 2023 07:52:40 +0000 (09:52 +0200)] 
Set development mode to "off" by default.

This is done by setting the "development" variable to "false"
in bfd/development.sh.

22 months agoBump version to 14.0.90.DATE-git.
Joel Brobecker [Sun, 8 Oct 2023 07:52:20 +0000 (09:52 +0200)] 
Bump version to 14.0.90.DATE-git.

Now that the GDB 14 branch has been created,
this commit bumps the version number in gdb/version.in to
14.0.90.DATE-git

For the record, the GDB 14 branch was created
from commit 8f12a1a841cd0c447de7a5a0f134a0efece73588.

22 months agoAdd testsuits for new assembler option of mthin-add-sub. gdb-14-branchpoint
cailulu [Thu, 28 Sep 2023 08:01:53 +0000 (16:01 +0800)] 
Add testsuits for new assembler option of mthin-add-sub.

22 months agoas: add option for generate R_LARCH_32/64_PCREL.
cailulu [Thu, 28 Sep 2023 08:01:52 +0000 (16:01 +0800)] 
as: add option for generate R_LARCH_32/64_PCREL.

Some older kernels cannot handle the newly generated R_LARCH_32/64_PCREL,
so the assembler generates R_LARCH_ADD32/64+R_LARCH_SUB32/64 by default,
and use the assembler option mthin-add-sub to generate R_LARCH_32/64_PCREL
as much as possible.

The Option of mthin-add-sub does not affect the generation of R_LARCH_32_PCREL
relocation in .eh_frame.

22 months agoAutomatic date update in version.in
GDB Administrator [Sun, 8 Oct 2023 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

22 months agoRevert "opcodes: microblaze: Add new bit-field instructions"
Michael J. Eager [Sat, 7 Oct 2023 22:29:54 +0000 (15:29 -0700)] 
Revert "opcodes: microblaze: Add new bit-field instructions"

This reverts commit 6bbf249557ba17cfebe01c67370df4da9e6a56f9.

Maciej W. Rozycki <macro@orcam.me.uk>:
 Yet it has caused numerous regressions:

microblaze-elf  +FAIL: unordered .debug_info references to .debug_ranges
microblaze-elf  +FAIL: binutils-all/pr26548
microblaze-elf  +FAIL: readelf -Wwi pr26548e (reason: unexpected output)
microblaze-elf  +FAIL: readelf --debug-dump=loc locview-1 (reason: unexpected output) Yet it has caused numerous regressions:
microblaze-elf  +FAIL: unordered .debug_info references to .debug_ranges
microblaze-elf  +FAIL: binutils-all/pr26548
microblaze-elf  +FAIL: readelf -Wwi pr26548e (reason: unexpected output)
...

22 months ago[gdb/testsuite] Fix gdb.arch/i386-signal.exp on x86_64
Tom de Vries [Sat, 7 Oct 2023 08:33:29 +0000 (10:33 +0200)] 
[gdb/testsuite] Fix gdb.arch/i386-signal.exp on x86_64

On x86_64-linux, with test-case gdb.arch/i386-signal.exp I run into:
...
builtin_spawn -ignore SIGHUP gcc -fno-stack-protector i386-signal.c \
  -fdiagnostics-color=never -fno-pie -g -no-pie -lm -o i386-signal^M
/tmp/cc2xydTG.s: Assembler messages:^M
/tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'^M
compiler exited with status 1
output is:
/tmp/cc2xydTG.s: Assembler messages:^M
/tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'^M

gdb compile failed, /tmp/cc2xydTG.s: Assembler messages:
/tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'
UNTESTED: gdb.arch/i386-signal.exp: failed to compile
...

This is with gas 2.41, it compiles without problems with gas 2.40.  Some more
strict checking was added in commit 5cc007751cd ("x86: further adjust
extend-to-32bit-address conditions").  This may or may not be a gas regression
( https://sourceware.org/pipermail/binutils/2023-October/129818.html ).

The offending bit is:
...
    "    push $sigframe\n"
...
which refers to a function:
...
    "    .globl sigframe\n"
    "sigframe:\n"
...

The test-case passes with target board unix/-m32.

Make the test-case work by using pushq instead of push for the
is_amd64_regs_target case.

Tested on x86_64-linux, with target boards:
- unix/-m64 (is_amd64_regs_target == 1), and
- unix/-m32 (is_amd64_regs_target == 0),

PR testsuite/30928
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30928

22 months agogdb: support rseq auxvs
Ilya Leoshkevich [Wed, 21 Jun 2023 23:03:04 +0000 (01:03 +0200)] 
gdb: support rseq auxvs

Linux kernel commit commit 317c8194e6ae ("rseq: Introduce feature size
and alignment ELF auxiliary vector entries") introduced two new auxvs:
AT_RSEQ_FEATURE_SIZE and AT_RSEQ_ALIGN.  Support them in GDB.  This
fixes auxv.exp on kernels >= v6.3.

Change-Id: I8966c4d5c73eb7b45de6d410a9b28a6628edad2e
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30540
Approved-By: Tom Tromey <tom@tromey.com>
22 months agogprofng: 30910 cross test fail: can't read "CHECK_TARGET": no such variable
Vladimir Mezentsev [Thu, 5 Oct 2023 20:48:32 +0000 (13:48 -0700)] 
gprofng: 30910 cross test fail: can't read "CHECK_TARGET": no such variable

When TCL_TRY is FALSE, the wrong check-DEJAGNU is generated.
Place "if TCL_TRY / endif" in the right place.

gprofng/ChangeLog
2023-10-05  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR gprofng/30910
* Makefile.am: Correct "if TCL_TRY / endif".
* Makefile.in: Rebuild.

22 months agoAutomatic date update in version.in
GDB Administrator [Sat, 7 Oct 2023 00:00:25 +0000 (00:00 +0000)] 
Automatic date update in version.in

22 months agoprocess-dies-while-detaching.exp: Exit early if GDB misses sync breakpoint
Thiago Jung Bauermann [Thu, 28 Sep 2023 11:17:54 +0000 (08:17 -0300)] 
process-dies-while-detaching.exp: Exit early if GDB misses sync breakpoint

I'm seeing a lot of variability in the failures of
gdb.threads/process-dies-while-detaching.exp on aarch64-linux.  On this
platform, a problem yet to be investigated causes GDB to miss the _exit
breakpoint.  What happens next is random because after missing that
breakpoint, GDB is out of sync with the inferior.  This causes the tests
following that point in the testcase to fail in a random way.

In this scenario it's better to exit the testcase early to avoid random
results in the testsuite.

We are relying on gdb_continue_to_breakpoint to return the result of
gdb_test_multiple.  This is already the case because in Tcl the return
value of a function is the return value of the last command it runs.  But
change gdb_continue_to_breakpoint to explicitly return this value, to make
it clear this is the intended behaviour.

Tested on aarch64-linux.

Tested-By: Guinevere Larsen <blarsen@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
22 months agoopcodes: microblaze: Add new bit-field instructions
Neal Frager [Thu, 5 Oct 2023 12:51:03 +0000 (13:51 +0100)] 
opcodes: microblaze: Add new bit-field instructions

This patches adds new bsefi and bsifi instructions.
BSEFI- The instruction shall extract a bit field from a
register and place it right-adjusted in the destination register.
The other bits in the destination register shall be set to zero.
BSIFI- The instruction shall insert a right-adjusted bit field
from a register at another position in the destination register.
The rest of the bits in the destination register shall be unchanged.

Further documentation of these instructions can be found here:
https://docs.xilinx.com/v/u/en-US/ug984-vivado-microblaze-ref

This patch has been tested for years of AMD Xilinx Yocto
releases as part of the following patch set:

https://github.com/Xilinx/meta-xilinx/tree/master/meta-microblaze/recipes-devtools/binutils/binutils

Signed-off-by: nagaraju <nagaraju.mekala@amd.com>
Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Signed-off-by: Neal Frager <neal.frager@amd.com>
Signed-off-by: Michael J. Eager <eager@eagercon.com>
22 months agogdb/NEWS: reorder some entries in the NEWS file
Andrew Burgess [Fri, 29 Sep 2023 13:26:01 +0000 (14:26 +0100)] 
gdb/NEWS: reorder some entries in the NEWS file

I spotted two entries in the NEWS file that I believe are in the wrong
place, these are:

  - An entry about MI v1 being deprecated, this feels like it should
    be the first entry under the 'MI changes' heading, and

  - An entry for the $_shell convenience function which is currently
    under the 'New commands' heading (sort of), when I think this
    should be listed in the general news section.

22 months agogdbserver: fix gdbserver builds after expedite_regs changes
Andrew Burgess [Thu, 5 Oct 2023 11:14:32 +0000 (12:14 +0100)] 
gdbserver: fix gdbserver builds after expedite_regs changes

After this commit:

  commit 6a65998a8a94abaaae7ca4ff0ab9c3f25dc2e766
  Date:   Mon Sep 11 12:42:00 2023 +0100

      Convert tdesc's expedite_regs to a string vector

The risc-v, loongarch, and csky gdbserver builds were broken.  A use
of target_desc::expedite_regs (for each architecture)  was not updated
to take account of the type change.

I've tested that this fixes the risc-v build.  I haven't tested the
other architectures, but they should be fine.

22 months agogdb/testsuite: cleanup in gdb.base/args.exp
Andrew Burgess [Wed, 27 Sep 2023 17:22:52 +0000 (18:22 +0100)] 
gdb/testsuite: cleanup in gdb.base/args.exp

The last few commits resolved the KFAILs in gdb.base/args.exp.  With
those out of the way we can clean up this test script a little.

In this commit I have:

  - Stopped passing 'nowarnings' flag when building the source file.
    I see no reason why this source should issue a warning,

  - Moved setup of GDBFLAGS into args_test proc, callers that passed a
    newline needed a small tweak, and also the matching code needs
    updating for newline handling, but I think this is nicer, the
    argument lists are now given just once,

  - Updated comment on args_test,

  - Updated other comments.

There should be no change in what is tested after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
22 months agogdbserver: cleanup in handle_v_run
Andrew Burgess [Wed, 27 Sep 2023 17:04:34 +0000 (18:04 +0100)] 
gdbserver: cleanup in handle_v_run

After the previous commit there is now a redundant string copy in
handle_v_run, this commit cleans that up.

There should be no functional change after this commit.

During review I was pointed to this older series:

  https://inbox.sourceware.org/gdb-patches/20211022071933.3478427-1-m.weghorn@posteo.de/

which also includes this fix as part of a larger set of changes.  I'm
giving a Co-Authored-By credit to the author of that original series.
I believe this smaller fix brings some benefits on its own, though the
original series does offer additional improvements.  Once this is
merged I'll take a look at rebasing and resubmitting the original series.

Co-Authored-By: Michael Weghorn <m.weghorn@posteo.de>
Approved-By: Tom Tromey <tom@tromey.com>
22 months agogdbserver: handle newlines in inferior arguments
Andrew Burgess [Wed, 27 Sep 2023 16:54:15 +0000 (17:54 +0100)] 
gdbserver: handle newlines in inferior arguments

Similarly to how single quotes were mishandled, which was fixed two
commits ago, this commit fixes handling of newlines in arguments
passed to gdbserver.

We already had a test that covered this, gdb.base/args.exp, which,
when run with the native-extended-gdbserver board contained several
KFAIL covering this situation.

In this commit I remove the unnecessary, attempt to quote incoming
newlines within arguments, and do some minimal cleanup of the related
code.  There is additional cleanup that can be done, but I'm leaving
that for the next commit.

Then I've removed the KFAIL from the test case, and performed some
minimal cleanup there too.

After this commit the gdb.base/args.exp is 100% passing with the
native-extended-gdbserver board file.

During review I was pointed to this older series:

  https://inbox.sourceware.org/gdb-patches/20211022071933.3478427-1-m.weghorn@posteo.de/

which also includes this fix as part of a larger set of changes.  I'm
giving a Co-Authored-By credit to the author of that original series.
I believe this smaller fix brings some benefits on its own, though the
original series does offer additional improvements.  Once this is
merged I'll take a look at rebasing and resubmitting the original series.

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

Co-Authored-By: Michael Weghorn <m.weghorn@posteo.de>
Approved-By: Tom Tromey <tom@tromey.com>
22 months agogdbserver: fix handling of trailing empty argument
Andrew Burgess [Wed, 27 Sep 2023 16:18:01 +0000 (17:18 +0100)] 
gdbserver: fix handling of trailing empty argument

When I posted the previous patch for review Andreas Schwab pointed out
that passing a trailing empty argument also doesn't work.

The fix for this is in the same area of code as the previous patch,
but is sufficiently different that I felt it deserved a patch of its
own.

I noticed that passing arguments containing single quotes to gdbserver
didn't work correctly:

  gdb -ex 'set sysroot' --args /tmp/show-args
  Reading symbols from /tmp/show-args...
  (gdb) target extended-remote | gdbserver --once --multi - /tmp/show-args
  Remote debugging using | gdbserver --once --multi - /tmp/show-args
  stdin/stdout redirected
  Process /tmp/show-args created; pid = 176054
  Remote debugging using stdio
  Reading symbols from /lib64/ld-linux-x86-64.so.2...
  (No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
  0x00007ffff7fd3110 in _start () from /lib64/ld-linux-x86-64.so.2
  (gdb) set args abc ""
  (gdb) run
  The program being debugged has been started already.
  Start it from the beginning? (y or n) y
  Starting program: /tmp/show-args \'
  stdin/stdout redirected
  Process /tmp/show-args created; pid = 176088
  2 args are:
    /tmp/show-args
    abc
  Done.
  [Inferior 1 (process 176088) exited normally]
  (gdb) target native
  Done.  Use the "run" command to start a process.
  (gdb) run
  Starting program: /tmp/show-args \'
  2 args are:
    /tmp/show-args
    abc

  Done.
  [Inferior 1 (process 176095) exited normally]
  (gdb) q

The 'shows-args' program used here just prints the arguments passed to
the inferior.

Notice that when starting the inferior using the extended-remote
target there is only a single argument 'abc', while when using the
native target there is a second argument, the blank line, representing
the empty argument.

The problem here is that the vRun packet coming from GDB looks like
this (I've removing the trailing checksum):

  $vRun;PROGRAM_NAME;616263;

If we compare this to a packet with only a single argument and no
trailing empty argument:

  $vRun;PROGRAM_NAME;616263

Notice the lack of the trailing ';' character here.

The problem is that gdbserver processes this string in a loop.  At
each point we maintain a pointer to the character just after a ';',
and then we process everything up to either the next ';' character, or
to the end of the string.

We break out of this loop when the character we start with (in that
loop iteration) is the null-character.  This means in the trailing
empty argument case, we abort the loop before doing anything with the
empty argument.

In this commit I've updated the loop, we now break out using a 'break'
statement at the end of the loop if the (sub-)string we just processed
was empty, with this change we now notice the trailing empty
argument.

I've updated the test case to cover this issue.

Approved-By: Tom Tromey <tom@tromey.com>
22 months agogdbserver: fix handling of single quote arguments
Andrew Burgess [Tue, 26 Sep 2023 16:32:24 +0000 (17:32 +0100)] 
gdbserver: fix handling of single quote arguments

I noticed that passing arguments containing single quotes to gdbserver
didn't work correctly:

  gdb -ex 'set sysroot' --args /tmp/show-args
  Reading symbols from /tmp/show-args...
  (gdb) target extended-remote | gdbserver --once --multi - /tmp/show-args
  Remote debugging using | gdbserver --once --multi - /tmp/show-args
  stdin/stdout redirected
  Process /tmp/show-args created; pid = 176054
  Remote debugging using stdio
  Reading symbols from /lib64/ld-linux-x86-64.so.2...
  (No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
  0x00007ffff7fd3110 in _start () from /lib64/ld-linux-x86-64.so.2
  (gdb) set args \'
  (gdb) r
  The program being debugged has been started already.
  Start it from the beginning? (y or n) y
  Starting program: /tmp/show-args \'
  stdin/stdout redirected
  Process /tmp/show-args created; pid = 176088
  2 args are:
    /tmp/show-args
    \'
  Done.
  [Inferior 1 (process 176088) exited normally]
  (gdb) target native
  Done.  Use the "run" command to start a process.
  (gdb) run
  Starting program: /tmp/show-args \'
  2 args are:
    /tmp/show-args
    '
  Done.
  [Inferior 1 (process 176095) exited normally]
  (gdb) q

The 'shows-args' program used here just prints the arguments passed to
the inferior.

Notice that when starting the inferior using the extended-remote
target the second argument is "\'", while when running using native
target the argument is "'".  The second of these is correct, the \'
used with the "set args" command is just to show GDB that the single
quote is not opening an argument string.

It turns out that the extra backslash is injected on the gdbserver
side when gdbserver processes the arguments that GDB passes it, the
code that does this was added as part of this much larger commit:

  commit 2090129c36c7e582943b7d300968d19b46160d84
  Date:   Thu Dec 22 21:11:11 2016 -0500

      Share fork_inferior et al with gdbserver

In this commit I propose removing the specific code that adds what I
believe is a stray backslash.  I've extended an existing test to cover
this case, and I now see identical behaviour when using an
extended-remote target as with the native target.

This partially fixes PR gdb/27989, though there are still some issues
with newline handling which I'll address in a later commit.

During review I was pointed to this older series:

  https://inbox.sourceware.org/gdb-patches/20211022071933.3478427-1-m.weghorn@posteo.de/

which also includes this fix as part of a larger set of changes.  I'm
giving a Co-Authored-By credit to the author of that original series.
I believe this smaller fix brings some benefits on its own, though the
original series does offer additional improvements.  Once this is
merged I'll take a look at rebasing and resubmitting the original series.

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

Co-Authored-By: Michael Weghorn <m.weghorn@posteo.de>
Approved-By: Tom Tromey <tom@tromey.com>
22 months agoFix: alpha: ld segfaults in
Nick Clifton [Fri, 6 Oct 2023 09:52:02 +0000 (10:52 +0100)] 
Fix: alpha: ld segfaults in

  PR 30940
  * elf64-alpha.c (elf64_alpha_check_relocs): Correct error message.

22 months agogdb/configure.ac: Add option --with-additional-debug-dirs
Thiago Jung Bauermann [Fri, 2 Jun 2023 20:39:54 +0000 (22:39 +0200)] 
gdb/configure.ac: Add option --with-additional-debug-dirs

If you want to install GDB in a custom prefix, have it look for debug info
in that prefix but also in the distro's default location (typically,
/usr/lib/debug) and run the GDB testsuite before doing "make install", you
have a bit of a problem:

Configuring GDB with '--prefix=$PREFIX' sets the GDB 'debug-file-directory'
parameter to $PREFIX/lib/debug.  Unfortunately this precludes GDB from
looking for distro-installed debug info in /usr/lib/debug.  For regular GDB
use you could set debug-file-directory to $PREFIX:/usr/lib/debug in
$PREFIX/etc/gdbinit so that GDB will look in both places, but if you want
to run the testsuite then that doesn't help because in that case GDB runs
with the '-nx' option.

There's the configure option '--with-separate-debug-dir' to set the default
value for 'debug-file-directory', but it accepts only one directory and not
a list.  I considered modifying it to accept a list, but it's not obvious
how to do that because its value is also used by BFD, as well as processed
for "relocatability".

I thought it was simpler to add a new option to specify a list of
additional directories that will be appended to the debug-file-directory
setting.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
22 months agoAutomatic date update in version.in
GDB Administrator [Fri, 6 Oct 2023 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

22 months ago[gdb/go] Handle v3 go_0 mangled prefix
Tom de Vries [Thu, 5 Oct 2023 21:22:11 +0000 (23:22 +0200)] 
[gdb/go] Handle v3 go_0 mangled prefix

With gcc-10 we have:
...
(gdb) break package2.Foo^M
Breakpoint 2 at 0x402563: file package2.go, line 5.^M
(gdb) PASS: gdb.go/package.exp: setting breakpoint 1
...
but with gcc-11:
...
gdb) break package2.Foo^M
Function "package2.Foo" not defined.^M
Make breakpoint pending on future shared library load? (y or [n]) n^M
(gdb) FAIL: gdb.go/package.exp: gdb_breakpoint: set breakpoint at package2.Foo
...

In the gcc-10 case, though the exec contains dwarf, it's not used to set the
breakpoint (which is an independent problem, filed as PR go/30941), instead
the minimal symbol information is used.

The minimal symbol information changed between gcc-10 and gcc-11:
...
$ nm a.out.10 | grep Foo
000000000040370d T go.package2.Foo
0000000000404e50 R go.package2.Foo..f
$ nm a.out.11 | grep Foo
0000000000403857 T go_0package2.Foo
0000000000405030 R go_0package2.Foo..f
...

A new v3 mangling scheme was used.  The mangling schemes define a separator
character and mangling character:
- for v2, dot is used both as separator character and mangling character, and
- for v3, dot is used as separator character and underscore as mangling
  character.

For more details, see [1] and [2].

In v3, "_0" demangles to ".". [ See gcc commit a01dda3c23b ("compiler, libgo:
change mangling scheme"), function Special_char_code::Special_char_code. ]

Handle the new go_0 prefix in unpack_mangled_go_symbol, which fixes the
test-case.

Note that this doesn't fix this regression:
...
$ gccgo-10 package2.go -c -g0
$ gccgo-10 package1.go package2.o -g0
$ gdb -q -batch a.out -ex "break go.package2.Foo"
Breakpoint 1 at 0x40370d
$ gccgo-11 package2.go -c -g0
$ gccgo-11 package1.go package2.o -g0
$ gdb -q -batch a.out -ex "break go.package2.Foo"
Function "go.package2.Foo" not defined.
...

With gcc-10, we set a breakpoint on the mangled minimal symbol.  That
one has simply changed for gcc-11, so it's equivalent to using:
...
$ gdb -q -batch a.out -ex "break go_0package2.Foo"
Breakpoint 1 at 0x403857
...
which does work.

Tested on x86_64-linux:
- openSUSE Leap 15.4, using gccgo-7,
- openSUSE Tumbleweed, using gccgo-13.

PR go/27238
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27238

[1] https://go-review.googlesource.com/c/gofrontend/+/271726
[2] https://github.com/golang/go/issues/41862#issuecomment-707244103

22 months agogdb: use objfile->pspace in free_objfile observers
Simon Marchi [Wed, 4 Oct 2023 02:20:23 +0000 (22:20 -0400)] 
gdb: use objfile->pspace in free_objfile observers

Use objfile->pspace instead of current_program_space.

Change-Id: I127a1788e155b321563114452ed5b530f1d1f618
Approved-By: Tom Tromey <tom@tromey.com>
22 months agogdb: remove unnecessary nullptr check in free_objfile observers
Simon Marchi [Wed, 4 Oct 2023 02:20:22 +0000 (22:20 -0400)] 
gdb: remove unnecessary nullptr check in free_objfile observers

The free_objfile observable is never called with a nullptr objfile.

Change-Id: I1e990edeb45bc38009ccb129c623911097ab65fe
Approved-By: Tom Tromey <tom@tromey.com>
22 months agogdb: add all_objfiles_removed observer
Simon Marchi [Wed, 4 Oct 2023 02:20:21 +0000 (22:20 -0400)] 
gdb: add all_objfiles_removed observer

The new_objfile observer is currently used to indicate both when a new
objfile is added to program space (when passed non-nullptr) and when all
objfiles of a program space were just removed (when passed nullptr).
I think this is confusing (and Andrew apparently thinks so too [1]).
Add a new "all_objfiles_removed" observer to remove the second role from
"new_objfile".

Some existing users of new_objfile do nothing if the passed objfile is
nullptr.  For them, we can simply drop the nullptr check.  For others,
add a new all_objfiles_removed callback, and refactor things a bit to
keep the existing behavior as much as possible.

Some callbacks relied on current_program_space, and following
the refactoring now use either objfile->pspace or the pspace passed to
all_objfiles_removed.  I think this should be relatively safe, and in
general a step in the right direction.

On the notify side, I found only one call site to change from
new_objfile to all_objfiles_removed, in clear_symtab_users.  It is not
entirely clear to me that this is entirely correct.  clear_symtab_users
appears to be called in spots that don't remove all objfiles
(functions finish_new_objfile, remove_symbol_file_command, reread_symbols,
do_module_cleanups).  But I think that this patch at least makes the
current code clearer.

[1] https://gitlab.com/gnutools/binutils-gdb/-/commit/a0a031bce0527b1521788b5dad640e7883b3a252

Change-Id: Icb648f72862e056267f30f44dd439bd4ec766f13
Approved-By: Tom Tromey <tom@tromey.com>