Commit Graph

116316 Commits

Author SHA1 Message Date
GDB Administrator
2fc1ef8366 Automatic date update in version.in 2023-12-11 00:00:36 +00:00
GDB Administrator
3111c3622d Automatic date update in version.in 2023-12-10 00:00:57 +00:00
GDB Administrator
5f8402b9e2 Automatic date update in version.in 2023-12-09 00:00:44 +00:00
Hannes Domani
bc23ea51f8 Fix printing of global variable stubs if no inferior is running
Since 3c45e9f915 gdb crashes when trying
to print a global variable stub without a running inferior, because of
a missing nullptr-check (the block_scope function took care of that
check before it was converted to a method).

With this check it works again:
```
(gdb) print s
$1 = <incomplete type>
```

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31128
Approved-By: Tom Tromey <tom@tromey.com>
(cherry picked from commit 576745e26c)
2023-12-08 19:09:21 +01:00
GDB Administrator
6af9acfdcd Automatic date update in version.in 2023-12-08 00:00:35 +00:00
GDB Administrator
55276e8753 Automatic date update in version.in 2023-12-07 00:00:53 +00:00
Hannes Domani
43a608adb0 Fix DLL export forwarding
I noticed it when I was trying to set a breakpoint at ExitProcess:
```
(gdb) b ExitProcess
Breakpoint 1 at 0x14001fdd0
(gdb) r
Starting program: C:\qiewer\heob\heob64.exe
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x3dbf4120
Cannot insert breakpoint 1.
Cannot access memory at address 0x77644120
```

The problem doesn't exist in gdb 13.2, and the difference can easily be
seen when printing ExitProcess.
gdb 14.1:
```
(gdb) p ExitProcess
$1 = {<text variable, no debug info>} 0x77644120 <UserHandleGrantAccess+36128>
```
gdb 13.2:
```
(gdb) p ExitProcess
$1 = {<text variable, no debug info>} 0x77734120 <ntdll!RtlExitUserProcess>
```

The new behavior started with 9675da2535,
where VMA was then calculated relative to FORWARD_DLL_NAME, while it was
relative to DLL_NAME before.

Fixed by calculating VMA relative to DLL_NAME again.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31112
Approved-By: Tom Tromey <tom@tromey.com>

(cherry picked from commit 2574cd903d)
2023-12-06 21:13:03 +01:00
GDB Administrator
f04aac2ba4 Automatic date update in version.in 2023-12-06 00:00:39 +00:00
GDB Administrator
19a397c30f Automatic date update in version.in 2023-12-05 00:00:54 +00:00
GDB Administrator
30e5331dc1 Automatic date update in version.in 2023-12-04 00:00:28 +00:00
Joel Brobecker
5718a72aa8 Bump GDB's version number to 14.1.90.DATE-git.
This commit changes gdb/version.in to 14.1.90.DATE-git.

This commit also makes the following changes in gdb/testsuite:

	* gdb.base/default.exp: Change $_gdb_minor to 2.
2023-12-03 09:35:52 +04:00
Joel Brobecker
6bda1c19bc Set GDB version number to 14.1.
This commit changes gdb/version.in to 14.1.
gdb-14.1-release
2023-12-03 09:18:15 +04:00
GDB Administrator
dfd845d276 Automatic date update in version.in 2023-12-03 00:00:36 +00:00
GDB Administrator
64be8e424a Automatic date update in version.in 2023-12-02 00:00:29 +00:00
GDB Administrator
fc1974557a Automatic date update in version.in 2023-12-01 00:00:26 +00:00
GDB Administrator
3e1fd5afc4 Automatic date update in version.in 2023-11-30 00:00:48 +00:00
GDB Administrator
385e95de46 Automatic date update in version.in 2023-11-29 00:00:39 +00:00
GDB Administrator
403e9cfa01 Automatic date update in version.in 2023-11-28 00:00:43 +00:00
John Baldwin
823c11ef48 i386: Use a fallback XSAVE layout for remote targets
If a target provides a target description including registers from the
XSAVE extended region, but does not provide an XSAVE layout, use a
fallback XSAVE layout based on the included registers.  This fallback
layout matches GDB's behavior in earlier releases which assumes the
layout from Intel CPUs.

This fallback layout is currently only used for remote targets since
native targets which support XSAVE provide an explicit layout derived
from CPUID.

