Compare commits

...

20 Commits

Author SHA1 Message Date
Joel Brobecker
50b1dcab86 Set GDB version number to 16.2.
This commit changes gdb/version.in to 16.2.
2025-02-01 14:14:31 +04:00
GDB Administrator
9f5c7b01ea Automatic date update in version.in 2025-02-01 00:00:31 +00:00
GDB Administrator
06f68b9c9a Automatic date update in version.in 2025-01-31 00:01:41 +00:00
GDB Administrator
a31b440834 Automatic date update in version.in 2025-01-30 00:02:03 +00:00
Simon Marchi
da48c9e23a gdb: include cli/cli-style.h in darwin-nat.c
PR 32610 says:

  File gdb/darwin-nat.c is missing an #include statement of
  "cli/cli-style.h". It is needed because there is a reference to class
  object command_style in the .c file.

I'm not able to build-test this change (I only have access to arm64
macos machines, which GDB doesn't support yet), but I don't think I'm
doing things worse by adding this.

Change-Id: I2a169664ff91b92caf27cb084334f2eb4df46aa5
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32610
2025-01-29 12:04:09 -05:00
Tom de Vries
0ac766802a [gdb/tui] Fix assert in tui_source_window_base::refresh_window
Say we use the executable of test-case gdb.tui/tui-missing-src.exp like this:
...
$ gdb.sh -q -tui outputs/gdb.tui/tui-missing-src/tui-missing-src \
    -ex "b f2"\
    -ex run
...
(from a directory not containing a file called main.c to make sure that the
missing source stays missing) and then issue finish:
...
(gdb) finish
Run till exit from #0  f2 (x=4)
    at f2.c:5
0x0000000000400570 in main ()
    at main.c:7
