]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
2 years agoAutomatic date update in version.in
GDB Administrator [Tue, 16 Aug 2022 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Mon, 15 Aug 2022 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sun, 14 Aug 2022 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sat, 13 Aug 2022 00:00:19 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Fri, 12 Aug 2022 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Thu, 11 Aug 2022 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Wed, 10 Aug 2022 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Tue, 9 Aug 2022 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Mon, 8 Aug 2022 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sun, 7 Aug 2022 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sat, 6 Aug 2022 00:00:24 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Fri, 5 Aug 2022 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Thu, 4 Aug 2022 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Wed, 3 Aug 2022 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Tue, 2 Aug 2022 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 1 Aug 2022 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 31 Jul 2022 00:00:24 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 30 Jul 2022 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 29 Jul 2022 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 28 Jul 2022 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 27 Jul 2022 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 26 Jul 2022 00:00:21 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 25 Jul 2022 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 24 Jul 2022 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 23 Jul 2022 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 22 Jul 2022 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 21 Jul 2022 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 20 Jul 2022 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 19 Jul 2022 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 18 Jul 2022 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 17 Jul 2022 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 16 Jul 2022 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 15 Jul 2022 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 14 Jul 2022 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 13 Jul 2022 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 12 Jul 2022 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoFix core-file -> detach -> crash (corefiles/29275)
Pedro Alves [Wed, 22 Jun 2022 17:44:37 +0000 (18:44 +0100)] 
Fix core-file -> detach -> crash (corefiles/29275)

After loading a core file, you're supposed to be able to use "detach"
to unload the core file.  That unfortunately regressed starting with
GDB 11, with these commits:

 1192f124a308 - gdb: generalize commit_resume, avoid commit-resuming when threads have pending statuses
 408f66864a1a - detach in all-stop with threads running

resulting in a GDB crash:

 ...
 Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
 0x0000555555e842bf in maybe_set_commit_resumed_all_targets () at ../../src/gdb/infrun.c:2899
 2899          if (proc_target->commit_resumed_state)
 (top-gdb) bt
 #0  0x0000555555e842bf in maybe_set_commit_resumed_all_targets () at ../../src/gdb/infrun.c:2899
 #1  0x0000555555e848bf in scoped_disable_commit_resumed::reset (this=0x7fffffffd440) at ../../src/gdb/infrun.c:3023
 #2  0x0000555555e84a0c in scoped_disable_commit_resumed::reset_and_commit (this=0x7fffffffd440) at ../../src/gdb/infrun.c:3049
 #3  0x0000555555e739cd in detach_command (args=0x0, from_tty=1) at ../../src/gdb/infcmd.c:2791
 #4  0x0000555555c0ba46 in do_simple_func (args=0x0, from_tty=1, c=0x55555662a600) at ../../src/gdb/cli/cli-decode.c:95
 #5  0x0000555555c112b0 in cmd_func (cmd=0x55555662a600, args=0x0, from_tty=1) at ../../src/gdb/cli/cli-decode.c:2514
 #6  0x0000555556173b1f in execute_command (p=0x5555565c5916 "", from_tty=1) at ../../src/gdb/top.c:699

The code that crashes looks like:

 static void
 maybe_set_commit_resumed_all_targets ()
 {
   scoped_restore_current_thread restore_thread;

   for (inferior *inf : all_non_exited_inferiors ())
     {
       process_stratum_target *proc_target = inf->process_target ();

       if (proc_target->commit_resumed_state)
           ^^^^^^^^^^^

With 'proc_target' above being null.  all_non_exited_inferiors filters
out inferiors that have pid==0.  We get here at the end of
detach_command, after core_target::detach has already run, at which
point the inferior _should_ have pid==0 and no process target.  It is
clear it no longer has a process target, but, it still has a pid!=0
somehow.

The reason the inferior still has pid!=0, is that core_target::detach
just unpushes, and relies on core_target::close to actually do the
getting rid of the core and exiting the inferior.  The problem with
that is that detach_command grabs an extra strong reference to the
process stratum target, so the unpush_target inside
core_target::detach doesn't actually result in a call to
core_target::close.

Fix this my moving the cleaning up the core inferior to a shared
routine called by both core_target::close and core_target::detach.  We
still need to cleanup the inferior from within core_file::close
because there are paths to it that want to get rid of the core without
going through detach.  E.g., "core-file" -> "run".

This commit includes a new test added to gdb.base/corefile.exp to
cover the "core-file core" -> "detach" scenario.

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

Change-Id: Ic42bdd03182166b19f598428b0dbc2ce6f67c893

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 11 Jul 2022 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 10 Jul 2022 00:00:21 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 9 Jul 2022 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 8 Jul 2022 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 7 Jul 2022 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 6 Jul 2022 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 5 Jul 2022 00:00:57 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 4 Jul 2022 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 3 Jul 2022 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 2 Jul 2022 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 1 Jul 2022 00:01:16 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 30 Jun 2022 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 29 Jun 2022 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 28 Jun 2022 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 27 Jun 2022 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 26 Jun 2022 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 25 Jun 2022 00:00:25 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 24 Jun 2022 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 23 Jun 2022 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 22 Jun 2022 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 21 Jun 2022 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 20 Jun 2022 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 19 Jun 2022 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 18 Jun 2022 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 17 Jun 2022 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 16 Jun 2022 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 15 Jun 2022 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 14 Jun 2022 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 13 Jun 2022 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 12 Jun 2022 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 11 Jun 2022 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 10 Jun 2022 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 9 Jun 2022 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 8 Jun 2022 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 7 Jun 2022 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 6 Jun 2022 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 5 Jun 2022 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 4 Jun 2022 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 3 Jun 2022 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 2 Jun 2022 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 1 Jun 2022 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 31 May 2022 00:00:24 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 30 May 2022 00:00:19 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 29 May 2022 00:00:20 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 28 May 2022 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 27 May 2022 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 26 May 2022 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 25 May 2022 00:00:25 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 24 May 2022 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 23 May 2022 00:00:22 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 22 May 2022 00:00:25 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 21 May 2022 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoBump GDB's version number to 12.1.90.DATE-git.
Joel Brobecker [Sun, 1 May 2022 19:00:22 +0000 (12:00 -0700)] 
Bump GDB's version number to 12.1.90.DATE-git.

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

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

* gdb.base/default.exp: Change $_gdb_minor to 2.

3 years agoSet GDB version number to 12.1. gdb-12.1-release
Joel Brobecker [Sun, 1 May 2022 18:46:32 +0000 (11:46 -0700)] 
Set GDB version number to 12.1.

This commit changes gdb/version.in to 12.1.

3 years agoImport gnulib changes
Tom Tromey [Mon, 18 Apr 2022 18:56:41 +0000 (12:56 -0600)] 
Import gnulib changes

This imports the gnulib patches that were mentioned by Eli.  I created
the patches from gnulib git, ran them through filterdiff, and then
applied them using update-gnulib.sh's patch-applying facility.

I think the patches are either obviously Windows-specific or harmless,
but I encourage you to look for yourself.

I tested by rebuilding on x86-64 Fedora 34, and also using the Fedora
mingw cross toolchain.

3 years agogdb: move setbuf calls out of gdb_readline_no_editing_callback
Andrew Burgess [Sun, 24 Apr 2022 15:39:19 +0000 (08:39 -0700)] 
gdb: move setbuf calls out of gdb_readline_no_editing_callback

After this commit:

  commit d08cbc5d3203118da5583296e49273cf82378042
  Date:   Wed Dec 22 12:57:44 2021 +0000

      gdb: unbuffer all input streams when not using readline

Issues were reported with some MS-Windows hosts, see the thread
starting here:

  https://sourceware.org/pipermail/gdb-patches/2022-March/187004.html

Filed in bugzilla as: PR mi/29002

The problem seems to be that calling setbuf on terminal file handles
is not always acceptable, see this mail for more details:

  https://sourceware.org/pipermail/gdb-patches/2022-April/187310.html

This commit does two things, first moving the setbuf calls out of
gdb_readline_no_editing_callback so that we don't end up calling
setbuf so often.

Then, for MS-Windows hosts, we don't call setbuf for terminals, this
appears to resolve the issues that have been reported.

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

3 years agogdb: fix 'remote show FOO-packet' aliases
Andrew Burgess [Thu, 21 Apr 2022 10:16:18 +0000 (11:16 +0100)] 
gdb: fix 'remote show FOO-packet' aliases

The following behaviour was observed in GDB:

  (gdb) show remote X-packet
  Support for the `p' packet is auto-detected, currently unknown.

Note the message mentions the 'p' packet.  This is a regression since
this commit:

  commit 8579fd136a614985bd27f20539c7bb7c5a51287d
  Date:   Mon Nov 8 14:58:46 2021 +0000

      gdb/gdbsupport: make xstrprintf and xstrvprintf return a unique_ptr

Before this commit the behaviour was:

  (gdb) show remote X-packet
  Support for the `X' packet is auto-detected, currently unknown.

The problem was caused by a failed attempt to ensure that some
allocated strings were deleted when GDB exits.  The code in the above
commit attempted to make use of 'static' to solve this problem,
however, the solution was just wrong.

In this new commit I instead allocate a static vector into which all
the allocated strings are stored, this ensures the strings are
released when GDB exits (which makes output from tools like valgrind
cleaner), but each string within the vector can be unique, which fixes
the regression.

3 years ago[gdb/testsuite] Fix gdb.ada/float-bits.exp with -m32
Tom de Vries [Fri, 15 Apr 2022 16:01:07 +0000 (18:01 +0200)] 
[gdb/testsuite] Fix gdb.ada/float-bits.exp with -m32

With test-case gdb.ada/float-bits.exp and native we get:
...
(gdb) print 16llf#7FFFF7FF4054A56FA5B99019A5C8#^M
$9 = 5.0e+25^M
(gdb) PASS: gdb.ada/float-bits.exp: print 16llf#7FFFF7FF4054A56FA5B99019A5C8#
...
but with target board unix/-m32 we have instead:
...
(gdb) print 16llf#7FFFF7FF4054A56FA5B99019A5C8#^M
Cannot export value 2596145952482202326224873165792712 as 96-bits \
  unsigned integer (must be between 0 and 79228162514264337593543950335)^M
(gdb) FAIL: gdb.ada/float-bits.exp: print 16llf#7FFFF7FF4054A56FA5B99019A5C8#
...

Fix this by testing whether 16llf is supported by doing ptype long_long_float
which gets us either:
...
type = <16-byte float>^M
...
or:
...
type = <12-byte float>^M
...

Tested on x86_64-linux with native and unix/-m32.

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

3 years ago[gdb/testsuite] Fix gdb.go/methods.exp with check-readmore
Tom de Vries [Fri, 15 Apr 2022 14:54:21 +0000 (16:54 +0200)] 
[gdb/testsuite] Fix gdb.go/methods.exp with check-readmore

When running test-case gdb.go/methods.exp with make check we have:
...
(gdb) break main.T.Foo^M
Function "main.T.Foo" not defined.^M
Make breakpoint pending on future shared library load? (y or [n]) n^M
(gdb) XFAIL: gdb.go/methods.exp: gdb_breakpoint: set breakpoint at main.T.Foo
...
but with make check-readmore the XFAIL fails to trigger:
...
(gdb) break main.T.Foo^M
Function "main.T.Foo" not defined.^M
Make breakpoint pending on future shared library load? (y or [n]) n^M
(gdb) FAIL: gdb.go/methods.exp: gdb_breakpoint: set breakpoint at main.T.Foo
...

This happens because this gdb_test_multiple "maintenance print symbols"
regexp:
...
    -re "\r\n$gdb_prompt $" {
...
matches the entire command output.

Fix this by adding the missing ^ at the regexp start.

Tested on x86_64-linux.

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

3 years agogdb/testsuite: Fix race in gdb.dwarf2/calling-convention.exp
Lancelot SIX [Thu, 14 Apr 2022 17:21:04 +0000 (18:21 +0100)] 
gdb/testsuite: Fix race in gdb.dwarf2/calling-convention.exp

Pedro Alves warned me that there is a race in
gdb.dwarf2/calling-convention.exp making the test sometimes fail on his
setup.  This can be reliably reproduced using :

    make check-read1 TESTS="gdb.dwarf2/calling-convention.exp"

The relevant part of the gdb.log file is:

    return 35
    Function 'foo' does not follow the target calling convention.
    If you continue, setting the return value will probably lead to unpredictable behaviors.
    Make foo return now? (y or n) PASS: gdb.dwarf2/calling-convention.exp: return 35
    n
    Not confirmed
    (gdb) FAIL: gdb.dwarf2/calling-convention.exp: finish

The issue is that when doing the test for "return 35", the DejaGnu test
sends "n" (to tell GDB not to perform the return action) but never
consumes the "Not confirmed" acknowledgment sent by GDB.  Later, when
trying to do the next test, DejaGnu tries to match the leftover output
from the "return" test. As this output is not expected, the test fails.

Fix by using gdb_test to send the "n" answer and match the confirmation
and consume all output to the prompt.

Also do minor adjustments to the main regex:
  - Remove the leading ".*" which is not required.
  - Ensure that the "?" from the question is properly escaped.

Tested on x86_64-gnu-linux, using

- make check TESTS="gdb.dwarf2/calling-convention.exp"
- make check-read1 TESTS="gdb.dwarf2/calling-convention.exp"
- make check-readmore TESTS="gdb.dwarf2/calling-convention.exp"

Co-authored-by: Pedro Alves <pedro@palves.net>
Change-Id: I42858b13db2cbd623c5c1739de65ad423e0c0938

3 years agoSilence -Wmaybe-uninitialized warning from target_waitstatus
Tom Tromey [Thu, 7 Apr 2022 16:17:02 +0000 (10:17 -0600)] 
Silence -Wmaybe-uninitialized warning from target_waitstatus

Currently, one use of target_waitstatus yields a warning:

     target/waitstatus.h: In function 'void stop_all_threads()':
     target/waitstatus.h:175:13: warning: 'ws.target_waitstatus::m_value' may be used uninitialized in this function [-Wmaybe-uninitialized]
       175 |     m_value = other.m_value;
   |     ~~~~~~~~^~~~~~~~~~~~~~~

This patch silences the warning.  I tried the "volatile member"
approach that was used for gdb::optional, but that didn't work, so
this patch simply initializes the member.

3 years agoFix regression on Windows with WOW64
Tom Tromey [Thu, 31 Mar 2022 13:55:09 +0000 (07:55 -0600)] 
Fix regression on Windows with WOW64

Internally at AdaCore, we recently started testing a 64-bit gdb
debugging 32-bit processes.  This failed with gdb head, but not with
gdb 11.

The tests fail like this:

     Starting program: [...].exe
     warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.
     Do you need "set solib-search-path" or "set sysroot"?
     warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.
     Do you need "set solib-search-path" or "set sysroot"?
     warning: Could not load shared library symbols for NOT_AN_IMAGE.
     Do you need "set solib-search-path" or "set sysroot"?
     warning: Could not load shared library symbols for NOT_AN_IMAGE.
     Do you need "set solib-search-path" or "set sysroot"?

After some debugging and bisecting, to my surprise the bug was
introduced by commit 183be222 ("gdb, gdbserver: make target_waitstatus
safe").

The problem occurs in handle_exception.  Previously the code did:

    -  ourstatus->kind = TARGET_WAITKIND_STOPPED;
    [...]
 case EXCEPTION_BREAKPOINT:
    [...]
    -   ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
    [...]
   /* FALLTHROUGH */
 case STATUS_WX86_BREAKPOINT:
   DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT");
    -      ourstatus->value.sig = GDB_SIGNAL_TRAP;
    [...]
    -  last_sig = ourstatus->value.sig;

However, in the new code, the fallthrough case does:

    +      ourstatus->set_stopped (GDB_SIGNAL_TRAP);

... which changes the 'kind' in 'ourstatus' after falling through.

This patch rearranges the 'last_sig' setting to more closely match
what was done before (this is probably not strictly needed but also
seemed harmless), and removes the fall-through in the
'ignore_first_breakpoint' case when __x86_64__ is defined.

3 years ago[gdb/testsuite] Fix gdb.base/annota1.exp with pie
Tom de Vries [Thu, 14 Apr 2022 12:56:21 +0000 (14:56 +0200)] 
[gdb/testsuite] Fix gdb.base/annota1.exp with pie

Since commit 359efc2d894 ("[gdb/testsuite] Make gdb.base/annota1.exp more
robust") we see this fail with target board unix/-fPIE/-pie:
...
FAIL: gdb.base/annota1.exp: run until main breakpoint (timeout)
...

The problem is that the commit makes the number and order of matched
annotations fixed, while between target boards unix and unix/-fPIE/-pie there
is a difference:
...
 \032\032post-prompt
 Starting program: outputs/gdb.base/annota1/annota1

+\032\032breakpoints-invalid
+
 \032\032starting

 \032\032frames-invalid
...

Fix this by optionally matching the additional annotation.

Tested on x86_64-linux.