PR gdb/30912
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30912
Approved-By: Simon Marchi <simon.marchi@efficios.com>

(cherry picked from commit 66637e209c)
2023-11-27 13:54:50 -08:00
Tom Tromey
fb2d9542d0 Fix bug in DAP handling of 'pause' requests
While working on cancellation, I noticed that a DAP 'pause' request
would set the "do not emit the continue" flag.  This meant that a
subsequent request that should provoke a 'continue' event would
instead suppress the event.

I then tried writing a more obvious test case for this, involving an
inferior call -- and discovered that gdb.events.cont does not fire for
an inferior call.

This patch installs a new event listener for gdb.events.inferior_call
and arranges for this to emit continue and stop events when
appropriate.  It also fixes the original bug, by adding a check to
exec_and_expect_stop.

(cherry picked from commit c618a1c548)
2023-11-27 09:16:46 -07:00
GDB Administrator
5a37e5855c Automatic date update in version.in 2023-11-27 00:00:49 +00:00
GDB Administrator
e447ef22ff Automatic date update in version.in 2023-11-26 00:00:28 +00:00
GDB Administrator
1d688670c0 Automatic date update in version.in 2023-11-25 00:00:48 +00:00
GDB Administrator
f61c9af603 Automatic date update in version.in 2023-11-24 00:00:55 +00:00
GDB Administrator
ec05816a66 Automatic date update in version.in 2023-11-23 00:01:05 +00:00
GDB Administrator
6eb20c0cce Automatic date update in version.in 2023-11-22 00:00:47 +00:00
GDB Administrator
0bf1de7bb4 Automatic date update in version.in 2023-11-21 00:00:36 +00:00
GDB Administrator
643b97a37d Automatic date update in version.in 2023-11-20 00:00:23 +00:00
GDB Administrator
ab1d96b02b Automatic date update in version.in 2023-11-19 00:00:24 +00:00
GDB Administrator
e6cad0cfd3 Automatic date update in version.in 2023-11-18 00:00:34 +00:00
Tom Tromey
17f2cab5f8 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 4a1b9a4bad)
2023-11-17 08:43:04 -07:00
Tom Tromey
fa2cc08fdd 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 cfd00e8050)
2023-11-17 08:43:04 -07:00
Tom Tromey
c558c8d5f6 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 68caad9d0b)
2023-11-17 08:43:04 -07:00
Tom Tromey
de5b5fcb89 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 c98921b258)
2023-11-17 08:43:04 -07:00
Tom Tromey
45b2be6618 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 1920148904)
2023-11-17 07:16:39 -07:00
GDB Administrator
aad1b7a5f6 Automatic date update in version.in 2023-11-17 00:00:55 +00:00
GDB Administrator
6ab1f30817 Automatic date update in version.in 2023-11-16 00:00:50 +00:00
Tom Tromey
aa5cef35e0 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 e1ccbfffb5)
2023-11-15 09:23:53 -07:00
GDB Administrator
5458a19397 Automatic date update in version.in 2023-11-15 00:00:40 +00:00
Tom Tromey
1df83e9a59 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 5006ea556d)
2023-11-14 08:49:55 -07:00
Tom Tromey
add31fcb87 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 ebea770b19)
2023-11-14 08:49:55 -07:00
Tom Tromey
d31566acb7 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 e9dacb1d6c)
2023-11-14 08:49:55 -07:00
Tom Tromey
a3ca9693ff 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 4ead09a294)
2023-11-14 08:49:55 -07:00
Tom Tromey
f703d35ad8 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 19b83d5c9b)
2023-11-14 08:49:55 -07:00
Tom Tromey
43f2540a8e Add block::function_block
This adds the method block::function_block, to easily access a block's
enclosing function block.

(cherry picked from commit ba707cadae)
2023-11-14 08:49:55 -07:00
Tom Tromey
18a2a7470f 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 edf1b9640b)
2023-11-14 08:49:55 -07:00
GDB Administrator
8015944464 Automatic date update in version.in 2023-11-14 00:00:41 +00:00
GDB Administrator
e7e8d3e6c8 Automatic date update in version.in 2023-11-13 00:00:46 +00:00
GDB Administrator
68c2310748 Automatic date update in version.in 2023-11-12 00:00:26 +00:00
GDB Administrator
45e4611f07 Automatic date update in version.in 2023-11-11 00:00:44 +00:00