Rebase to gdb-14.2
Resolves: RHEL-33256 Resolves: RHEL-39325 Resolves: RHEL-39326 Resolves: RHEL-39324 Resolves: RHEL-24764 Resolves: RHEL-34213
This commit is contained in:
parent
0ef7ce6648
commit
ffb1d87bd9
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
/new-fedora-release
|
||||
/gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz
|
||||
/v2.0.5.tar.gz
|
||||
/gdb-14.1.tar.xz
|
||||
/gdb-14.2.tar.xz
|
||||
|
@ -1,104 +0,0 @@
|
||||
# Fedora GDB local patches policy
|
||||
|
||||
In order to make things easier for the Fedora GDB maintainer, we
|
||||
choose to auto-generate the local patches by making use of an upstream
|
||||
git repository. Below you can find a few instructions on how to work
|
||||
using this method.
|
||||
|
||||
You need to run the following commands from the directory that
|
||||
contains the "gdb.spec" file.
|
||||
|
||||
## Importing the GDB patches into a git repository
|
||||
|
||||
1) The local patches (`*.patch`) need to be imported into an upstream
|
||||
git repository. For example, let's assume you cloned the repository
|
||||
by doing:
|
||||
|
||||
`$ git clone git://sourceware.org/git/binutils-gdb.git`
|
||||
|
||||
> TIP: if you already have the repository cloned somewhere in your
|
||||
> system, you can pass a "--reference <dir>" to the "git clone"
|
||||
> command and it will use your local repository as much as possible
|
||||
> to make the clone, speeding up things.
|
||||
|
||||
2) After cloning the upstream repository, you can import your patches
|
||||
by using the script "generate-git-repo-from-patches.sh":
|
||||
|
||||
`$ sh generate-git-repo-from-patches.sh <REPOSITORY_DIR>`
|
||||
|
||||
The script will basically cd into the repository, checkout the
|
||||
revision specified in the file `_git_upstream_commit`, iterate through
|
||||
the file `_patch_order` and "git-am" every patch *in that order*.
|
||||
This operation should complete without errors; if you find a problem
|
||||
with `git-am`, it probably means that the revision specified in the
|
||||
file `_git_upstream_commit` is wrong.
|
||||
|
||||
## Rebasing the patches against a newer version/release
|
||||
|
||||
1) First, cd into the upstream repository. All you have to do is
|
||||
choose the revision against which you plan to rebase the patches, and
|
||||
`git rebase <REVISION>`. git will do the rest, and you will be able
|
||||
to perform conflict resolution by git's algorithm, which is smarter.
|
||||
|
||||
## Creating new patches
|
||||
|
||||
1) Create the new patch on top of the the others, as usual. Note that
|
||||
you can use `git rebase` whenever you want to reorder patch order, or
|
||||
even to delete a patch.
|
||||
|
||||
2) When writing the commit log, you must obey a few rules. The
|
||||
subject line *must* be the filename of the patch. This line will be
|
||||
used when exporting the patches from the git repository, and
|
||||
(obviously) it gives the filename that should be used for this
|
||||
specific patch.
|
||||
|
||||
3) You can also add comments that will go into the auto-generated
|
||||
`Patch:` file (see below). To do that, use the special marker `;;` at
|
||||
the beginning of the line. This way, a commit log that says:
|
||||
|
||||
~~~~~~~~~~~
|
||||
test-patch.patch
|
||||
|
||||
;; This is a test patch
|
||||
;; Second line
|
||||
~~~~~~~~~~~
|
||||
|
||||
Will generate the following entry in the auto-generated `Patch:` file:
|
||||
|
||||
~~~~~~~~~~~
|
||||
# This is a test patch
|
||||
# Second line
|
||||
PatchXYZ: test-patch.patch
|
||||
~~~~~~~~~~~
|
||||
|
||||
## Exporting the GDB patches from the git repository
|
||||
|
||||
1) When you're done working with the patches, go back to the directory
|
||||
that contains the `gdb.spec` file, and from there you run:
|
||||
|
||||
`$ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR>`
|
||||
|
||||
This will regenerate all of the `*.patch` files (excluding the ones that
|
||||
were also excluded from the git repository), and also regenerate a few
|
||||
control files. These control files are:
|
||||
|
||||
- `_gdb.spec.Patch.include`: This file contains the `Patch:` directives.
|
||||
|
||||
- `_gdb.spec.patch.include`: This file contains the `%patch` directives.
|
||||
|
||||
- `_patch_order`: This file contains the patches, in the exact order
|
||||
that they must be applied. It is used when importing the patches
|
||||
into the git repository.
|
||||
|
||||
- `_git_upstream_commit`: This file contains the last upstream commit
|
||||
against which the patches were rebased. It is used when importing
|
||||
the patches into the git repository.
|
||||
|
||||
NOTE: If you did a rebase against a newer upstream version, you need
|
||||
to specify the commit/tag/branch against which you rebased:
|
||||
|
||||
`$ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR> <COMMIT_OR_TAG_OR_BRANCH>`
|
||||
|
||||
For example, if you rebased against `gdb-8.1-release`:
|
||||
|
||||
`$ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR> gdb-8.1-release`
|
@ -189,16 +189,45 @@ Patch043: gdb-rhbz2250652-gdbpy_gil.patch
|
||||
|
||||
Patch044: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch
|
||||
|
||||
# Backport potential fix for RH BZ 2257562.
|
||||
Patch045: gdb-rhbz2257562-cp-namespace-null-ptr-check.patch
|
||||
|
||||
|
||||
Patch046: gdb-ftbs-swapped-calloc-args.patch
|
||||
|
||||
# Backport gdb: fix "list ." related crash
|
||||
Patch047: gdb-rhbz2259850-list-period-crash-fix.patch
|
||||
Patch045: gdb-ftbs-swapped-calloc-args.patch
|
||||
|
||||
# Backport upstream workaround for GCC 14 problem which cause assertion
|
||||
# failures in GDB.
|
||||
Patch048: gdb-rhbz2261580-intrusive_list-assertion-fix.patch
|
||||
Patch046: gdb-rhbz2261580-intrusive_list-assertion-fix.patch
|
||||
|
||||
# Backport "gdb: s390: Add arch14 record/replay support"
|
||||
# (Andreas Arnez, RHEL-36225)
|
||||
Patch047: gdb-rhel-36225-add-arch14-record.patch
|
||||
|
||||
# Backport "PowerPC: Add support for Power11 options"
|
||||
# (Peter Bergner, RHEL-36518)
|
||||
Patch048: gdb-rhel-36518-add-power11-support.patch
|
||||
|
||||
# Update x86 disassembler
|
||||
Patch049: gdb-rhel-36527-apx-disasm.patch
|
||||
|
||||
#Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait"
|
||||
#(Andrew Burgess, RHEL-13298)
|
||||
Patch050: gdb-rhel-13298-inferior-funcall-bp-condition-1-of-5.patch
|
||||
|
||||
#gdb: fix b/p conditions with infcalls in multi-threaded inferiors
|
||||
#(Andrew Burgess, RHEL-13298)
|
||||
Patch051: gdb-rhel-13298-inferior-funcall-bp-condition-2-of-5.patch
|
||||
|
||||
#gdb: add timeouts for inferior function calls
|
||||
#(Andrew Burgess, RHEL-13298)
|
||||
Patch052: gdb-rhel-13298-inferior-funcall-bp-condition-3-of-5.patch
|
||||
|
||||
#gdb: introduce unwind-on-timeout setting
|
||||
#(Andrew Burgess, RHEL-13298)
|
||||
Patch053: gdb-rhel-13298-inferior-funcall-bp-condition-4-of-5.patch
|
||||
|
||||
#gdb: rename unwindonsignal to unwind-on-signal
|
||||
#(Andrew Burgess, RHEL-13298)
|
||||
Patch054: gdb-rhel-13298-inferior-funcall-bp-condition-5-of-5.patch
|
||||
|
||||
#gdb/unwinders: better support for $pc not saved
|
||||
#(Andrew Burgess, RHEL-19390)
|
||||
Patch055: gdb-rhel-19390-pc-not-saved.patch
|
||||
|
||||
|
@ -46,3 +46,10 @@
|
||||
%patch -p1 -P046
|
||||
%patch -p1 -P047
|
||||
%patch -p1 -P048
|
||||
%patch -p1 -P049
|
||||
%patch -p1 -P050
|
||||
%patch -p1 -P051
|
||||
%patch -p1 -P052
|
||||
%patch -p1 -P053
|
||||
%patch -p1 -P054
|
||||
%patch -p1 -P055
|
||||
|
@ -1 +1 @@
|
||||
6bda1c19bcd16eff8488facb8a67d52a436f70e7
|
||||
02c10eaecb63e5dbb99cbfdd1c5385e53ed031ff
|
||||
|
11
_patch_order
11
_patch_order
@ -42,7 +42,14 @@ gdb-rhbz-2232086-generate-gdb-index-consistently.patch
|
||||
gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch
|
||||
gdb-rhbz2250652-gdbpy_gil.patch
|
||||
gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch
|
||||
gdb-rhbz2257562-cp-namespace-null-ptr-check.patch
|
||||
gdb-ftbs-swapped-calloc-args.patch
|
||||
gdb-rhbz2259850-list-period-crash-fix.patch
|
||||
gdb-rhbz2261580-intrusive_list-assertion-fix.patch
|
||||
gdb-rhel-36225-add-arch14-record.patch
|
||||
gdb-rhel-36518-add-power11-support.patch
|
||||
gdb-rhel-36527-apx-disasm.patch
|
||||
gdb-rhel-13298-inferior-funcall-bp-condition-1-of-5.patch
|
||||
gdb-rhel-13298-inferior-funcall-bp-condition-2-of-5.patch
|
||||
gdb-rhel-13298-inferior-funcall-bp-condition-3-of-5.patch
|
||||
gdb-rhel-13298-inferior-funcall-bp-condition-4-of-5.patch
|
||||
gdb-rhel-13298-inferior-funcall-bp-condition-5-of-5.patch
|
||||
gdb-rhel-19390-pc-not-saved.patch
|
||||
|
@ -1,128 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Tue, 1 Feb 2022 11:32:48 -0700
|
||||
Subject: gdb-rhbz2042664-fix-sect_index_data-internal-error
|
||||
|
||||
;; Backport fix which fixes internal error due to libcc_s lacking a
|
||||
;; .data section.
|
||||
|
||||
Fix GDB internal error by using text (instead of data) section offset
|
||||
|
||||
Fedora Rawhide is now using gcc-12.0. As part of updating to the
|
||||
gcc-12.0 package set, Rawhide is also now using a version of libgcc_s
|
||||
which lacks a .data section. This causes gdb to fail in the following
|
||||
fashion while debugging a program (such as gdb) which uses libgcc_s:
|
||||
|
||||
(top-gdb) run
|
||||
Starting program: rawhide-master/bld/gdb/gdb
|
||||
...
|
||||
objfiles.h:467: internal-error: sect_index_data not initialized
|
||||
A problem internal to GDB has been detected,
|
||||
further debugging may prove unreliable.
|
||||
...
|
||||
|
||||
I snipped the backtrace from the above output. Instead, here's a
|
||||
portion of a backtrace obtained using GDB's backtrace command.
|
||||
(Obviously, in order to obtain it, I used a GDB which has been patched
|
||||
with this commit.)
|
||||
|
||||
#0 internal_error (
|
||||
file=0xc6a508 "gdb/objfiles.h", line=467,
|
||||
fmt=0xc6a4e8 "sect_index_data not initialized")
|
||||
at gdbsupport/errors.cc:51
|
||||
#1 0x00000000005f9651 in objfile::data_section_offset (this=0x4fa48f0)
|
||||
at gdb/objfiles.h:467
|
||||
#2 0x000000000097c5f8 in relocate_address (address=0x17244, objfile=0x4fa48f0)
|
||||
at gdb/stap-probe.c:1333
|
||||
#3 0x000000000097c630 in stap_probe::get_relocated_address (this=0xa1a17a0,
|
||||
objfile=0x4fa48f0)
|
||||
at gdb/stap-probe.c:1341
|
||||
#4 0x00000000004d7025 in create_exception_master_breakpoint_probe (
|
||||
objfile=0x4fa48f0)
|
||||
at gdb/breakpoint.c:3505
|
||||
#5 0x00000000004d7426 in create_exception_master_breakpoint ()
|
||||
at gdb/breakpoint.c:3575
|
||||
#6 0x00000000004efcc1 in breakpoint_re_set ()
|
||||
at gdb/breakpoint.c:13407
|
||||
#7 0x0000000000956998 in solib_add (pattern=0x0, from_tty=0, readsyms=1)
|
||||
at gdb/solib.c:1001
|
||||
#8 0x00000000009576a8 in handle_solib_event ()
|
||||
at gdb/solib.c:1269
|
||||
...
|
||||
|
||||
The function 'relocate_address' in gdb/stap-probe.c attempts to do
|
||||
its "relocation" by using objfile->data_section_offset(). That
|
||||
method, data_section_offset() is defined as follows in objfiles.h:
|
||||
|
||||
CORE_ADDR data_section_offset () const
|
||||
{
|
||||
return section_offsets[SECT_OFF_DATA (this)];
|
||||
}
|
||||
|
||||
The internal error occurs when the SECT_OFF_DATA macro finds that the
|
||||
'sect_index_data' field is -1:
|
||||
|
||||
#define SECT_OFF_DATA(objfile) \
|
||||
((objfile->sect_index_data == -1) \
|
||||
? (internal_error (__FILE__, __LINE__, \
|
||||
_("sect_index_data not initialized")), -1) \
|
||||
: objfile->sect_index_data)
|
||||
|
||||
relocate_address() is obtaining the section offset in order to compute
|
||||
a relocated address. For some ABIs, such as the System V ABI, the
|
||||
section offsets will all be the same. So for those ABIs, it doesn't
|
||||
matter which offset is used. However, other ABIs, such as the FDPIC
|
||||
ABI, will have different offsets for the various sections. Thus, for
|
||||
those ABIs, it is vital that this and other relocation code use the
|
||||
correct offset.
|
||||
|
||||
In stap_probe::get_relocated_address, the address to which to add the
|
||||
offset (thus forming the relocated address) is obtained via
|
||||
this->get_address (); get_address is a getter for m_address in
|
||||
probe.h. It's documented/defined as follows (also in probe.h):
|
||||
|
||||
/* The address where the probe is inserted, relative to
|
||||
SECT_OFF_TEXT. */
|
||||
CORE_ADDR m_address;
|
||||
|
||||
(Thanks to Tom Tromey for this observation.)
|
||||
|
||||
So, based on this, the current use of data_section_offset /
|
||||
SECT_OFF_DATA is wrong. This relocation code should have been using
|
||||
text_section_offset / SECT_OFF_TEXT all along. That being the
|
||||
case, I've adjusted the stap-probe.c relocation code accordingly.
|
||||
|
||||
Searching the sources turned up one other use of data_section_offset,
|
||||
in gdb/dtrace-probe.c, so I've updated that code as well. The same
|
||||
reasoning presented above applies to this case too.
|
||||
|
||||
Summary:
|
||||
|
||||
* gdb/dtrace-probe.c (dtrace_probe::get_relocated_address):
|
||||
Use method text_section_offset instead of data_section_offset.
|
||||
* gdb/stap-probe.c (relocate_address): Likewise.
|
||||
|
||||
diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
|
||||
--- a/gdb/dtrace-probe.c
|
||||
+++ b/gdb/dtrace-probe.c
|
||||
@@ -684,7 +684,7 @@ dtrace_probe::is_enabled () const
|
||||
CORE_ADDR
|
||||
dtrace_probe::get_relocated_address (struct objfile *objfile)
|
||||
{
|
||||
- return this->get_address () + objfile->data_section_offset ();
|
||||
+ return this->get_address () + objfile->text_section_offset ();
|
||||
}
|
||||
|
||||
/* Implementation of the get_argument_count method. */
|
||||
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
|
||||
--- a/gdb/stap-probe.c
|
||||
+++ b/gdb/stap-probe.c
|
||||
@@ -1330,7 +1330,7 @@ stap_probe::parse_arguments (struct gdbarch *gdbarch)
|
||||
static CORE_ADDR
|
||||
relocate_address (CORE_ADDR address, struct objfile *objfile)
|
||||
{
|
||||
- return address + objfile->data_section_offset ();
|
||||
+ return address + objfile->text_section_offset ();
|
||||
}
|
||||
|
||||
/* Implementation of the get_relocated_address method. */
|
@ -1,113 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Tue, 16 Jan 2024 20:07:53 -0700
|
||||
Subject: gdb-rhbz2257562-cp-namespace-null-ptr-check.patch
|
||||
|
||||
;; Backport potential fix for RH BZ 2257562.
|
||||
|
||||
Fix printing of global variable stubs if no inferior is running
|
||||
|
||||
Since 3c45e9f915ae4aeab7312d6fc55a947859057572 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 576745e26c0ec76a53ba45b20af464628a50b3e4)
|
||||
|
||||
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
|
||||
--- a/gdb/cp-namespace.c
|
||||
+++ b/gdb/cp-namespace.c
|
||||
@@ -1026,7 +1026,11 @@ cp_lookup_transparent_type (const char *name)
|
||||
|
||||
/* If that doesn't work and we're within a namespace, look there
|
||||
instead. */
|
||||
- scope = get_selected_block (0)->scope ();
|
||||
+ const block *block = get_selected_block (0);
|
||||
+ if (block == nullptr)
|
||||
+ return nullptr;
|
||||
+
|
||||
+ scope = block->scope ();
|
||||
|
||||
if (scope[0] == '\0')
|
||||
return NULL;
|
||||
diff --git a/gdb/testsuite/gdb.cp/print-global-stub.cc b/gdb/testsuite/gdb.cp/print-global-stub.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/print-global-stub.cc
|
||||
@@ -0,0 +1,31 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2023 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+struct S
|
||||
+{
|
||||
+ S (int);
|
||||
+ virtual ~S ();
|
||||
+
|
||||
+ int m_i;
|
||||
+};
|
||||
+
|
||||
+S s (5);
|
||||
+
|
||||
+int main ()
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.cp/print-global-stub.exp b/gdb/testsuite/gdb.cp/print-global-stub.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.cp/print-global-stub.exp
|
||||
@@ -0,0 +1,32 @@
|
||||
+# Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# This file is part of the GDB testsuite.
|
||||
+# It tests printing of a global stub without inferior.
|
||||
+
|
||||
+require allow_cplus_tests
|
||||
+
|
||||
+standard_testfile .cc
|
||||
+set objfile [standard_output_file ${testfile}.o]
|
||||
+
|
||||
+if { [gdb_compile $srcdir/$subdir/$srcfile $objfile object \
|
||||
+ {c++ debug}] != "" } {
|
||||
+ untested "failed to compile"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+clean_restart $objfile
|
||||
+
|
||||
+gdb_test "print s" " = <incomplete type>"
|
@ -1,101 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Guinevere Larsen <blarsen@redhat.com>
|
||||
Date: Mon, 22 Jan 2024 10:13:52 +0100
|
||||
Subject: gdb-rhbz2259850-list-period-crash-fix.patch
|
||||
|
||||
;; Backport gdb: fix "list ." related crash
|
||||
|
||||
When a user attempts to use the "list ." command with an inferior that
|
||||
doesn't have debug symbols, GDB would crash. This was reported as PR
|
||||
gdb/31256.
|
||||
|
||||
The crash would happen when attempting to get the current symtab_and_line
|
||||
for the stop location, because the symtab would return a null pointer
|
||||
and we'd attempt to dereference it to print the line.
|
||||
|
||||
This commit fixes that by checking for an empty symtab and erroring out
|
||||
of the function if it happens.
|
||||
|
||||
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31256
|
||||
Approved-By: Tom Tromey <tom@tromey.com>
|
||||
|
||||
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
|
||||
--- a/gdb/cli/cli-cmds.c
|
||||
+++ b/gdb/cli/cli-cmds.c
|
||||
@@ -1291,6 +1291,8 @@ list_command (const char *arg, int from_tty)
|
||||
set_default_source_symtab_and_line ();
|
||||
cursal = get_current_source_symtab_and_line ();
|
||||
}
|
||||
+ if (cursal.symtab == nullptr)
|
||||
+ error (_("No debug information available to print source lines."));
|
||||
list_around_line (arg, cursal);
|
||||
/* Set the repeat args so just pressing "enter" after using "list ."
|
||||
will print the following lines instead of the same lines again. */
|
||||
diff --git a/gdb/testsuite/gdb.base/list-nodebug.c b/gdb/testsuite/gdb.base/list-nodebug.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/list-nodebug.c
|
||||
@@ -0,0 +1,21 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2024 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+int main ()
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/list-nodebug.exp b/gdb/testsuite/gdb.base/list-nodebug.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/list-nodebug.exp
|
||||
@@ -0,0 +1,37 @@
|
||||
+# Copyright 2024 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# Test that using the command "list" in a file with no debug information
|
||||
+# will not crash GDB and will give reasonable output.
|
||||
+
|
||||
+standard_testfile .c
|
||||
+
|
||||
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
|
||||
+ {nodebug}]} {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if {![runto_main]} {
|
||||
+ untested "couldn't run to main"
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+# Check that GDB doesn't crash when we use list . on an inferior with
|
||||
+# no debug information
|
||||
+gdb_test "list ." "No debug.*" "first 'list .'"
|
||||
+# This should be called twice because the first list invocation since
|
||||
+# printing a frame may take a different codepath, which wouldn't
|
||||
+# trigger the crash.
|
||||
+gdb_test "list ." "No debug.*" "second 'list .'"
|
70
gdb-rhel-13298-inferior-funcall-bp-condition-1-of-5.patch
Normal file
70
gdb-rhel-13298-inferior-funcall-bp-condition-1-of-5.patch
Normal file
@ -0,0 +1,70 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Mon, 9 May 2022 17:51:54 +0100
|
||||
Subject: gdb-rhel-13298-inferior-funcall-bp-condition-1-of-5.patch
|
||||
|
||||
;;Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait"
|
||||
;;(Andrew Burgess, RHEL-13298)
|
||||
|
||||
This reverts commit ac0d67ed1dcf470bad6a3bc4800c2ddc9bedecca.
|
||||
|
||||
There was nothing wrong with the commit which I'm reverting here, but
|
||||
it removed some functionality that will be needed for a later commit;
|
||||
that is, the ability for GDB to ask for events from a specific ptid_t
|
||||
via the do_target_wait function.
|
||||
|
||||
In a follow up commit, this functionality will be used to implement
|
||||
inferior function calls in multi-threaded inferiors.
|
||||
|
||||
This is not a straight revert of the above commit. Reverting the
|
||||
above commit replaces a 'nullptr' with 'NULL', I've gone in and
|
||||
changed that, preserving the 'nullptr'.
|
||||
|
||||
Reviewed-By: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
||||
Tested-By: Luis Machado <luis.machado@arm.com>
|
||||
Tested-By: Keith Seitz <keiths@redhat.com>
|
||||
|
||||
diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
--- a/gdb/infrun.c
|
||||
+++ b/gdb/infrun.c
|
||||
@@ -3946,7 +3946,8 @@ do_target_wait_1 (inferior *inf, ptid_t ptid,
|
||||
more events. Polls for events from all inferiors/targets. */
|
||||
|
||||
static bool
|
||||
-do_target_wait (execution_control_state *ecs, target_wait_flags options)
|
||||
+do_target_wait (ptid_t wait_ptid, execution_control_state *ecs,
|
||||
+ target_wait_flags options)
|
||||
{
|
||||
int num_inferiors = 0;
|
||||
int random_selector;
|
||||
@@ -3956,9 +3957,10 @@ do_target_wait (execution_control_state *ecs, target_wait_flags options)
|
||||
polling the rest of the inferior list starting from that one in a
|
||||
circular fashion until the whole list is polled once. */
|
||||
|
||||
- auto inferior_matches = [] (inferior *inf)
|
||||
+ auto inferior_matches = [&wait_ptid] (inferior *inf)
|
||||
{
|
||||
- return inf->process_target () != nullptr;
|
||||
+ return (inf->process_target () != nullptr
|
||||
+ && ptid_t (inf->pid).matches (wait_ptid));
|
||||
};
|
||||
|
||||
/* First see how many matching inferiors we have. */
|
||||
@@ -3997,7 +3999,7 @@ do_target_wait (execution_control_state *ecs, target_wait_flags options)
|
||||
|
||||
auto do_wait = [&] (inferior *inf)
|
||||
{
|
||||
- ecs->ptid = do_target_wait_1 (inf, minus_one_ptid, &ecs->ws, options);
|
||||
+ ecs->ptid = do_target_wait_1 (inf, wait_ptid, &ecs->ws, options);
|
||||
ecs->target = inf->process_target ();
|
||||
return (ecs->ws.kind () != TARGET_WAITKIND_IGNORE);
|
||||
};
|
||||
@@ -4427,7 +4429,7 @@ fetch_inferior_event ()
|
||||
the event. */
|
||||
scoped_disable_commit_resumed disable_commit_resumed ("handling event");
|
||||
|
||||
- if (!do_target_wait (&ecs, TARGET_WNOHANG))
|
||||
+ if (!do_target_wait (minus_one_ptid, &ecs, TARGET_WNOHANG))
|
||||
{
|
||||
infrun_debug_printf ("do_target_wait returned no event");
|
||||
disable_commit_resumed.reset_and_commit ();
|
1274
gdb-rhel-13298-inferior-funcall-bp-condition-2-of-5.patch
Normal file
1274
gdb-rhel-13298-inferior-funcall-bp-condition-2-of-5.patch
Normal file
File diff suppressed because it is too large
Load Diff
1148
gdb-rhel-13298-inferior-funcall-bp-condition-3-of-5.patch
Normal file
1148
gdb-rhel-13298-inferior-funcall-bp-condition-3-of-5.patch
Normal file
File diff suppressed because it is too large
Load Diff
413
gdb-rhel-13298-inferior-funcall-bp-condition-4-of-5.patch
Normal file
413
gdb-rhel-13298-inferior-funcall-bp-condition-4-of-5.patch
Normal file
@ -0,0 +1,413 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Wed, 18 Jan 2023 10:17:57 +0000
|
||||
Subject: gdb-rhel-13298-inferior-funcall-bp-condition-4-of-5.patch
|
||||
|
||||
;;gdb: introduce unwind-on-timeout setting
|
||||
;;(Andrew Burgess, RHEL-13298)
|
||||
|
||||
Now that inferior function calls can timeout (see the recent
|
||||
introduction of direct-call-timeout and indirect-call-timeout), this
|
||||
commit adds a new setting unwind-on-timeout.
|
||||
|
||||
This new setting is just like the existing unwindonsignal and
|
||||
unwind-on-terminating-exception, but the new setting will cause GDB to
|
||||
unwind the stack if an inferior function call times out.
|
||||
|
||||
The existing inferior function call timeout tests have been updated to
|
||||
cover the new setting.
|
||||
|
||||
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
|
||||
Tested-By: Luis Machado <luis.machado@arm.com>
|
||||
Tested-By: Keith Seitz <keiths@redhat.com>
|
||||
|
||||
diff --git a/gdb/NEWS b/gdb/NEWS
|
||||
--- a/gdb/NEWS
|
||||
+++ b/gdb/NEWS
|
||||
@@ -72,6 +72,15 @@ show indirect-call-timeout
|
||||
ignored, GDB will wait indefinitely for an inferior function to
|
||||
complete, unless interrupted by the user using Ctrl-C.
|
||||
|
||||
+set unwind-on-timeout on|off
|
||||
+show unwind-on-timeout
|
||||
+ These commands control whether GDB should unwind the stack when a
|
||||
+ timeout occurs during an inferior function call. The default is
|
||||
+ off, in which case the inferior will remain in the frame where the
|
||||
+ timeout occurred. When on, GDB will unwind the stack removing the
|
||||
+ dummy frame that was added for the inferior call, and restoring the
|
||||
+ inferior state to how it was before the inferior call started.
|
||||
+
|
||||
* New features in the GDB remote stub, GDBserver
|
||||
|
||||
** The --remote-debug and --event-loop-debug command line options
|
||||
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
||||
--- a/gdb/doc/gdb.texinfo
|
||||
+++ b/gdb/doc/gdb.texinfo
|
||||
@@ -20932,6 +20932,22 @@ the default C@t{++} exception handler and the inferior terminated.
|
||||
Show the current setting of stack unwinding in the functions called by
|
||||
@value{GDBN}.
|
||||
|
||||
+@anchor{set unwind-on-timeout}
|
||||
+@item set unwind-on-timeout
|
||||
+@kindex set unwind-on-timeout
|
||||
+@cindex unwind stack in called functions when timing out
|
||||
+@cindex call dummy stack unwinding on timeout.
|
||||
+Set unwinding of the stack if a function called from @value{GDBN}
|
||||
+times out. If set to @code{off} (the default), @value{GDBN} stops in
|
||||
+the frame where the timeout occurred. If set to @code{on},
|
||||
+@value{GDBN} unwinds the stack it created for the call and restores
|
||||
+the context to what it was before the call.
|
||||
+
|
||||
+@item show unwind-on-timeout
|
||||
+@kindex show unwind-on-timeout
|
||||
+Show whether @value{GDBN} will unwind the stack if a function called
|
||||
+from @value{GDBN} times out.
|
||||
+
|
||||
@item set may-call-functions
|
||||
@kindex set may-call-functions
|
||||
@cindex disabling calling functions in the program
|
||||
@@ -20963,11 +20979,11 @@ call by typing the interrupt character (often @kbd{Ctrl-c}).
|
||||
|
||||
If a called function is interrupted for any reason, including hitting
|
||||
a breakpoint, or triggering a watchpoint, and the stack is not unwound
|
||||
-due to @code{set unwind-on-terminating-exception on} or @code{set
|
||||
-unwindonsignal on} (@pxref{stack unwind settings}),
|
||||
-then the dummy-frame, created by @value{GDBN} to facilitate the call
|
||||
-to the program function, will be visible in the backtrace, for example
|
||||
-frame @code{#3} in the following backtrace:
|
||||
+due to @code{set unwind-on-terminating-exception on}, @code{set
|
||||
+unwind-on-timeout on}, or @code{set unwindonsignal on} (@pxref{stack
|
||||
+unwind settings}), then the dummy-frame, created by @value{GDBN} to
|
||||
+facilitate the call to the program function, will be visible in the
|
||||
+backtrace, for example frame @code{#3} in the following backtrace:
|
||||
|
||||
@smallexample
|
||||
(@value{GDBP}) backtrace
|
||||
@@ -20992,6 +21008,11 @@ Execution}) @value{GDBN} can place a timeout on any functions called
|
||||
from @value{GDBN}. If the timeout expires and the function call is
|
||||
still ongoing, then @value{GDBN} will interrupt the program.
|
||||
|
||||
+If a function called from @value{GDBN} is interrupted by a timeout,
|
||||
+then by default the inferior is left in the frame where the timeout
|
||||
+occurred, this behaviour can be adjusted with @samp{set
|
||||
+unwind-on-timeout} (@pxref{set unwind-on-timeout}).
|
||||
+
|
||||
For targets that don't support asynchronous execution
|
||||
(@pxref{Background Execution}) then timeouts for functions called from
|
||||
@value{GDBN} are not supported, the timeout settings described below
|
||||
diff --git a/gdb/infcall.c b/gdb/infcall.c
|
||||
--- a/gdb/infcall.c
|
||||
+++ b/gdb/infcall.c
|
||||
@@ -218,6 +218,27 @@ show_unwind_on_terminating_exception_p (struct ui_file *file, int from_tty,
|
||||
value);
|
||||
}
|
||||
|
||||
+/* This boolean tells GDB what to do if an inferior function, called from
|
||||
+ GDB, times out. If true, GDB unwinds the stack and restores the context
|
||||
+ to what it was before the call. When false, GDB leaves the thread as it
|
||||
+ is at the point of the timeout.
|
||||
+
|
||||
+ The default is to stop in the frame where the timeout occurred. */
|
||||
+
|
||||
+static bool unwind_on_timeout_p = false;
|
||||
+
|
||||
+/* Implement 'show unwind-on-timeout'. */
|
||||
+
|
||||
+static void
|
||||
+show_unwind_on_timeout_p (struct ui_file *file, int from_tty,
|
||||
+ struct cmd_list_element *c, const char *value)
|
||||
+{
|
||||
+ gdb_printf (file,
|
||||
+ _("Unwinding of stack if a timeout occurs "
|
||||
+ "while in a call dummy is %s.\n"),
|
||||
+ value);
|
||||
+}
|
||||
+
|
||||
/* Perform the standard coercions that are specified
|
||||
for arguments to be passed to C, Ada or Fortran functions.
|
||||
|
||||
@@ -574,6 +595,16 @@ struct call_thread_fsm : public thread_fsm
|
||||
bool should_stop (struct thread_info *thread) override;
|
||||
|
||||
bool should_notify_stop () override;
|
||||
+
|
||||
+ /* Record that this thread timed out while performing an infcall. */
|
||||
+ void timed_out ()
|
||||
+ {
|
||||
+ m_timed_out = true;
|
||||
+ }
|
||||
+
|
||||
+private:
|
||||
+ /* Set true if the thread timed out while performing an infcall. */
|
||||
+ bool m_timed_out = false;
|
||||
};
|
||||
|
||||
/* Allocate a new call_thread_fsm object. */
|
||||
@@ -649,7 +680,8 @@ call_thread_fsm::should_notify_stop ()
|
||||
|
||||
infcall_debug_printf ("inferior call didn't complete fully");
|
||||
|
||||
- if (stopped_by_random_signal && unwind_on_signal_p)
|
||||
+ if ((stopped_by_random_signal && unwind_on_signal_p)
|
||||
+ || (m_timed_out && unwind_on_timeout_p))
|
||||
{
|
||||
infcall_debug_printf ("unwind-on-signal is on, don't notify");
|
||||
return false;
|
||||
@@ -742,6 +774,9 @@ struct infcall_timer_controller
|
||||
|
||||
infcall_debug_printf ("Stopping thread %s",
|
||||
m_thread->ptid.to_string ().c_str ());
|
||||
+ call_thread_fsm *fsm
|
||||
+ = gdb::checked_static_cast<call_thread_fsm *> (m_thread->thread_fsm ());
|
||||
+ fsm->timed_out ();
|
||||
target_stop (m_thread->ptid);
|
||||
}
|
||||
};
|
||||
@@ -1744,14 +1779,27 @@ When the function is done executing, GDB will silently stop."),
|
||||
/* A timeout results in a signal being sent to the inferior. */
|
||||
gdb_assert (stopped_by_random_signal);
|
||||
|
||||
- /* Indentation is weird here. A later patch is going to move the
|
||||
- following block into an if/else, so I'm leaving the indentation
|
||||
- here to minimise the later patch.
|
||||
+ if (unwind_on_timeout_p)
|
||||
+ {
|
||||
+ /* The user wants the context restored. */
|
||||
+
|
||||
+ /* We must get back to the frame we were before the
|
||||
+ dummy call. */
|
||||
+ dummy_frame_pop (dummy_id, call_thread.get ());
|
||||
|
||||
- Also, the error message used below refers to 'set
|
||||
- unwind-on-timeout' which doesn't exist yet. This will be added
|
||||
- in a later commit, I'm leaving this in for now to minimise the
|
||||
- churn caused by the commit that adds unwind-on-timeout. */
|
||||
+ /* We also need to restore inferior status to that before the
|
||||
+ dummy call. */
|
||||
+ restore_infcall_control_state (inf_status.release ());
|
||||
+
|
||||
+ error (_("\
|
||||
+The program being debugged timed out while in a function called from GDB.\n\
|
||||
+GDB has restored the context to what it was before the call.\n\
|
||||
+To change this behavior use \"set unwind-on-timeout off\".\n\
|
||||
+Evaluation of the expression containing the function\n\
|
||||
+(%s) will be abandoned."),
|
||||
+ name.c_str ());
|
||||
+ }
|
||||
+ else
|
||||
{
|
||||
/* The user wants to stay in the frame where we stopped
|
||||
(default). Discard inferior status, we're not at the same
|
||||
@@ -1877,6 +1925,20 @@ The default is to unwind the frame."),
|
||||
show_unwind_on_terminating_exception_p,
|
||||
&setlist, &showlist);
|
||||
|
||||
+ add_setshow_boolean_cmd ("unwind-on-timeout", no_class,
|
||||
+ &unwind_on_timeout_p, _("\
|
||||
+Set unwinding of stack if a timeout occurs while in a call dummy."), _("\
|
||||
+Show unwinding of stack if a timeout occurs while in a call dummy."),
|
||||
+ _("\
|
||||
+The unwind on timeout flag lets the user determine what gdb should do if\n\
|
||||
+gdb times out while in a function called from gdb. If set, gdb unwinds\n\
|
||||
+the stack and restores the context to what it was before the call. If\n\
|
||||
+unset, gdb leaves the inferior in the frame where the timeout occurred.\n\
|
||||
+The default is to stop in the frame where the timeout occurred."),
|
||||
+ NULL,
|
||||
+ show_unwind_on_timeout_p,
|
||||
+ &setlist, &showlist);
|
||||
+
|
||||
add_setshow_uinteger_cmd ("direct-call-timeout", no_class,
|
||||
&direct_call_timeout, _("\
|
||||
Set the timeout, for direct calls to inferior function calls."), _("\
|
||||
diff --git a/gdb/testsuite/gdb.base/infcall-timeout.exp b/gdb/testsuite/gdb.base/infcall-timeout.exp
|
||||
--- a/gdb/testsuite/gdb.base/infcall-timeout.exp
|
||||
+++ b/gdb/testsuite/gdb.base/infcall-timeout.exp
|
||||
@@ -28,7 +28,11 @@ if { [build_executable "failed to prepare" ${binfile} "${srcfile}" \
|
||||
# then adjust the direct-call-timeout, and make an inferior function
|
||||
# call that will never return. GDB should eventually timeout and stop
|
||||
# the inferior.
|
||||
-proc run_test { target_async target_non_stop non_stop } {
|
||||
+#
|
||||
+# When UNWIND is "off" the inferior wil be left in the frame where the
|
||||
+# timeout occurs, otherwise, when UNWIND is "on", GDB should unwind
|
||||
+# back to the frame where the inferior call was made.
|
||||
+proc run_test { target_async target_non_stop non_stop unwind } {
|
||||
save_vars { ::GDBFLAGS } {
|
||||
append ::GDBFLAGS \
|
||||
" -ex \"maint set target-non-stop $target_non_stop\""
|
||||
@@ -45,28 +49,43 @@ proc run_test { target_async target_non_stop non_stop } {
|
||||
}
|
||||
|
||||
gdb_test_no_output "set direct-call-timeout 5"
|
||||
+ gdb_test_no_output "set unwind-on-timeout $unwind"
|
||||
+
|
||||
+ if { $unwind } {
|
||||
+ gdb_test "print function_that_never_returns ()" \
|
||||
+ [multi_line \
|
||||
+ "The program being debugged timed out while in a function called from GDB\\." \
|
||||
+ "GDB has restored the context to what it was before the call\\." \
|
||||
+ "To change this behavior use \"set unwind-on-timeout off\"\\." \
|
||||
+ "Evaluation of the expression containing the function" \
|
||||
+ "\\(function_that_never_returns\\) will be abandoned\\."]
|
||||
|
||||
- # When non-stop mode is off we get slightly different output from GDB.
|
||||
- if { ([target_info gdb_protocol] == "remote"
|
||||
- || [target_info gdb_protocol] == "extended-remote")
|
||||
- && !$target_non_stop } {
|
||||
- set stopped_line_pattern "Program received signal SIGINT, Interrupt\\."
|
||||
+ gdb_test "bt" \
|
||||
+ "#0\\s+main \\(\\).*"
|
||||
} else {
|
||||
- set stopped_line_pattern "Program stopped\\."
|
||||
- }
|
||||
+ # When non-stop mode is off we get slightly different output from GDB.
|
||||
+ if { ([target_info gdb_protocol] == "remote"
|
||||
+ || [target_info gdb_protocol] == "extended-remote")
|
||||
+ && !$target_non_stop } {
|
||||
+ set stopped_line_pattern "Program received signal SIGINT, Interrupt\\."
|
||||
+ } else {
|
||||
+ set stopped_line_pattern "Program stopped\\."
|
||||
+ }
|
||||
|
||||
- gdb_test "print function_that_never_returns ()" \
|
||||
- [multi_line \
|
||||
- $stopped_line_pattern \
|
||||
- ".*" \
|
||||
- "The program being debugged timed out while in a function called from GDB\\." \
|
||||
- "GDB remains in the frame where the timeout occurred\\." \
|
||||
- "To change this behavior use \"set unwind-on-timeout on\"\\." \
|
||||
- "Evaluation of the expression containing the function" \
|
||||
- "\\(function_that_never_returns\\) will be abandoned\\." \
|
||||
- "When the function is done executing, GDB will silently stop\\."]
|
||||
-
|
||||
- gdb_test "bt" ".* function_that_never_returns .*<function called from gdb>.*"
|
||||
+ gdb_test "print function_that_never_returns ()" \
|
||||
+ [multi_line \
|
||||
+ $stopped_line_pattern \
|
||||
+ ".*" \
|
||||
+ "The program being debugged timed out while in a function called from GDB\\." \
|
||||
+ "GDB remains in the frame where the timeout occurred\\." \
|
||||
+ "To change this behavior use \"set unwind-on-timeout on\"\\." \
|
||||
+ "Evaluation of the expression containing the function" \
|
||||
+ "\\(function_that_never_returns\\) will be abandoned\\." \
|
||||
+ "When the function is done executing, GDB will silently stop\\."]
|
||||
+
|
||||
+ gdb_test "bt" \
|
||||
+ ".* function_that_never_returns .*<function called from gdb>.*"
|
||||
+ }
|
||||
}
|
||||
|
||||
foreach_with_prefix target_async { "on" "off" } {
|
||||
@@ -88,7 +107,9 @@ foreach_with_prefix target_async { "on" "off" } {
|
||||
continue
|
||||
}
|
||||
|
||||
- run_test $target_async $target_non_stop $non_stop
|
||||
+ foreach_with_prefix unwind { "on" "off" } {
|
||||
+ run_test $target_async $target_non_stop $non_stop $unwind
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp
|
||||
--- a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp
|
||||
@@ -41,7 +41,12 @@ set segfault_line [gdb_get_line_number "Segfault here"]
|
||||
# thread, on which the inferior call relies, either hits a breakpoint
|
||||
# (when OTHER_THREAD_BP is true), or crashes (when OTHER_THREAD_BP is
|
||||
# false).
|
||||
-proc run_test { target_async target_non_stop non_stop other_thread_bp } {
|
||||
+#
|
||||
+# When UNWIND is "on" GDB will unwind the thread which performed the
|
||||
+# inferior function call back to the state where the inferior call was
|
||||
+# made (when the inferior call times out). Otherwise, when UNWIND is
|
||||
+# "off", the inferior is left in the frame where the timeout occurred.
|
||||
+proc run_test { target_async target_non_stop non_stop other_thread_bp unwind } {
|
||||
save_vars { ::GDBFLAGS } {
|
||||
append ::GDBFLAGS " -ex \"maint set target-non-stop $target_non_stop\""
|
||||
append ::GDBFLAGS " -ex \"maint non-stop $non_stop\""
|
||||
@@ -72,6 +77,7 @@ proc run_test { target_async target_non_stop non_stop other_thread_bp } {
|
||||
# for this timeout. For now though, we just hope 5 seconds is
|
||||
# enough.
|
||||
gdb_test_no_output "set indirect-call-timeout 5"
|
||||
+ gdb_test_no_output "set unwind-on-timeout $unwind"
|
||||
|
||||
gdb_breakpoint \
|
||||
"${::srcfile}:${::cond_bp_line} if (condition_func ())"
|
||||
@@ -92,27 +98,43 @@ proc run_test { target_async target_non_stop non_stop other_thread_bp } {
|
||||
"get number for segfault breakpoint"]
|
||||
}
|
||||
|
||||
- # When non-stop mode is off we get slightly different output from GDB.
|
||||
- if { ([target_info gdb_protocol] == "remote"
|
||||
- || [target_info gdb_protocol] == "extended-remote")
|
||||
- && !$target_non_stop} {
|
||||
- set stopped_line_pattern "Thread ${::decimal} \"\[^\r\n\"\]+\" received signal SIGINT, Interrupt\\."
|
||||
+ if { $unwind } {
|
||||
+ gdb_test "continue" \
|
||||
+ [multi_line \
|
||||
+ "Error in testing condition for breakpoint ${bp_num}:" \
|
||||
+ "The program being debugged timed out while in a function called from GDB\\." \
|
||||
+ "GDB has restored the context to what it was before the call\\." \
|
||||
+ "To change this behavior use \"set unwind-on-timeout off\"\\." \
|
||||
+ "Evaluation of the expression containing the function" \
|
||||
+ "\\(condition_func\\) will be abandoned\\." \
|
||||
+ "" \
|
||||
+ "Thread ${::decimal}\[^\r\n\]*hit Breakpoint ${bp_num}, \[^\r\n\]+" \
|
||||
+ "\[^\r\n\]+ Conditional breakpoint here\\. \[^\r\n\]+"] \
|
||||
+ "expected timeout waiting for inferior call to complete"
|
||||
} else {
|
||||
- set stopped_line_pattern "Thread ${::decimal} \"\[^\r\n\"\]+\" stopped\\."
|
||||
- }
|
||||
+ # When non-stop mode is off we get slightly different output from GDB.
|
||||
+ if { ([target_info gdb_protocol] == "remote"
|
||||
+ || [target_info gdb_protocol] == "extended-remote")
|
||||
+ && !$target_non_stop} {
|
||||
+ set stopped_line_pattern \
|
||||
+ "Thread ${::decimal} \"\[^\r\n\"\]+\" received signal SIGINT, Interrupt\\."
|
||||
+ } else {
|
||||
+ set stopped_line_pattern "Thread ${::decimal} \"\[^\r\n\"\]+\" stopped\\."
|
||||
+ }
|
||||
|
||||
- gdb_test "continue" \
|
||||
- [multi_line \
|
||||
- $stopped_line_pattern \
|
||||
- ".*" \
|
||||
- "Error in testing condition for breakpoint ${bp_num}:" \
|
||||
- "The program being debugged timed out while in a function called from GDB\\." \
|
||||
- "GDB remains in the frame where the timeout occurred\\." \
|
||||
- "To change this behavior use \"set unwind-on-timeout on\"\\." \
|
||||
- "Evaluation of the expression containing the function" \
|
||||
- "\\(condition_func\\) will be abandoned\\." \
|
||||
- "When the function is done executing, GDB will silently stop\\."] \
|
||||
- "expected timeout waiting for inferior call to complete"
|
||||
+ gdb_test "continue" \
|
||||
+ [multi_line \
|
||||
+ "$stopped_line_pattern" \
|
||||
+ ".*" \
|
||||
+ "Error in testing condition for breakpoint ${bp_num}:" \
|
||||
+ "The program being debugged timed out while in a function called from GDB\\." \
|
||||
+ "GDB remains in the frame where the timeout occurred\\." \
|
||||
+ "To change this behavior use \"set unwind-on-timeout on\"\\." \
|
||||
+ "Evaluation of the expression containing the function" \
|
||||
+ "\\(condition_func\\) will be abandoned\\." \
|
||||
+ "When the function is done executing, GDB will silently stop\\."] \
|
||||
+ "expected timeout waiting for inferior call to complete"
|
||||
+ }
|
||||
|
||||
# Remember that other thread that either crashed (with a segfault)
|
||||
# or hit a breakpoint? Now that the inferior call has timed out,
|
||||
@@ -158,8 +180,11 @@ foreach_with_prefix target_async {"on" "off" } {
|
||||
# disabled.
|
||||
continue
|
||||
}
|
||||
- foreach_with_prefix other_thread_bp { true false } {
|
||||
- run_test $target_async $target_non_stop $non_stop $other_thread_bp
|
||||
+ foreach_with_prefix unwind {"off" "on"} {
|
||||
+ foreach_with_prefix other_thread_bp { true false } {
|
||||
+ run_test $target_async $target_non_stop $non_stop \
|
||||
+ $other_thread_bp $unwind
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
467
gdb-rhel-13298-inferior-funcall-bp-condition-5-of-5.patch
Normal file
467
gdb-rhel-13298-inferior-funcall-bp-condition-5-of-5.patch
Normal file
@ -0,0 +1,467 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Wed, 18 Jan 2023 12:09:05 +0000
|
||||
Subject: gdb-rhel-13298-inferior-funcall-bp-condition-5-of-5.patch
|
||||
|
||||
;;gdb: rename unwindonsignal to unwind-on-signal
|
||||
;;(Andrew Burgess, RHEL-13298)
|
||||
|
||||
We now have unwind-on-timeout and unwind-on-terminating-exception, and
|
||||
then the odd one out unwindonsignal.
|
||||
|
||||
I'm not a great fan of these squashed together command names, so in
|
||||
this commit I propose renaming this to unwind-on-signal.
|
||||
|
||||
Obviously I've added the hidden alias unwindonsignal so any existing
|
||||
GDB scripts will keep working.
|
||||
|
||||
There's one test that I've extended to test the alias works, but in
|
||||
most of the other test scripts I've changed over to use the new name.
|
||||
|
||||
The docs are updated to reference the new name.
|
||||
|
||||
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
|
||||
Tested-By: Luis Machado <luis.machado@arm.com>
|
||||
Tested-By: Keith Seitz <keiths@redhat.com>
|
||||
|
||||
diff --git a/gdb/NEWS b/gdb/NEWS
|
||||
--- a/gdb/NEWS
|
||||
+++ b/gdb/NEWS
|
||||
@@ -32,6 +32,10 @@ maintenance info line-table
|
||||
if the line is considered the start of the epilgoue, and thus a point at
|
||||
which the frame can be considered destroyed.
|
||||
|
||||
+set unwindonsignal on|off
|
||||
+show unwindonsignal
|
||||
+ These commands are now aliases for the new set/show unwind-on-signal.
|
||||
+
|
||||
* New commands
|
||||
|
||||
info missing-debug-handler
|
||||
@@ -81,6 +85,11 @@ show unwind-on-timeout
|
||||
dummy frame that was added for the inferior call, and restoring the
|
||||
inferior state to how it was before the inferior call started.
|
||||
|
||||
+set unwind-on-signal on|off
|
||||
+show unwind-on-signal
|
||||
+ These new commands replaces the existing set/show unwindonsignal. The
|
||||
+ old command is maintained as an alias.
|
||||
+
|
||||
* New features in the GDB remote stub, GDBserver
|
||||
|
||||
** The --remote-debug and --event-loop-debug command line options
|
||||
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
||||
--- a/gdb/doc/gdb.texinfo
|
||||
+++ b/gdb/doc/gdb.texinfo
|
||||
@@ -20886,7 +20886,7 @@ value history.
|
||||
It is possible for the function you call via the @code{print} or
|
||||
@code{call} command to generate a signal (e.g., if there's a bug in
|
||||
the function, or if you passed it incorrect arguments). What happens
|
||||
-in that case is controlled by the @code{set unwindonsignal} command.
|
||||
+in that case is controlled by the @code{set unwind-on-signal} command.
|
||||
|
||||
Similarly, with a C@t{++} program it is possible for the function you
|
||||
call via the @code{print} or @code{call} command to generate an
|
||||
@@ -20900,7 +20900,8 @@ in that case is controlled by the
|
||||
|
||||
@anchor{stack unwind settings}
|
||||
@table @code
|
||||
-@item set unwindonsignal
|
||||
+@item set unwind-on-signal
|
||||
+@kindex set unwind-on-signal
|
||||
@kindex set unwindonsignal
|
||||
@cindex unwind stack in called functions
|
||||
@cindex call dummy stack unwinding
|
||||
@@ -20911,11 +20912,18 @@ the context to what it was before the call. If set to off (the
|
||||
default), @value{GDBN} stops in the frame where the signal was
|
||||
received.
|
||||
|
||||
-@item show unwindonsignal
|
||||
+The command @code{set unwindonsignal} is an alias for this command,
|
||||
+and is maintained for backward compatibility.
|
||||
+
|
||||
+@item show unwind-on-signal
|
||||
+@kindex show unwind-on-signal
|
||||
@kindex show unwindonsignal
|
||||
Show the current setting of stack unwinding in the functions called by
|
||||
@value{GDBN}.
|
||||
|
||||
+The command @code{show unwindonsignal} is an alias for this command,
|
||||
+and is maintained for backward compatibility.
|
||||
+
|
||||
@item set unwind-on-terminating-exception
|
||||
@kindex set unwind-on-terminating-exception
|
||||
@cindex unwind stack in called functions with unhandled exceptions
|
||||
@@ -20980,7 +20988,7 @@ call by typing the interrupt character (often @kbd{Ctrl-c}).
|
||||
If a called function is interrupted for any reason, including hitting
|
||||
a breakpoint, or triggering a watchpoint, and the stack is not unwound
|
||||
due to @code{set unwind-on-terminating-exception on}, @code{set
|
||||
-unwind-on-timeout on}, or @code{set unwindonsignal on} (@pxref{stack
|
||||
+unwind-on-timeout on}, or @code{set unwind-on-signal on} (@pxref{stack
|
||||
unwind settings}), then the dummy-frame, created by @value{GDBN} to
|
||||
facilitate the call to the program function, will be visible in the
|
||||
backtrace, for example frame @code{#3} in the following backtrace:
|
||||
diff --git a/gdb/infcall.c b/gdb/infcall.c
|
||||
--- a/gdb/infcall.c
|
||||
+++ b/gdb/infcall.c
|
||||
@@ -1747,7 +1747,7 @@ When the function is done executing, GDB will silently stop."),
|
||||
The program being debugged received signal %s, %s\n\
|
||||
while in a function called from GDB. GDB has restored the context\n\
|
||||
to what it was before the call. To change this behavior use\n\
|
||||
-\"set unwindonsignal off\". Evaluation of the expression containing\n\
|
||||
+\"set unwind-on-signal off\". Evaluation of the expression containing\n\
|
||||
the function (%s) will be abandoned."),
|
||||
gdb_signal_to_name (stop_signal),
|
||||
gdb_signal_to_string (stop_signal),
|
||||
@@ -1766,7 +1766,7 @@ the function (%s) will be abandoned."),
|
||||
error (_("\
|
||||
The program being debugged was signaled while in a function called from GDB.\n\
|
||||
GDB remains in the frame where the signal was received.\n\
|
||||
-To change this behavior use \"set unwindonsignal on\".\n\
|
||||
+To change this behavior use \"set unwind-on-signal on\".\n\
|
||||
Evaluation of the expression containing the function\n\
|
||||
(%s) will be abandoned.\n\
|
||||
When the function is done executing, GDB will silently stop."),
|
||||
@@ -1898,17 +1898,22 @@ The default is to perform the conversion."),
|
||||
show_coerce_float_to_double_p,
|
||||
&setlist, &showlist);
|
||||
|
||||
- add_setshow_boolean_cmd ("unwindonsignal", no_class,
|
||||
- &unwind_on_signal_p, _("\
|
||||
+ set_show_commands setshow_unwind_on_signal_cmds
|
||||
+ = add_setshow_boolean_cmd ("unwind-on-signal", no_class,
|
||||
+ &unwind_on_signal_p, _("\
|
||||
Set unwinding of stack if a signal is received while in a call dummy."), _("\
|
||||
Show unwinding of stack if a signal is received while in a call dummy."), _("\
|
||||
-The unwindonsignal lets the user determine what gdb should do if a signal\n\
|
||||
+The unwind-on-signal lets the user determine what gdb should do if a signal\n\
|
||||
is received while in a function called from gdb (call dummy). If set, gdb\n\
|
||||
unwinds the stack and restore the context to what as it was before the call.\n\
|
||||
The default is to stop in the frame where the signal was received."),
|
||||
- NULL,
|
||||
- show_unwind_on_signal_p,
|
||||
- &setlist, &showlist);
|
||||
+ NULL,
|
||||
+ show_unwind_on_signal_p,
|
||||
+ &setlist, &showlist);
|
||||
+ add_alias_cmd ("unwindonsignal", setshow_unwind_on_signal_cmds.set,
|
||||
+ no_class, 1, &setlist);
|
||||
+ add_alias_cmd ("unwindonsignal", setshow_unwind_on_signal_cmds.show,
|
||||
+ no_class, 1, &showlist);
|
||||
|
||||
add_setshow_boolean_cmd ("unwind-on-terminating-exception", no_class,
|
||||
&unwind_on_terminating_exception_p, _("\
|
||||
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
|
||||
--- a/gdb/testsuite/gdb.base/callfuncs.exp
|
||||
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
|
||||
@@ -46,7 +46,7 @@ proc do_function_calls {prototypes} {
|
||||
|
||||
# If any of these calls segv we don't want to affect subsequent tests.
|
||||
# E.g., we want to ensure register values are restored.
|
||||
- gdb_test_no_output "set unwindonsignal on"
|
||||
+ gdb_test_no_output "set unwind-on-signal on"
|
||||
|
||||
gdb_test "p t_char_values(0,0)" " = 0"
|
||||
gdb_test "p t_char_values('a','b')" " = 1"
|
||||
@@ -237,7 +237,7 @@ proc do_function_calls {prototypes} {
|
||||
"call inferior func with struct - returns char *"
|
||||
|
||||
# Restore default value.
|
||||
- gdb_test_no_output "set unwindonsignal off"
|
||||
+ gdb_test_no_output "set unwind-on-signal off"
|
||||
}
|
||||
|
||||
# Procedure to get current content of all registers.
|
||||
diff --git a/gdb/testsuite/gdb.base/infcall-failure.exp b/gdb/testsuite/gdb.base/infcall-failure.exp
|
||||
--- a/gdb/testsuite/gdb.base/infcall-failure.exp
|
||||
+++ b/gdb/testsuite/gdb.base/infcall-failure.exp
|
||||
@@ -137,7 +137,7 @@ proc_with_prefix run_cond_hits_segfault_test { async_p non_stop_p } {
|
||||
"Error in testing condition for breakpoint ${bp_1_num}:" \
|
||||
"The program being debugged was signaled while in a function called from GDB\\." \
|
||||
"GDB remains in the frame where the signal was received\\." \
|
||||
- "To change this behavior use \"set unwindonsignal on\"\\." \
|
||||
+ "To change this behavior use \"set unwind-on-signal on\"\\." \
|
||||
"Evaluation of the expression containing the function" \
|
||||
"\\(func_segfault\\) will be abandoned\\." \
|
||||
"When the function is done executing, GDB will silently stop\\."]
|
||||
@@ -166,7 +166,7 @@ proc_with_prefix run_call_hits_segfault_test { async_p non_stop_p } {
|
||||
"${::decimal}\\s+\[^\r\n\]+Segfault here\[^\r\n\]+" \
|
||||
"The program being debugged was signaled while in a function called from GDB\\." \
|
||||
"GDB remains in the frame where the signal was received\\." \
|
||||
- "To change this behavior use \"set unwindonsignal on\"\\." \
|
||||
+ "To change this behavior use \"set unwind-on-signal on\"\\." \
|
||||
"Evaluation of the expression containing the function" \
|
||||
"\\(func_segfault\\) will be abandoned\\." \
|
||||
"When the function is done executing, GDB will silently stop\\."]
|
||||
diff --git a/gdb/testsuite/gdb.base/unwindonsignal.exp b/gdb/testsuite/gdb.base/unwindonsignal.exp
|
||||
--- a/gdb/testsuite/gdb.base/unwindonsignal.exp
|
||||
+++ b/gdb/testsuite/gdb.base/unwindonsignal.exp
|
||||
@@ -34,13 +34,29 @@ gdb_test "break stop_here" "Breakpoint \[0-9\]* at .*"
|
||||
gdb_test "continue" "Continuing.*Breakpoint \[0-9\]*, stop_here.*" \
|
||||
"continue to breakpoint at stop_here"
|
||||
|
||||
-# Turn on unwindonsignal.
|
||||
-gdb_test_no_output "set unwindonsignal on" \
|
||||
- "setting unwindonsignal"
|
||||
+# Turn on unwind-on-signal.
|
||||
+gdb_test_no_output "set unwind-on-signal on" \
|
||||
+ "setting unwind-on-signal"
|
||||
|
||||
-gdb_test "show unwindonsignal" \
|
||||
+gdb_test "show unwind-on-signal" \
|
||||
"Unwinding of stack .* is on." \
|
||||
- "showing unwindonsignal"
|
||||
+ "showing unwind-on-signal"
|
||||
+
|
||||
+# For backward compatibility we maintain a 'unwindonsignal' alias for
|
||||
+# 'unwind-on-signal', check it now.
|
||||
+gdb_test "show unwindonsignal" \
|
||||
+ "Unwinding of stack .* is on\\." \
|
||||
+ "showing unwindonsignal alias"
|
||||
+
|
||||
+gdb_test_no_output "set unwindonsignal off" \
|
||||
+ "setting unwindonsignal alias to off"
|
||||
+
|
||||
+gdb_test "show unwind-on-signal" \
|
||||
+ "Unwinding of stack .* is off\\." \
|
||||
+ "showing unwind-on-signal after setting via alias"
|
||||
+
|
||||
+gdb_test_no_output "set unwindonsignal on" \
|
||||
+ "setting unwindonsignal alias to on"
|
||||
|
||||
# Call function (causing the program to get a signal), and see if gdb handles
|
||||
# it properly.
|
||||
@@ -49,7 +65,7 @@ if {[gdb_test "call gen_signal ()" \
|
||||
"The program being debugged received signal SIGABRT, Aborted" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(gen_signal\\) will be abandoned\\."] \
|
||||
"unwindonsignal, inferior function call signaled"] != 0} {
|
||||
return 0
|
||||
@@ -58,15 +74,15 @@ if {[gdb_test "call gen_signal ()" \
|
||||
# Verify the stack got unwound.
|
||||
gdb_test "bt" \
|
||||
"#0 *\[x0-9a-f in\]*stop_here \\(.*\\) at .*#1 *\[x0-9a-f in\]*main \\(.*\\) at .*" \
|
||||
- "unwindonsignal, stack unwound"
|
||||
+ "stack unwound"
|
||||
|
||||
# Verify the dummy frame got removed from dummy_frame_stack.
|
||||
gdb_test_multiple "maint print dummy-frames" \
|
||||
- "unwindonsignal, dummy frame removed" {
|
||||
+ "unwind-on-signal, dummy frame removed" {
|
||||
-re "\[\r\n\]*.*stack=.*code=.*\[\r\n\]+$gdb_prompt $" {
|
||||
- fail "unwindonsignal, dummy frame removed"
|
||||
+ fail $gdb_test_name
|
||||
}
|
||||
-re "\[\r\n\]+$gdb_prompt $" {
|
||||
- pass "unwindonsignal, dummy frame removed"
|
||||
+ pass $gdb_test_name
|
||||
}
|
||||
}
|
||||
diff --git a/gdb/testsuite/gdb.compile/compile-cplus.exp b/gdb/testsuite/gdb.compile/compile-cplus.exp
|
||||
--- a/gdb/testsuite/gdb.compile/compile-cplus.exp
|
||||
+++ b/gdb/testsuite/gdb.compile/compile-cplus.exp
|
||||
@@ -131,13 +131,13 @@ gdb_test "return" "\r\n#0 main .*" "return" \
|
||||
"Make _gdb_expr\\(__gdb_regs\\*\\) return now\\? \\(y or n\\) " "y"
|
||||
gdb_test "info sym $infcall_pc" "\r\nNo symbol matches .*" "info sym not found"
|
||||
|
||||
-gdb_test_no_output "set unwindonsignal on"
|
||||
+gdb_test_no_output "set unwind-on-signal on"
|
||||
gdb_test "compile code *(volatile int *) 0 = 0;" \
|
||||
[multi_line \
|
||||
"The program being debugged received signal SIGSEGV, Segmentation fault" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(_gdb_expr\\(__gdb_regs\\*\\)\\) will be abandoned\\."] \
|
||||
"compile code segfault second"
|
||||
|
||||
@@ -313,7 +313,7 @@ gdb_test "compile code static const int readonly = 1; *(int *) &readonly = 2;" \
|
||||
"The program being debugged received signal SIGSEGV, Segmentation fault" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(_gdb_expr\\(__gdb_regs\\*\\)\\) will be abandoned\\."]
|
||||
gdb_test_no_output "set debug compile off"
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp
|
||||
--- a/gdb/testsuite/gdb.compile/compile.exp
|
||||
+++ b/gdb/testsuite/gdb.compile/compile.exp
|
||||
@@ -157,13 +157,13 @@ gdb_test "return" "\r\n#0 main .*" "return" \
|
||||
"Make _gdb_expr return now\\? \\(y or n\\) " "y"
|
||||
gdb_test "info sym $infcall_pc" "\r\nNo symbol matches .*" "info sym not found"
|
||||
|
||||
-gdb_test_no_output "set unwindonsignal on"
|
||||
+gdb_test_no_output "set unwind-on-signal on"
|
||||
gdb_test "compile code *(volatile int *) 0 = 0;" \
|
||||
[multi_line \
|
||||
"The program being debugged received signal SIGSEGV, Segmentation fault" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(_gdb_expr\\) will be abandoned\\."] \
|
||||
"compile code segfault second"
|
||||
|
||||
@@ -321,7 +321,7 @@ gdb_test "compile code static const int readonly = 1; *(int *) &readonly = 2;" \
|
||||
"The program being debugged received signal SIGSEGV, Segmentation fault" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(_gdb_expr\\) will be abandoned\\."]
|
||||
gdb_test_no_output "set debug compile off"
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp
|
||||
--- a/gdb/testsuite/gdb.cp/gdb2495.exp
|
||||
+++ b/gdb/testsuite/gdb.cp/gdb2495.exp
|
||||
@@ -98,10 +98,10 @@ if {![runto_main]} {
|
||||
# behaviour; it should not. Test both on and off states.
|
||||
|
||||
# Turn on unwind on signal behaviour.
|
||||
-gdb_test_no_output "set unwindonsignal on"
|
||||
+gdb_test_no_output "set unwind-on-signal on"
|
||||
|
||||
# Check that it is turned on.
|
||||
-gdb_test "show unwindonsignal" \
|
||||
+gdb_test "show unwind-on-signal" \
|
||||
"signal is received while in a call dummy is on.*" \
|
||||
"turn on unwind on signal"
|
||||
|
||||
@@ -112,20 +112,20 @@ gdb_test "p exceptions.raise_signal(1)" \
|
||||
"The program being debugged received signal SIGABRT, Aborted" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(SimpleException::raise_signal\\(int\\)\\) will be abandoned\\."]\
|
||||
- "check for unwindonsignal off message"
|
||||
+ "check for unwind-on-signal off message"
|
||||
|
||||
# And reverse - turn off again.
|
||||
-gdb_test_no_output "set unwindonsignal off"
|
||||
+gdb_test_no_output "set unwind-on-signal off"
|
||||
|
||||
# Check that it is actually turned off.
|
||||
-gdb_test "show unwindonsignal" \
|
||||
+gdb_test "show unwind-on-signal" \
|
||||
"signal is received while in a call dummy is off.*" \
|
||||
"turn off unwind on signal"
|
||||
|
||||
# Check to see if new behaviour interferes with
|
||||
# normal signal handling in inferior function calls.
|
||||
gdb_test "p exceptions.raise_signal(1)" \
|
||||
- "To change this behavior use \"set unwindonsignal on\".*" \
|
||||
- "check for unwindonsignal on message"
|
||||
+ "To change this behavior use \"set unwind-on-signal on\".*" \
|
||||
+ "check for unwind-on-signal on message"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/function-calls.exp b/gdb/testsuite/gdb.fortran/function-calls.exp
|
||||
--- a/gdb/testsuite/gdb.fortran/function-calls.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/function-calls.exp
|
||||
@@ -44,7 +44,7 @@ if {![runto [gdb_get_line_number "post_init"]]} {
|
||||
}
|
||||
|
||||
# Use inspired by gdb.base/callfuncs.exp.
|
||||
-gdb_test_no_output "set unwindonsignal on"
|
||||
+gdb_test_no_output "set unwind-on-signal on"
|
||||
|
||||
# Baseline: function and subroutine call with no arguments.
|
||||
gdb_test "p no_arg()" " = .TRUE."
|
||||
diff --git a/gdb/testsuite/gdb.mi/mi-condbreak-fail.exp b/gdb/testsuite/gdb.mi/mi-condbreak-fail.exp
|
||||
--- a/gdb/testsuite/gdb.mi/mi-condbreak-fail.exp
|
||||
+++ b/gdb/testsuite/gdb.mi/mi-condbreak-fail.exp
|
||||
@@ -43,7 +43,7 @@ proc run_test { unwind_on_signal } {
|
||||
return
|
||||
}
|
||||
|
||||
- mi_gdb_test "-gdb-set unwindonsignal ${unwind_on_signal}" {\^done} \
|
||||
+ mi_gdb_test "-gdb-set unwind-on-signal ${unwind_on_signal}" {\^done} \
|
||||
"set unwind-on-signal"
|
||||
|
||||
# Create the conditional breakpoint.
|
||||
@@ -70,7 +70,7 @@ proc run_test { unwind_on_signal } {
|
||||
"&\"The program being debugged received signal SIGSEGV, Segmentation fault\\\\n\"" \
|
||||
"&\"while in a function called from GDB\\. GDB has restored the context\\\\n\"" \
|
||||
"&\"to what it was before the call\\. To change this behavior use\\\\n\"" \
|
||||
- "&\"\\\\\"set unwindonsignal off\\\\\"\\. Evaluation of the expression containing\\\\n\"" \
|
||||
+ "&\"\\\\\"set unwind-on-signal off\\\\\"\\. Evaluation of the expression containing\\\\n\"" \
|
||||
"&\"the function \\(cond_fail\\) will be abandoned\\.\\\\n\"" \
|
||||
"=breakpoint-modified,bkpt={number=\"$bpnum\",type=\"breakpoint\",\[^\r\n\]+times=\"1\",\[^\r\n\]+}" \
|
||||
"~\"\\\\n\"" \
|
||||
@@ -92,7 +92,7 @@ proc run_test { unwind_on_signal } {
|
||||
"&\"Error in testing condition for breakpoint $bpnum:\\\\n\"" \
|
||||
"&\"The program being debugged was signaled while in a function called from GDB\\.\\\\n\"" \
|
||||
"&\"GDB remains in the frame where the signal was received\\.\\\\n\"" \
|
||||
- "&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\.\\\\n\"" \
|
||||
+ "&\"To change this behavior use \\\\\"set unwind-on-signal on\\\\\"\\.\\\\n\"" \
|
||||
"&\"Evaluation of the expression containing the function\\\\n\"" \
|
||||
"&\"\\(cond_fail\\) will be abandoned\\.\\\\n\"" \
|
||||
"&\"When the function is done executing, GDB will silently stop\\.\\\\n\"" \
|
||||
diff --git a/gdb/testsuite/gdb.mi/mi-condbreak-throw.exp b/gdb/testsuite/gdb.mi/mi-condbreak-throw.exp
|
||||
--- a/gdb/testsuite/gdb.mi/mi-condbreak-throw.exp
|
||||
+++ b/gdb/testsuite/gdb.mi/mi-condbreak-throw.exp
|
||||
@@ -103,7 +103,7 @@ proc run_test { unwind_on_exception } {
|
||||
"&\"Error in testing condition for breakpoint $bpnum:\\\\n\"" \
|
||||
"&\"The program being debugged was signaled while in a function called from GDB\\.\\\\n\"" \
|
||||
"&\"GDB remains in the frame where the signal was received\\.\\\\n\"" \
|
||||
- "&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\.\\\\n\"" \
|
||||
+ "&\"To change this behavior use \\\\\"set unwind-on-signal on\\\\\"\\.\\\\n\"" \
|
||||
"&\"Evaluation of the expression containing the function\\\\n\"" \
|
||||
"&\"\\(cond_throw\\(\\)\\) will be abandoned\\.\\\\n\"" \
|
||||
"&\"When the function is done executing, GDB will silently stop\\.\\\\n\"" \
|
||||
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
|
||||
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp
|
||||
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
|
||||
@@ -94,7 +94,7 @@ mi_gdb_test "409-stack-list-frames 0 0" \
|
||||
#
|
||||
|
||||
mi_gdb_test "410-data-evaluate-expression bar()" \
|
||||
- ".*410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\".\\\\nEvaluation of the expression containing the function\\\\n\\(bar\\) will be abandoned.\\\\nWhen the function is done executing, GDB will silently stop.\"" \
|
||||
+ ".*410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwind-on-signal on\\\\\".\\\\nEvaluation of the expression containing the function\\\\n\\(bar\\) will be abandoned.\\\\nWhen the function is done executing, GDB will silently stop.\"" \
|
||||
"call inferior function which raises exception"
|
||||
|
||||
mi_gdb_test "411-stack-list-frames" "411\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"}.*\\\]" "backtrace from inferior function at exception"
|
||||
diff --git a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp
|
||||
--- a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp
|
||||
@@ -173,7 +173,7 @@ proc_with_prefix run_bp_cond_segfaults { target_async target_non_stop } {
|
||||
"Error in testing condition for breakpoint ${bp_1_num}:" \
|
||||
"The program being debugged was signaled while in a function called from GDB\\." \
|
||||
"GDB remains in the frame where the signal was received\\." \
|
||||
- "To change this behavior use \"set unwindonsignal on\"\\." \
|
||||
+ "To change this behavior use \"set unwind-on-signal on\"\\." \
|
||||
"Evaluation of the expression containing the function" \
|
||||
"\\(function_that_segfaults\\) will be abandoned\\." \
|
||||
"When the function is done executing, GDB will silently stop\\."]
|
||||
diff --git a/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp b/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp
|
||||
--- a/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp
|
||||
@@ -13,7 +13,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
-# Test use of unwindonsignal when a hand function call that gets interrupted
|
||||
+# Test use of unwind-on-signal when a hand function call that gets interrupted
|
||||
# by a signal in another thread.
|
||||
|
||||
set NR_THREADS 4
|
||||
@@ -49,12 +49,12 @@ gdb_test "continue" \
|
||||
# We want the main thread (hand_call_with_signal) and
|
||||
# thread 1 (sigabrt_handler) to both run.
|
||||
|
||||
-# Do turn on unwindonsignal.
|
||||
+# Do turn on unwind-on-signal.
|
||||
# We want to test gdb handling of the current thread changing when
|
||||
# unwindonsignal is in effect.
|
||||
-gdb_test_no_output "set unwindonsignal on" \
|
||||
+gdb_test_no_output "set unwind-on-signal on" \
|
||||
"setting unwindonsignal"
|
||||
-gdb_test "show unwindonsignal" \
|
||||
+gdb_test "show unwind-on-signal" \
|
||||
"Unwinding of stack .* is on." \
|
||||
"showing unwindonsignal"
|
||||
|
379
gdb-rhel-19390-pc-not-saved.patch
Normal file
379
gdb-rhel-19390-pc-not-saved.patch
Normal file
@ -0,0 +1,379 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 13:52:59 +0000
|
||||
Subject: gdb-rhel-19390-pc-not-saved.patch
|
||||
|
||||
;;gdb/unwinders: better support for $pc not saved
|
||||
;;(Andrew Burgess, RHEL-19390)
|
||||
|
||||
This started with a Red Hat bug report which can be seen here:
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1850710
|
||||
|
||||
The problem reported here was using GDB on GNU/Linux for S390, the
|
||||
user stepped into JIT generated code. As they enter the JIT code GDB
|
||||
would report 'PC not saved', and this same message would be reported
|
||||
after each step/stepi.
|
||||
|
||||
Additionally, the user had 'set disassemble-next-line on', and once
|
||||
they entered the JIT code this output was not displayed, nor were any
|
||||
'display' directives displayed.
|
||||
|
||||
The user is not making use of the JIT plugin API to provide debug
|
||||
information. But that's OK, they aren't expecting any source level
|
||||
debug here, they are happy to use 'stepi', but the missing 'display'
|
||||
directives are a problem, as is the constant 'PC not saved' (error)
|
||||
message.
|
||||
|
||||
What is happening here is that as GDB is failing to find any debug
|
||||
information for the JIT generated code, it is falling back on to the
|
||||
S390 prologue unwinder to try and unwind frame #0. Unfortunately,
|
||||
without being able to identify the function boundaries, the S390
|
||||
prologue scanner can't help much, in fact, it doesn't even suggest an
|
||||
arbitrary previous $pc value (some targets that use a link-register
|
||||
will, by default, assume the link-register contains the previous $pc),
|
||||
instead the S390 will just say, "sorry, I have no previous $pc value".
|
||||
|
||||
The result of this is that when GDB tries to find frame #1 we end
|
||||
throwing an error from frame_unwind_pc (the 'PC not saved' error).
|
||||
This error is not caught anywhere except at the top-level interpreter
|
||||
loop, and so we end up skipping all the 'display' directive handling.
|
||||
|
||||
While thinking about this, I wondered, could I trigger the same error
|
||||
using the Python Unwinder API? What happens if a Python unwinder
|
||||
claims a frame, but then fails to provide a previous $pc value?
|
||||
|
||||
Turns out that exactly the same thing happens, which is great, as that
|
||||
means we now have a way to reproduce this bug on any target. And so
|
||||
the test included with this patch does just this. I have a Python
|
||||
unwinder that claims a frame, but doesn't provide any previous
|
||||
register values.
|
||||
|
||||
I then do two tests, first I stop in the claimed frame (i.e. frame #0
|
||||
is the frame that can't be unwound), I perform a few steps, and check
|
||||
the backtrace. And second, I stop in a child of the problem
|
||||
frame (i.e. frame #1 is the frame that can't be unwound), and from
|
||||
here I check the backtrace.
|
||||
|
||||
While all this is going on I have a 'display' directive in place, and
|
||||
each time GDB stops I check that the display directive triggers.
|
||||
|
||||
Additionally, when checking the backtrace, I am checking that the
|
||||
backtrace finishes with the message 'Backtrace stopped: frame did not
|
||||
save the PC'.
|
||||
|
||||
As for the fix I chose to add a call to frame_unwind_pc directly to
|
||||
get_prev_frame_always_1. Calling frame_unwind_pc will cache the
|
||||
unwound $pc value, so this doesn't add much additional work as
|
||||
immediately after the new frame_unwind_pc call, we call
|
||||
get_prev_frame_maybe_check_cycle, which actually generates the
|
||||
previous frame, which will always (I think) require a call to
|
||||
frame_unwind_pc anyway.
|
||||
|
||||
The reason for adding the frame_unwind_pc call into
|
||||
get_prev_frame_always_1, is that if the frame_unwind_pc call fails we
|
||||
want to set the frames 'stop_reason', and get_prev_frame_always_1
|
||||
seems to be the place where this is done, so I wanted to keep the new
|
||||
stop_reason setting code next to all the existing stop_reason setting
|
||||
code.
|
||||
|
||||
Additionally, once we enter get_prev_frame_maybe_check_cycle we
|
||||
actually create the previous frame, then, if it turns out that the
|
||||
previous frame can't be created we need to remove the frame .. this
|
||||
seemed more complex than just making the check in
|
||||
get_prev_frame_always_1.
|
||||
|
||||
With this fix in place the original S390 bug is fixed, and also the
|
||||
test added in this commit, that uses the Python API, is also fixed.
|
||||
|
||||
Reviewed-By: Kevin Buettner <kevinb@redhat.com>
|
||||
|
||||
diff --git a/gdb/frame.c b/gdb/frame.c
|
||||
--- a/gdb/frame.c
|
||||
+++ b/gdb/frame.c
|
||||
@@ -2422,6 +2422,38 @@ get_prev_frame_always_1 (frame_info_ptr this_frame)
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Ensure we can unwind the program counter of THIS_FRAME. */
|
||||
+ try
|
||||
+ {
|
||||
+ /* Calling frame_unwind_pc for the sentinel frame relies on the
|
||||
+ current_frame being set, which at this point it might not be if we
|
||||
+ are in the process of setting the current_frame after a stop (see
|
||||
+ get_current_frame).
|
||||
+
|
||||
+ The point of this check is to ensure that the unwinder for
|
||||
+ THIS_FRAME can actually unwind the $pc, which we assume the
|
||||
+ sentinel frame unwinder can always do (it's just a read from the
|
||||
+ machine state), so we only call frame_unwind_pc for frames other
|
||||
+ than the sentinel (level -1) frame.
|
||||
+
|
||||
+ Additionally, we don't actually care about the value of the
|
||||
+ unwound $pc, just that the call completed successfully. */
|
||||
+ if (this_frame->level >= 0)
|
||||
+ frame_unwind_pc (this_frame);
|
||||
+ }
|
||||
+ catch (const gdb_exception_error &ex)
|
||||
+ {
|
||||
+ if (ex.error == NOT_AVAILABLE_ERROR || ex.error == OPTIMIZED_OUT_ERROR)
|
||||
+ {
|
||||
+ frame_debug_printf (" -> nullptr // no saved PC");
|
||||
+ this_frame->stop_reason = UNWIND_NO_SAVED_PC;
|
||||
+ this_frame->prev = nullptr;
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ throw;
|
||||
+ }
|
||||
+
|
||||
return get_prev_frame_maybe_check_cycle (this_frame);
|
||||
}
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/pc-not-saved.c b/gdb/testsuite/gdb.base/pc-not-saved.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/pc-not-saved.c
|
||||
@@ -0,0 +1,48 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2024 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+volatile int global_var = 0;
|
||||
+
|
||||
+void
|
||||
+other_func (void)
|
||||
+{
|
||||
+ /* Nothing. */
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+break_bt_here (void)
|
||||
+{
|
||||
+ /* This is all nonsense; just filler so this function has a body. */
|
||||
+ if (global_var != 99)
|
||||
+ global_var++;
|
||||
+ if (global_var != 98)
|
||||
+ global_var++;
|
||||
+ if (global_var != 97)
|
||||
+ global_var++;
|
||||
+ if (global_var != 96)
|
||||
+ global_var++;
|
||||
+ other_func ();
|
||||
+ if (global_var != 95)
|
||||
+ global_var++;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ break_bt_here ();
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/pc-not-saved.exp b/gdb/testsuite/gdb.base/pc-not-saved.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/pc-not-saved.exp
|
||||
@@ -0,0 +1,113 @@
|
||||
+# Copyright 2024 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# Test how GDB handles a frame in which the previous-pc value is not
|
||||
+# available. Specifically, check that the backtrace correctly reports
|
||||
+# why the backtrace is truncated, and ensure that 'display' directives
|
||||
+# still work when 'stepi'-ing through the frame.
|
||||
+#
|
||||
+# We do this by registering a Python unwinder which doesn't provide
|
||||
+# any previous register values.
|
||||
+
|
||||
+require allow_python_tests
|
||||
+
|
||||
+standard_testfile
|
||||
+
|
||||
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set remote_python_file \
|
||||
+ [gdb_remote_download host "${srcdir}/${subdir}/${testfile}.py"]
|
||||
+
|
||||
+if { ![runto "break_bt_here"] } {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+# Figuring out the correct frame-id from a Python unwinder is hard.
|
||||
+# We need to know the function's start address (not too hard), and the
|
||||
+# stack address on entry to the function, which is much harder to
|
||||
+# figure out in a cross-target way.
|
||||
+#
|
||||
+# So instead we run without any Python unwinder in place and use
|
||||
+# 'maint print frame-id' to record the frame-id. We then restart GDB,
|
||||
+# load the Python unwinder, and tell it to use the frame-id we
|
||||
+# recorded here.
|
||||
+set pc unknown
|
||||
+set cfa unknown
|
||||
+gdb_test_multiple "maintenance print frame-id" "store break_bt_here frame-id" {
|
||||
+ -re -wrap "frame-id for frame #0: \\{stack=($hex),code=($hex),\[^\}\]+\\}" {
|
||||
+ set cfa $expect_out(1,string)
|
||||
+ set pc $expect_out(1,string)
|
||||
+ }
|
||||
+}
|
||||
+gdb_assert { ![string equal $cfa unknown] } \
|
||||
+ "check we read the frame's CFA"
|
||||
+
|
||||
+gdb_assert { ![string equal $pc unknown] } \
|
||||
+ "check we read the frame's PC"
|
||||
+
|
||||
+# Restart and load the Python unwinder script.
|
||||
+clean_restart $binfile
|
||||
+gdb_test_no_output "source ${remote_python_file}" "load python file"
|
||||
+
|
||||
+# Tell the Python unwinder to use the frame-id we cached above.
|
||||
+gdb_test_no_output "python set_break_bt_here_frame_id($pc, $cfa)"
|
||||
+
|
||||
+# Run up to the function which the unwinder will claim.
|
||||
+if { ![runto "break_bt_here"] } {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+# Print the backtrace. Check that the reason for stopping the
|
||||
+# backtrace is that the previous $pc is not available.
|
||||
+gdb_test "bt" \
|
||||
+ [multi_line \
|
||||
+ "^#0 break_bt_here \\(\\) at \[^\r\n\]+" \
|
||||
+ "Backtrace stopped: frame did not save the PC"] \
|
||||
+ "backtrace from break_bt_here function"
|
||||
+
|
||||
+# Ensure we can stepi.
|
||||
+gdb_test "stepi" \
|
||||
+ "(:?$hex\\s+)?$decimal\\s+\[^\r\n\]+" \
|
||||
+ "stepi without a display in place"
|
||||
+
|
||||
+# Setup a 'display' directive.
|
||||
+gdb_test "display/i \$pc" \
|
||||
+ [multi_line \
|
||||
+ "^1: x/i \\\$pc" \
|
||||
+ "=> $hex <break_bt_here(:?\\+$decimal)?>:\\s+\[^\r\n\]+"]
|
||||
+
|
||||
+# Step again, check the 'display' directive is shown.
|
||||
+gdb_test "stepi" \
|
||||
+ [multi_line \
|
||||
+ "(:?$hex\\s+)?$decimal\\s+\[^\r\n\]+" \
|
||||
+ "1: x/i \\\$pc" \
|
||||
+ "=> $hex <break_bt_here(:?\\+$decimal)?>:\\s+\[^\r\n\]+"] \
|
||||
+ "stepi with a display in place"
|
||||
+
|
||||
+# Continue to a function that is called from within break_bt_here.
|
||||
+# The Python unwinder will then be claiming frame #1.
|
||||
+gdb_breakpoint other_func
|
||||
+gdb_continue_to_breakpoint "continue to other_func"
|
||||
+
|
||||
+# Print the backtrace and check that the reason for stopping the
|
||||
+# backtrace is that the previous $pc is not available.
|
||||
+gdb_test "bt" \
|
||||
+ [multi_line \
|
||||
+ "#0 other_func \\(\\) at \[^\r\n\]+" \
|
||||
+ "#1 (:?$hex in )?break_bt_here \\(\\) at \[^\r\n\]+" \
|
||||
+ "Backtrace stopped: frame did not save the PC"] \
|
||||
+ "backtrace from other_func function"
|
||||
diff --git a/gdb/testsuite/gdb.base/pc-not-saved.py b/gdb/testsuite/gdb.base/pc-not-saved.py
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/pc-not-saved.py
|
||||
@@ -0,0 +1,71 @@
|
||||
+# Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+import gdb
|
||||
+from gdb.unwinder import Unwinder, FrameId
|
||||
+
|
||||
+# Cached FrameId. See set_break_bt_here_frame_id for details.
|
||||
+break_bt_here_frame_id = None
|
||||
+
|
||||
+
|
||||
+def set_break_bt_here_frame_id(pc, cfa):
|
||||
+ """Call this to pre-calculate the FrameId for the frame our unwinder
|
||||
+ is going to claim, this avoids us having to actually figure out a
|
||||
+ frame-id within the unwinder, something which is going to be hard
|
||||
+ to do in a cross-target way.
|
||||
+
|
||||
+ Instead we first run the test without the Python unwinder in
|
||||
+ place, use 'maint print frame-id' to record the frame-id, then,
|
||||
+ after loading this Python script, we all this function to record
|
||||
+ the frame-id that the unwinder should use."""
|
||||
+ global break_bt_here_frame_id
|
||||
+ break_bt_here_frame_id = FrameId(cfa, pc)
|
||||
+
|
||||
+
|
||||
+class break_unwinding(Unwinder):
|
||||
+
|
||||
+ """An unwinder for the function 'break_bt_here'. This unwinder will
|
||||
+ claim any frame for the function in question, but doesn't provide
|
||||
+ any unwound register values. Importantly, we don't provide a
|
||||
+ previous $pc value, this means that if we are stopped in
|
||||
+ 'break_bt_here' then we should fail to unwind beyond frame #0."""
|
||||
+
|
||||
+ def __init__(self):
|
||||
+ Unwinder.__init__(self, "break unwinding")
|
||||
+
|
||||
+ def __call__(self, pending_frame):
|
||||
+ pc_desc = pending_frame.architecture().registers().find("pc")
|
||||
+ pc = pending_frame.read_register(pc_desc)
|
||||
+
|
||||
+ if pc.is_optimized_out:
|
||||
+ return None
|
||||
+
|
||||
+ block = gdb.block_for_pc(pc)
|
||||
+ if block == None:
|
||||
+ return None
|
||||
+ func = block.function
|
||||
+ if func == None:
|
||||
+ return None
|
||||
+ if str(func) != "break_bt_here":
|
||||
+ return None
|
||||
+
|
||||
+ global break_bt_here_frame_id
|
||||
+ if break_bt_here_frame_id is None:
|
||||
+ return None
|
||||
+
|
||||
+ return pending_frame.create_unwind_info(break_bt_here_frame_id)
|
||||
+
|
||||
+
|
||||
+gdb.unwinder.register_unwinder(None, break_unwinding(), True)
|
46
gdb-rhel-36225-add-arch14-record.patch
Normal file
46
gdb-rhel-36225-add-arch14-record.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.ibm.com>
|
||||
Date: Tue, 13 Feb 2024 18:55:29 +0100
|
||||
Subject: gdb-rhel-36225-add-arch14-record.patch
|
||||
|
||||
;; Backport "gdb: s390: Add arch14 record/replay support"
|
||||
;; (Andreas Arnez, RHEL-36225)
|
||||
|
||||
Enable recording of the new "arch14" instructions on z/Architecture
|
||||
targets, except for the specialized-function-assist instruction NNPA.
|
||||
|
||||
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
|
||||
--- a/gdb/s390-tdep.c
|
||||
+++ b/gdb/s390-tdep.c
|
||||
@@ -5534,6 +5534,14 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||
case 0xe635: /* VLRL - vector load rightmost with immed. length */
|
||||
case 0xe637: /* VLRLR - vector load rightmost with length */
|
||||
case 0xe649: /* VLIP - vector load immediate decimal */
|
||||
+ case 0xe656: /* VCLFNH - vector fp convert and lengthen from NNP high */
|
||||
+ case 0xe65e: /* VCLFNL - vector fp convert and lengthen from NNP low */
|
||||
+ case 0xe655: /* VCNF - vector fp convert to NNP */
|
||||
+ case 0xe65d: /* VCFN - vector fp convert from NNP */
|
||||
+ case 0xe674: /* VSCHP - decimal scale and convert to HFP */
|
||||
+ case 0xe675: /* VCRNF - vector fp convert and round to NNP */
|
||||
+ case 0xe67c: /* VSCSHP - decimal scale and convert and split to HFP */
|
||||
+ case 0xe67d: /* VCSPH - vector convert HFP to scaled decimal */
|
||||
case 0xe700: /* VLEB - vector load element */
|
||||
case 0xe701: /* VLEH - vector load element */
|
||||
case 0xe702: /* VLEG - vector load element */
|
||||
@@ -5791,11 +5799,16 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||
|
||||
/* 0xe747-0xe749 undefined */
|
||||
|
||||
+ case 0xe651: /* VCLZDP - vector count leading zero digits */
|
||||
+ case 0xe654: /* VUPKZH - vector unpack zoned high */
|
||||
case 0xe658: /* VCVD - vector convert to decimal 32 bit */
|
||||
case 0xe659: /* VSRP - vector shift and round decimal */
|
||||
case 0xe65a: /* VCVDG - vector convert to decimal 64 bit*/
|
||||
case 0xe65b: /* VPSOP - vector perform sign operation decimal */
|
||||
+ case 0xe65c: /* VUPKZL - vector unpack zoned low */
|
||||
+ case 0xe670: /* VPKZR - vector pack zoned register */
|
||||
case 0xe671: /* VAP - vector add decimal */
|
||||
+ case 0xe672: /* VSRPR - vector shift and round decimal register */
|
||||
case 0xe673: /* VSP - vector subtract decimal */
|
||||
case 0xe678: /* VMP - vector multiply decimal */
|
||||
case 0xe679: /* VMSP - vector multiply decimal */
|
48
gdb-rhel-36518-add-power11-support.patch
Normal file
48
gdb-rhel-36518-add-power11-support.patch
Normal file
@ -0,0 +1,48 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Peter Bergner <bergner@linux.ibm.com>
|
||||
Date: Fri, 9 Feb 2024 10:51:30 -0600
|
||||
Subject: gdb-rhel-36518-add-power11-support.patch
|
||||
|
||||
;; Backport "PowerPC: Add support for Power11 options"
|
||||
;; (Peter Bergner, RHEL-36518)
|
||||
|
||||
opcodes/
|
||||
* ppc-dis.c (ppc_opts): Add "power11" and "pwr11" entries.
|
||||
(powerpc_init_dialect): Default to "power11".
|
||||
|
||||
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
|
||||
--- a/opcodes/ppc-dis.c
|
||||
+++ b/opcodes/ppc-dis.c
|
||||
@@ -208,6 +208,11 @@ struct ppc_mopt ppc_opts[] = {
|
||||
| PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
|
||||
| PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
|
||||
0 },
|
||||
+ { "power11", (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
|
||||
+ | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
|
||||
+ | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
|
||||
+ | PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
|
||||
+ 0 },
|
||||
{ "libresoc",(PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
|
||||
| PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
|
||||
| PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
|
||||
@@ -267,6 +272,11 @@ struct ppc_mopt ppc_opts[] = {
|
||||
| PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
|
||||
| PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
|
||||
0 },
|
||||
+ { "pwr11", (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
|
||||
+ | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
|
||||
+ | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
|
||||
+ | PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
|
||||
+ 0 },
|
||||
{ "pwrx", PPC_OPCODE_POWER | PPC_OPCODE_POWER2,
|
||||
0 },
|
||||
{ "raw", PPC_OPCODE_PPC,
|
||||
@@ -396,7 +406,7 @@ powerpc_init_dialect (struct disassemble_info *info)
|
||||
break;
|
||||
default:
|
||||
if (info->arch == bfd_arch_powerpc)
|
||||
- dialect = ppc_parse_cpu (dialect, &sticky, "power10") | PPC_OPCODE_ANY;
|
||||
+ dialect = ppc_parse_cpu (dialect, &sticky, "power11") | PPC_OPCODE_ANY;
|
||||
else
|
||||
dialect = ppc_parse_cpu (dialect, &sticky, "pwr");
|
||||
break;
|
7834
gdb-rhel-36527-apx-disasm.patch
Normal file
7834
gdb-rhel-36527-apx-disasm.patch
Normal file
File diff suppressed because it is too large
Load Diff
59
gdb.spec
59
gdb.spec
@ -53,11 +53,11 @@ Name: %{?scl_prefix}gdb
|
||||
# See timestamp of source gnulib installed into gnulib/ .
|
||||
%global snapgnulib 20220501
|
||||
%global tarname gdb-%{version}
|
||||
Version: 14.1
|
||||
Version: 14.2
|
||||
|
||||
# The release always contains a leading reserved number, start it at 1.
|
||||
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
|
||||
Release: 8%{?dist}
|
||||
Release: 1%{?dist}
|
||||
|
||||
License: GPL-3.0-or-later AND BSD-3-Clause AND FSFAP AND LGPL-2.1-or-later AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain AND GFDL-1.3-or-later AND LGPL-2.0-or-later WITH GCC-exception-2.0 AND GPL-3.0-or-later WITH GCC-exception-3.1 AND GPL-2.0-or-later WITH GNU-compiler-exception
|
||||
# Do not provide URL for snapshots as the file lasts there only for 2 days.
|
||||
@ -112,7 +112,7 @@ Summary: A GNU source-level debugger for C, C++, Fortran, Go and other languages
|
||||
Obsoletes: gdb64 < 5.3.91
|
||||
%endif
|
||||
|
||||
%ifarch %{arm}
|
||||
%ifarch %{arm} riscv64
|
||||
%global have_inproctrace 0
|
||||
%else
|
||||
%global have_inproctrace 1
|
||||
@ -314,7 +314,7 @@ BuildRequires: elfutils-debuginfod-client-devel
|
||||
%if 0%{!?el6:1} && 0%{?scl:1}
|
||||
%global have_debuginfod 1
|
||||
%global use_scl_for_debuginfod 1
|
||||
BuildRequires: %{?scl_prefix}elfutils-debuginfod-client-devel
|
||||
BuildRequires: elfutils-debuginfod-client-devel
|
||||
%endif
|
||||
%endif
|
||||
|
||||
@ -343,7 +343,7 @@ BuildRequires: boost-devel
|
||||
BuildRequires: sharutils dejagnu
|
||||
# gcc-objc++ is not covered by the GDB testsuite.
|
||||
# Test supported SCL toolchain components.
|
||||
BuildRequires: %{?scl_prefix}gcc %{?scl_prefix}gcc-c++ %{?scl_prefix}gcc-gfortran
|
||||
BuildRequires: %{?scl_testing_prefix}gcc %{?scl_testing_prefix}gcc-c++ %{?scl_testing_prefix}gcc-gfortran
|
||||
|
||||
%if 0%{!?rhel:1} || 0%{?rhel} < 8
|
||||
BuildRequires: gcc-objc
|
||||
@ -398,7 +398,7 @@ BuildRequires: gcc-gnat
|
||||
BuildRequires: libgnat%{bits_local} libgnat%{bits_other}
|
||||
%endif
|
||||
%else
|
||||
%ifarch %{ix86} x86_64 ia64 ppc %{power64} alpha s390x %{arm} aarch64
|
||||
%ifarch %{ix86} x86_64 ia64 ppc %{power64} alpha s390x %{arm} aarch64 riscv64
|
||||
%if 0%{!?rhel:1}
|
||||
BuildRequires: gcc-gnat
|
||||
BuildRequires: libgnat%{bits_local} libgnat%{bits_other}
|
||||
@ -420,12 +420,12 @@ BuildRequires: libquadmath%{bits_local} libquadmath%{bits_other}
|
||||
BuildRequires: glibc-static%{bits_other}
|
||||
%endif
|
||||
%ifarch s390x
|
||||
BuildRequires: %{?scl_preifx}valgrind%{bits_local}
|
||||
BuildRequires: valgrind%{bits_local}
|
||||
%if 0%{!?rhel:1} || 0%{?rhel} > 7
|
||||
BuildRequires: %{?scl_prefix}valgrind%{bits_local} valgrind%{bits_other}
|
||||
BuildRequires: valgrind%{bits_local} valgrind%{bits_other}
|
||||
%endif
|
||||
%else
|
||||
BuildRequires: %{?scl_prefix}valgrind%{bits_local} valgrind%{bits_other}
|
||||
BuildRequires:valgrind%{bits_local} valgrind%{bits_other}
|
||||
%endif
|
||||
%if 0%{!?rhel:1} || 0%{?rhel} > 6
|
||||
BuildRequires: xz
|
||||
@ -434,7 +434,7 @@ BuildRequires: xz
|
||||
BuildRequires: rust
|
||||
%endif
|
||||
%if 0%{!?el6:1}
|
||||
BuildRequires: %{?scl_prefix}elfutils-debuginfod
|
||||
BuildRequires: elfutils-debuginfod
|
||||
%endif
|
||||
%endif # 0%{?_with_testsuite:1}
|
||||
BuildRequires: make gmp-devel
|
||||
@ -619,7 +619,7 @@ COMMON_GDB_CONFIGURE_FLAGS="\
|
||||
,-Wno-format-overflow\
|
||||
%endif
|
||||
--enable-build-with-cxx \
|
||||
%ifnarch %{ix86} alpha ppc s390 s390x x86_64 ppc64 ppc64le sparc sparcv9 sparc64 %{arm} aarch64
|
||||
%ifnarch %{ix86} alpha ppc s390 s390x x86_64 ppc64 ppc64le sparc sparcv9 sparc64 %{arm} aarch64 riscv64
|
||||
--disable-werror \
|
||||
%else
|
||||
--enable-werror \
|
||||
@ -1250,6 +1250,43 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed May 29 2024 Keith Seitz <keiths@redhat.com> - 14.2-1.el10
|
||||
- Rebase to gdb-14.2 and update all bug references:
|
||||
RHEL-39326 "better support for $pc not saved"
|
||||
RHEL-39325 "Infcalls from B/P conditions in multi-threaded inferiors"
|
||||
RHEL-39324 "gdb: s390: Add arch14 record/replay support"
|
||||
RHEL-24764 "Add support for Power11 options"
|
||||
RHEL-34213 "Sync x86 disassembler with (proposed) gdb-15.1 release."
|
||||
(Keith Seitz, RHEL-33256)
|
||||
|
||||
* Wed May 29 2024 Guinevere Larsen <blarsen@redhat.com> - 14.2-3.el8
|
||||
- Remove riscv64-linux-gnu target. It was never meant to be added.
|
||||
|
||||
* Thu May 16 2024 Guinevere Larsen <blarsen@redhat.com> - 14.2-2.el8
|
||||
- Backport "better support for $pc not saved"
|
||||
(Andrew Burgess, RHEL-19390)
|
||||
|
||||
* Mon May 13 2024 Guinevere Larsen <blarsen@redhat.com>
|
||||
- Backport series Infcalls from B/P conditions in multi-threaded inferiors
|
||||
(Andrew Burgess, RHEL-13298)
|
||||
|
||||
* Mon May 13 2024 Keith Seitz <keiths@redhat.com>
|
||||
- Backport "gdb: s390: Add arch14 record/replay support"
|
||||
(Andreas Arnez, RHEL-36225)
|
||||
- Backport "Add support for Power11 options"
|
||||
(Peter Bergner, RHEL-36518)
|
||||
- Backport "Sync x86 disassembler with (proposed) gdb-15.1 release."
|
||||
(many authors, RHEL-36527)
|
||||
|
||||
* Tue Apr 23 2024 Guinevere Larsen <blarsen@redhat.com> - 14.2-1.el8
|
||||
- Initial import for GTS14.
|
||||
|
||||
* Tue Mar 12 2024 Alexandra Hájková <ahajkova@redhat.com> - 14.2-1
|
||||
- Rebase to FSF GDB 14.2.
|
||||
|
||||
* Wed Feb 21 2024 Richard W.M. Jones <rjones@redhat.com>
|
||||
- Bump and rebuild for riscv64
|
||||
|
||||
* Mon Jan 29 2024 Kevin Buettner <kevinb@redhat.com> - 14.1-8
|
||||
- Backport upstream workaround for GCC 14 problem which is causing
|
||||
GDB internal errors (RHBZ 261580, Tom de Vries).
|
||||
|
2
sources
2
sources
@ -1,3 +1,3 @@
|
||||
SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8
|
||||
SHA512 (gdb-14.2.tar.xz) = 7e07941f1fe661288cc571b4964012ceabc1760624fce20320db2f470c01439b2386f859b5288da13204b758e2e3b22a74c68c012178db93b9529b06f1e22ede
|
||||
SHA512 (v2.0.5.tar.gz) = 2e7ac2aede84671b15597d9c56dbe077a81357bbf44b6684802592246fb7729b4a5743238ddf02f6ea143b4d29872f581408135f9c1ea1ccc99dab905916d98d
|
||||
SHA512 (gdb-14.1.tar.xz) = 575e198105076fc4a88f68591aa114ab9c1196e84386a3f7b9b58fe5f30cdeed33f6a5f957b68f08c47284ec922bb60c964627e238471419673fd913575ce427
|
||||
|
Loading…
Reference in New Issue
Block a user