Value returned is $1 = 13
(gdb)
...
and use control-<minus> to decrease the font size (IOW increase the $LINES and
$COLUMNS) on the terminal, we get:
...
gdb/tui/tui-winsource.c:340: internal-error: refresh_window: \
  Assertion `pad_x + view_width <= pad_width || m_pad.get () == nullptr' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
...

The tui_source_window_base class has variable m_pad which keeps track of a
curses pad that is used to display the source code or disassembly efficiently.

The assert in tui_source_window_base::refresh_window triggers while preparing
to display part of the pad.

The problem is that the window is in a state in which the pad is not used,
because m_content.empty () == true.  Instead, it simply shows
"[ No Source Available ]".

Fix this by bailing out of tui_source_window_base::refresh_window before
accessing the m_pad variable, if m_content.empty () == true.

Tested on x86_64-linux.

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

PR tui/32592
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32592

(cherry picked from commit 1c525b0e03)
2025-01-29 09:02:21 +01:00
GDB Administrator
4144c2f88d Automatic date update in version.in 2025-01-29 00:02:05 +00:00
Andrew Burgess
12630d881e gdb/remote: add 'binary-upload' feature to guard 'x' packet use
This mailing list discussion:

  https://inbox.sourceware.org/gdb-patches/CAOp6jLYD0g-GUsx7jhO3g8H_4pHkB6dkh51cbyDT-5yMfQwu+A@mail.gmail.com

highlighted the following issue with GDB's 'x' packet implementation.

Unfortunately, LLDB also has an 'x' packet, but their implementation
is different to GDB's and so targets that have implemented LLDB's 'x'
packet are incompatible with GDB.

The above thread is specifically about the 'rr' tool, but there could
be other remote targets out there that have this problem.

The difference between LLDB and GDB is that GDB expects a 'b' prefix
on the reply data, while LLDB does not.  The 'b' is important as it
allows GDB to distinguish between an empty reply (which will be a 'b'
prefix with no trailing data) and an unsupported packet (which will be
a completely empty packet).  It is not clear to me how LLDB
distinguishes these two cases.

See for discussion of the 'x' packet:

  https://inbox.sourceware.org/gdb-patches/cover.1710343840.git.tankut.baris.aktemur@intel.com/#r

with the part specific to the 'b' marker in:

  https://inbox.sourceware.org/gdb-patches/87msq82ced.fsf@redhat.com/

I propose that we add a new feature 'binary-upload' which can be
reported by a stub in its qSupported reply.  By default this feature
is "off", meaning GDB will not use the 'x' packet unless a stub
advertises this feature.

I have updated gdbserver to send 'binary-upload+', and when I examine
the gdbserver log I can see this feature being sent back, and then GDB
will use the 'x' packet.

When connecting to an older gdbserver, the feature is not sent, and
GDB does not try to use the 'x' packet at all.

I also built the latest version of `rr` and tested using current HEAD
of master, where I see problems like this:

  (rr) x/10i main
     0x401106 <main>:   Cannot access memory at address 0x401106

Then tested using this patched version of GDB, and now I see:

  (rr) x/10i main
     0x401106 <main>:   push   %rbp
     0x401107 <main+1>: mov    %rsp,%rbp
     0x40110a <main+4>: mov    0x2f17(%rip),%rax        # 0x404028 <global_ptr>
     ... etc ...

and looking in the remote log I see GDB is now using the 'm' packet
instead of the 'x' packet.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32593
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Reviewed-By: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
2025-01-28 12:51:20 +00:00
GDB Administrator
7c5dbff66e Automatic date update in version.in 2025-01-28 00:01:46 +00:00
GDB Administrator
650a77a80d Automatic date update in version.in 2025-01-27 00:01:32 +00:00
GDB Administrator
16281822d2 Automatic date update in version.in 2025-01-26 00:00:32 +00:00
GDB Administrator
5bde526b7f Automatic date update in version.in 2025-01-25 00:01:51 +00:00
GDB Administrator
129bc9e4ac Automatic date update in version.in 2025-01-24 00:00:57 +00:00
GDB Administrator
a9c3f13e66 Automatic date update in version.in 2025-01-23 00:02:15 +00:00
Andrew Burgess
2461ea21c7 bfd/doc: use abs_srcdir when creating symlinks
After commit:

  commit bd32be01c9
  Date:   Fri Dec 3 00:23:20 2021 -0500

      bfd: merge doc subdir up a level

And the follow-up commit:

  commit 98b1464bdf
  Date:   Wed Oct 2 22:58:08 2024 +0300

      bfd: fix unnecessary bfd.info regen

There is still a problem building the bfd docs from a release tar
file.

As the release tar file contains the pre-generated .texi files we
expect the bfd/doc build stage to symlink to the pre-existing .texi
files in the source tree.

However, this is still not working as expected if $(srcdir) is
relative.  The problem is this line in REGEN_TEXI:

    test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi $$texi; \

This is executed from the build/bfd/ directory, so if $(srcdir) is
relative, then this will get you from the bfd/ directory in the build
tree to the corresponding bfd/ directory in the src tree.  However,
the symlink is created in the bfd/doc/ build directory.  The relative
path will then fail to take you to the bfd/ directory in the src
tree.

Fix this by using $(abs_srcdir) when creating the symlink.

Approved-By: Nick Clifton <nickc@redhat.com>
2025-01-22 10:58:22 +00:00
GDB Administrator
4434d7d4cc Automatic date update in version.in 2025-01-22 00:01:56 +00:00
GDB Administrator
17bfbe6394 Automatic date update in version.in 2025-01-21 00:01:32 +00:00
GDB Administrator
4912fb7412 Automatic date update in version.in 2025-01-20 00:00:39 +00:00
GDB Administrator
d4db9fab08 Automatic date update in version.in 2025-01-19 00:01:31 +00:00
Joel Brobecker
0631c99c21 Bump GDB's version number to 16.1.90.DATE-git.
This commit changes gdb/version.in to 16.1.90.DATE-git.

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

	* gdb.base/default.exp: Change $_gdb_minor to 2.
2025-01-18 13:58:42 +04:00
12 changed files with 32 additions and 6 deletions

View File

@@ -1318,7 +1318,7 @@ REGEN_TEXI = \
$(MKDOC) -f $(srcdir)/doc/doc.str < $< > $@.tmp; \
texi=$@; \
texi=$${texi%.stamp}.texi; \
test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi $$texi; \
test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(abs_srcdir)/$$texi $$texi; \
$(SHELL) $(srcdir)/../move-if-change $@.tmp $$texi; \
touch $@; \
)

View File

@@ -101,7 +101,7 @@ REGEN_TEXI = \
$(MKDOC) -f $(srcdir)/%D%/doc.str < $< > $@.tmp; \
texi=$@; \
texi=$${texi%.stamp}.texi; \
test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi $$texi; \
test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(abs_srcdir)/$$texi $$texi; \
$(SHELL) $(srcdir)/../move-if-change $@.tmp $$texi; \
touch $@; \
)

View File

@@ -16,7 +16,7 @@
In releases, the date is not included in either version strings or
sonames. */
#define BFD_VERSION_DATE 20250118
#define BFD_VERSION_DATE 20250201
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
#define REPORT_BUGS_TO @report_bugs_to@

View File

@@ -204,6 +204,12 @@ x addr,length
equivalent to 'm', except that the data in the response are in
binary format.
binary-upload in qSupported reply
If the stub sends back 'binary-upload+' in it's qSupported reply,
then GDB will, where possible, make use of the 'x' packet. If the
stub doesn't report this feature supported, then GDB will not use
the 'x' packet.
*** Changes in GDB 15
* The MPX commands "show/set mpx bound" have been deprecated, as Intel

View File

@@ -26,6 +26,7 @@
#include "symtab.h"
#include "objfiles.h"
#include "cli/cli-cmds.h"
#include "cli/cli-style.h"
#include "gdbcore.h"
#include "gdbthread.h"
#include "regcache.h"

View File

@@ -43467,6 +43467,10 @@ and @var{length} is a multiple of the word size, the stub is free to
use byte accesses, or not. For this reason, this packet may not be
suitable for accessing memory-mapped I/O devices.
@value{GDBN} will only use this packet if the stub reports the
@samp{binary-upload} feature is supported in its @samp{qSupported}
reply (@pxref{qSupported}).
Reply:
@table @samp
@item b @var{XX@dots{}}
@@ -45114,6 +45118,11 @@ These are the currently defined stub features and their properties:
@tab @samp{+}
@tab No
@item @samp{binary-upload}
@tab No
@tab @samp{-}
@tab No
@end multitable
These are the currently defined stub features, in more detail:
@@ -45360,6 +45369,9 @@ The remote stub supports replying with an error in a
send this feature back to @value{GDBN} in the @samp{qSupported} reply,
@value{GDBN} will always support @samp{E.@var{errtext}} format replies
if it sent the @samp{error-message} feature.
@item binary-upload
The remote stub supports the @samp{x} packet (@pxref{x packet}).
@end table
@item qSymbol::

View File

@@ -5847,6 +5847,7 @@ static const struct protocol_feature remote_protocol_features[] = {
PACKET_memory_tagging_feature },
{ "error-message", PACKET_ENABLE, remote_supported_packet,
PACKET_accept_error_message },
{ "binary-upload", PACKET_DISABLE, remote_supported_packet, PACKET_x },
};
static char *remote_support_xml;

View File

@@ -692,7 +692,7 @@ set show_conv_list \
{$_gdb_setting_str = <internal function _gdb_setting_str>} \
{$_gdb_setting = <internal function _gdb_setting>} \
{$_gdb_major = 16} \
{$_gdb_minor = 1} \
{$_gdb_minor = 2} \
{$_shell_exitsignal = void} \
{$_shell_exitcode = 0} \
}

View File

@@ -101,3 +101,6 @@ Term::command "finish"
Term::check_box_contents "check source box is empty after return" \
0 0 80 15 "No Source Available"
Term::check_contents "Back in main" "Value returned is .* 13"
Term::resize 30 100
Term::check_box "source box after resize" 0 0 100 19

View File

@@ -314,6 +314,9 @@ tui_source_window_base::refresh_window ()
the screen, potentially creating a flicker. */
wnoutrefresh (handle.get ());
if (m_content.empty ())
return;
int pad_width = getmaxx (m_pad.get ());
int left_margin = this->left_margin ();
int view_width = this->view_width ();

View File

@@ -1 +1 @@
16.1
16.2

View File

@@ -2777,7 +2777,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
"PacketSize=%x;QPassSignals+;QProgramSignals+;"
"QStartupWithShell+;QEnvironmentHexEncoded+;"
"QEnvironmentReset+;QEnvironmentUnset+;"
"QSetWorkingDir+",
"QSetWorkingDir+;binary-upload+",
PBUFSIZ - 1);
if (target_supports_catch_syscall ())