From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4c36BnzzmmoI1SgAWB0awg (envelope-from ) for ; Fri, 04 Sep 2026 12:36:12 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eCGaba/Y; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 117351E166; Fri, 04 Sep 2026 12:36:12 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id AC8611E033 for ; Fri, 04 Sep 2026 12:36:10 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D04974BB3BF8 for ; Fri, 4 Sep 2026 16:36:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D04974BB3BF8 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eCGaba/Y Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 02F104BB3BB6 for ; Fri, 4 Sep 2026 16:35:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 02F104BB3BB6 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 02F104BB3BB6 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788539741; cv=none; b=Iuh4sakN7nmrLGiWxw3yZwifsotPM5V4MAoJfrDiQfjbKQjoCQBXfhmtwVO1O+1V6DGbCmqTy6cFKLqmJCggPesM1PxqLbQDRNNK6aOa8Z5qIRB4e37rLG0hiUxBj/qkoTrAHEXbsOiZAhhwIsxHEfTbI0VIWj2qJbhDMK7gEsI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788539741; c=relaxed/simple; bh=ABYK9DmNY0GhWgp/mWGwwOEn5Is1xqbdXMiBY1x4Pkw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dsEdEh+DAoDgXgUiyXiRadXYRqNlgF1MVvkl2n8BLXSEmFeLdVlZCTrYjwfknt9n6Q7Q/M5sDLnMH4EjrG4XcUwbbaXA0Ujsv5uFKWERZRF+Giz0IhrtexDNTz4WECyWdrYERkdOwSHIZyHmTa58A3S5Sx7Q4c5vKAydJprRje8= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eCGaba/Y DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02F104BB3BB6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788539740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KgdlLBZJcDidlzx3bT+mjTNKqLL1Uqb9ABGlEXWl4+U=; b=eCGaba/YE3W4WXRyyNfRIEoMlssq8Npit1j52AayTeIl146tsfPqNkKFvJ4K3M6jnv5AFE 5u5VzAMixX4ZTtgj2LeB8rAAgUyJDM6TdNrbnP8nyWvjt6amDOnKZ/1r41Fwd9kMhDEQWz oUFj65JjiXX7/Seq/vDnvp0MhXZgtb4= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-j_9lEHnuN36a0uA_xz-NBw-1; Fri, 04 Sep 2026 12:35:39 -0400 X-MC-Unique: j_9lEHnuN36a0uA_xz-NBw-1 X-Mimecast-MFC-AGG-ID: j_9lEHnuN36a0uA_xz-NBw_1788539738 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-48439eea716so870348f8f.2 for ; Fri, 04 Sep 2026 09:35:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788539738; x=1789144538; h=content-transfer-encoding:content-type:mime-version:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=MupDP9q8md93jxGzWGzF2SQC2ZE2RSZtK5JzwZgOGOc=; b=DuGVJTcxFhrcQWVKSicxXFvqUH9wJTHLqjR85lR7dx3YSRFkrA6eZroOa27ygbWBxs a0404npQ5w+P62YD6erXcyo94+SvcgSMu+W9nFHAqiMugENDP7d1er7fFK9mM3hHbv3n eeVqF9YMwHfBJJCu8bGXGFQ577o/LIB14uXlixcOdBNgv7DHallz0E7jyHxFrqnwylEK EA63H81Vt80/zks9+5G9sBfCpfX9yX8c7G37i/w8Dbf8b3AUuSU+lkJmxKJT4wZ1tH5v Xiaj/RytnVB2bpIO4hJP66PBkMaYlfXiG5XRhWa3rraCxEzUGyBrY7J3A9UGnLfA5Dwi 2DXg== X-Forwarded-Encrypted: i=1; AKwUvBwoc2vAD/S/vMNlksiHR5DiA+q6I9WUtpMLICVZSTmalgIzZR2DSdxYy5IgE+Z68//ZsWfe10upXqENgQ==@sourceware.org X-Gm-Message-State: AFuF++k0Icx330zDZm6sQbe4W2/4DpLFjUGUCedEV1tYcmkuN0VpRi/g ckiHVl1WLh/iWisCiTgrHE9vr7p8zAsioCiZdza4EPuTDglMOTUUz79Hd4T0GAdANDH9luhdzFT rga3QyThwCzY4aifaFPcQT3gIFArtfqNr9Ltd3C+aCK+Ig+TFZSPI/AjPueDGJUxHQx4b0Fc= X-Gm-Gg: AYBFou3iAKkp1dxEqjBP69uaEsO4l8MYbE5bHYqNzS65Mw13iJjZXaVB5y12sGGBP2I b2nz+BLnFf6yg4p/q2hUBs7ZG4iOp5VK1xMJ1yimrFpQLQ3CMJk3kjQEolYl4+TVcdtSQIr8a97 Dtf01hcEuB9jaKCUwoKqCbIS2X4TB4xZnFiLFxp3O2INe0JLPFJr0JN3D8uGWYTKRSePZmsHjiF jwSqspbXkM+dE0/iGvoukUd8pFysAj3UCtQrcM2BHXM07qiUc+LiYPoYkWts1G/uZc8G5ZfBv5k wXoUMqgxD0liiV9Mn1d7GaSfCFvSXJ9EYd9ri5LFUM5niNvrdk0kDx3s+QwG8DDK+gdIHLMjY6K W5uOSgvi0LnwsW2ZxCPU71liUrQE= X-Received: by 2002:adf:fa81:0:b0:484:3317:a19 with SMTP id ffacd0b85a97d-485872b896dmr8496075f8f.26.1788539737902; Fri, 04 Sep 2026 09:35:37 -0700 (PDT) X-Received: by 2002:adf:fa81:0:b0:484:3317:a19 with SMTP id ffacd0b85a97d-485872b896dmr8496029f8f.26.1788539737325; Fri, 04 Sep 2026 09:35:37 -0700 (PDT) Received: from localhost (128.223.159.143.dyn.plus.net. [143.159.223.128]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-485883a9a56sm6249023f8f.15.2026.09.04.09.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2026 09:35:34 -0700 (PDT) From: Andrew Burgess To: Matthieu Longo , gdb-patches@sourceware.org Cc: Luis Machado , Luis Machado , Thiago Jung Bauermann , Srinath Parvathaneni , "Maciej W . Rozycki" , Andreas Schwab , Matthieu Longo Subject: Re: [PATCH v5] gdb: align siginfo_t with the Linux kernel definition In-Reply-To: <20260728123239.211813-1-matthieu.longo@arm.com> References: <20260728123239.211813-1-matthieu.longo@arm.com> Date: Fri, 04 Sep 2026 17:35:33 +0100 Message-ID: <8733vprn3e.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: R9Xbiex6DBEhkuU2boWY8b0DaEgonWNg1EoFzYDDJ34_1788539738 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Matthieu Longo writes: > GDB's current definition of siginfo_t is missing many fields present in > the Linux kernel definition [1]. > > These fields are useful for providing detailed, user-friendly diagnostics > when a fault occurs. Some new AArch64 extensions, such as Permission > Overlay Enhancement used to implement Protection Keys [2], require the > debugger to inspect 'si_pkey' alongside 'si_addr' to help the user identi= fy > the problematic key. > > This patch aligns GDB's definition of the __sifields._sigfault member of > siginfo_t with the definition from the Linux kernel master branch. > > To avoid hardcoding the field access paths throughout the codebase, this > patch also introduces compile-time accessors for the siginfo_t attributes= , > centralizing their definitions in a single location and making future > updates easier. > > Finally, extend the testsuite to verify access to the new si_pkey field > and its preservation when modifying $_siginfo and when reading core files= . > The tests in siginfo-obj.exp rely on the siginfo_t definition provided by > glibc's , which does not yet expose all of the fields present i= n > the kernel definition. As a result, the tests cannot exercise every newly > added field and therefore focus on si_pkey, the field motivating this cha= nge. > The test validates that GDB can read and modify the field correctly; it d= oes > not attempt to generate a real protection-key fault. Hi Matthieu, Please see this message: https://sourceware.org/pipermail/bunsen/2026q3/001504.html This is an LLM generated analysis of this patch which makes the claim that si_pkey is not accessible at the glibc level on every architecture. I tried on a couple of compiler farm boxes, but ran into some TCL version issues so wasn't able to actually make-check, but on a ppc box, if I try to compile gdb.base/siginfo-obj.c manually I get: $ gcc -o siginfo-obj siginfo-obj.c siginfo-obj.c: In function =E2=80=98handler=E2=80=99: siginfo-obj.c:38:31: error: =E2=80=98siginfo_t=E2=80=99 has no member nam= ed =E2=80=98si_pkey=E2=80=99 unsigned int ssi_pkey =3D info->si_pkey; ^ This test file did compile before commit 9c99987237dcaca0c6c493d6a. It would be great if you could take a look at this. Should the si_pkey parts of the test be optional maybe? Thanks, Andrew > > [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ > tree/include/uapi/asm-generic/siginfo.h#n69 > [2]: https://lore.kernel.org/all/20160212210213.ABC488FA@viggo.jf.intel.c= om/ > > Reviewed-by: Thiago Jung Bauermann > --- > gdb/aarch64-linux-tdep.c | 8 ++-- > gdb/linux-tdep.c | 52 +++++++++++++++++++--- > gdb/linux-tdep.h | 60 ++++++++++++++++++++++++++ > gdb/sparc64-linux-tdep.c | 6 ++- > gdb/testsuite/gdb.base/siginfo-obj.c | 1 + > gdb/testsuite/gdb.base/siginfo-obj.exp | 14 ++++++ > 6 files changed, 131 insertions(+), 10 deletions(-) > > diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c > index f11eccc1bc1..235b35bcfb4 100644 > --- a/gdb/aarch64-linux-tdep.c > +++ b/gdb/aarch64-linux-tdep.c > @@ -2683,13 +2683,15 @@ aarch64_linux_report_signal_info (struct gdbarch = *gdbarch, > =20 > try > { > + using gdb_si =3D gdb::siginfo_type; > + using si_key =3D gdb::siginfo_type::key; > /* Sigcode tells us if the segfault is actually a memory tag > =09 violation. */ > - si_code =3D parse_and_eval_long ("$_siginfo.si_code"); > - si_errno =3D parse_and_eval_long ("$_siginfo.si_errno"); > + si_code =3D parse_and_eval_long (gdb_si::get (si_key::siginfo_code= )); > + si_errno =3D parse_and_eval_long (gdb_si::get (si_key::siginfo_err= no)); > =20 > fault_addr > -=09=3D parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr"); > +=09=3D parse_and_eval_long (gdb_si::get (si_key::siginfo_addr)); > } > catch (const gdb_exception_error &exception) > { > diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c > index 25d625db595..740043a9292 100644 > --- a/gdb/linux-tdep.c > +++ b/gdb/linux-tdep.c > @@ -272,10 +272,9 @@ static struct type * > linux_get_siginfo_type (struct gdbarch *gdbarch) > { > struct linux_gdbarch_data *linux_gdbarch_data; > - struct type *void_ptr_type; > struct type *uid_type, *pid_type; > struct type *sigval_type, *clock_type; > - struct type *siginfo_type, *sifields_type; > + struct type *siginfo_type, *sifields_type, *sigfault_union_type; > struct type *type; > =20 > linux_gdbarch_data =3D get_linux_gdbarch_data (gdbarch); > @@ -285,11 +284,22 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) > type_allocator alloc (gdbarch); > =20 > const struct builtin_type *builtin_types =3D builtin_type (gdbarch); > + struct type *short_type =3D builtin_types->builtin_short; > struct type *int_type =3D builtin_types->builtin_int; > struct type *uint_type =3D builtin_types->builtin_unsigned_int; > struct type *long_type =3D builtin_types->builtin_long; > - > - void_ptr_type =3D lookup_pointer_type (builtin_type (gdbarch)->builtin= _void); > + struct type *unsigned_long_type =3D builtin_types->builtin_unsigned_lo= ng; > + struct type *uint32_type =3D builtin_types->builtin_uint32; > + struct type *void_ptr_type > + =3D lookup_pointer_type (builtin_type (gdbarch)->builtin_void); > + > + /* Compute padding length, i.e. __ADDR_BND_PKEY_PAD. */ > + unsigned alignof_void_ptr =3D type_align (void_ptr_type); > + unsigned padding_size =3D (alignof_void_ptr < short_type->length () > +=09=09=09 ? short_type->length () > +=09=09=09 : alignof_void_ptr); > + struct type *addr_bnd_pkey_padding_type > + =3D init_vector_type (builtin_types->builtin_uint8, padding_size); > =20 > /* sival_t */ > sigval_type =3D arch_composite_type (gdbarch, NULL, TYPE_CODE_UNION); > @@ -364,9 +374,41 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) > append_composite_type_field (type, "si_stime", clock_type); > append_composite_type_field (sifields_type, "_sigchld", type); > =20 > - /* _sigfault */ > + /* Begin _sigfault's anonymous union. */ > + sigfault_union_type =3D arch_composite_type (gdbarch, NULL, TYPE_CODE_= UNION); > + /* used on alpha and sparc */ > + append_composite_type_field (sigfault_union_type, "si_trapno", int_typ= e); > + /* used when si_code is BUS_MCEERR_AR or BUS_MCEERR_AO. */ > + append_composite_type_field (sigfault_union_type, "si_addr_lsb", short= _type); > + > + /* used when si_code=3DSEGV_BNDERR */ > + type =3D arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); > + append_composite_type_field (type, "_dummy_bnd", addr_bnd_pkey_padding= _type); > + append_composite_type_field (type, "si_lower", void_ptr_type); > + append_composite_type_field (type, "si_upper", void_ptr_type); > + append_composite_type_field (sigfault_union_type, "_addr_bnd", type); > + > + /* used when si_code=3DSEGV_PKUERR */ > + type =3D arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); > + append_composite_type_field (type, "_dummy_pkey", addr_bnd_pkey_paddin= g_type); > + append_composite_type_field (type, "si_pkey", uint32_type); > + append_composite_type_field (sigfault_union_type, "_addr_pkey", type); > + > + /* used when si_code=3DTRAP_PERF */ > + type =3D arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); > + append_composite_type_field (type, "si_perf_data", unsigned_long_type)= ; > + append_composite_type_field (type, "si_perf_type", uint32_type); > + append_composite_type_field (type, "si_perf_flags", uint32_type); > + append_composite_type_field (sigfault_union_type, "_perf", type); > + > + /* End _sigfault's anonymous union. */ > + > + /* _sigfault is set by SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEM= T */ > type =3D arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); > append_composite_type_field (type, "si_addr", void_ptr_type); > + /* Since there is no possibility to declare an anonymous union, > + using '_anon_union' instead. */ > + append_composite_type_field (type, "_anon_union", sigfault_union_type)= ; > append_composite_type_field (sifields_type, "_sigfault", type); > =20 > /* _sigpoll */ > diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h > index c19839fde2c..43ed38c6633 100644 > --- a/gdb/linux-tdep.h > +++ b/gdb/linux-tdep.h > @@ -98,4 +98,64 @@ extern CORE_ADDR linux_get_hwcap2 (); > extern bool linux_address_in_shadow_stack_mem_range > (CORE_ADDR addr, std::pair *range); > =20 > +namespace gdb { > + > +/* Maps each siginfo_type::key to the corresponding field-access express= ion > + in $_siginfo. > + > + Keep the order of key values synchronized with the entries in get()'s > + paths array. Each key is used directly as an array index. */ > + > +struct siginfo_type > +{ > + /* Identifies a field within siginfo_t that may be referenced by name.= */ > + enum class key > + { > + siginfo_signo =3D 0, > + siginfo_errno, > + siginfo_code, > + > + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */ > + siginfo_addr, > + siginfo_trapno, > + siginfo_addr_lsb, > + siginfo_lower, > + siginfo_upper, > + siginfo_pkey, > + siginfo_perf_data, > + siginfo_perf_type, > + siginfo_perf_flags, > + > + /* Sentinel used to determine the number of mapped fields. */ > + SIGINFO_ATTR_END > + }; > + > + /* Return the $_siginfo access expression associated with ATTR_. > + > + ATTR_ must be a valid si_* key other than SIGINFO_ATTR_END. The ar= ray > + order must exactly match the declaration order of the keys above. = */ > + static constexpr const char *get (key attr_) > + { > + const char *paths[static_cast (key::SIGINFO_ATTR_END)] =3D { > + "$_siginfo.si_signo", > + "$_siginfo.si_errno", > + "$_siginfo.si_code", > + > + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */ > + "$_siginfo._sifields._sigfault.si_addr", > + "$_siginfo._sifields._sigfault._anon_union.si_trapno", > + "$_siginfo._sifields._sigfault._anon_union.si_addr_lsb", > + "$_siginfo._sifields._sigfault._anon_union._addr_bnd.si_lower", > + "$_siginfo._sifields._sigfault._anon_union._addr_bnd.si_upper", > + "$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pkey", > + "$_siginfo._sifields._sigfault._anon_union._perf.si_perf_data", > + "$_siginfo._sifields._sigfault._anon_union._perf.si_perf_type", > + "$_siginfo._sifields._sigfault._anon_union._perf.si_perf_flags", > + }; > + return paths[static_cast (attr_)]; > + } > +}; > + > +} /* namespace gdb */ > + > #endif /* GDB_LINUX_TDEP_H */ > diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c > index cb7ce41e5cb..b6245f64bae 100644 > --- a/gdb/sparc64-linux-tdep.c > +++ b/gdb/sparc64-linux-tdep.c > @@ -134,11 +134,13 @@ sparc64_linux_report_signal_info (struct gdbarch *g= dbarch, struct ui_out *uiout, > =20 > try > { > + using gdb_si =3D gdb::siginfo_type; > + using si_key =3D gdb::siginfo_type::key; > /* Evaluate si_code to see if the segfault is ADI related. */ > - si_code =3D parse_and_eval_long ("$_siginfo.si_code\n"); > + si_code =3D parse_and_eval_long (gdb_si::get (si_key::siginfo_code= )); > =20 > if (si_code >=3D SEGV_ACCADI && si_code <=3D SEGV_ADIPERR) > -=09addr =3D parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr"= ); > +=09addr =3D parse_and_eval_long (gdb_si::get (si_key::siginfo_addr)); > } > catch (const gdb_exception_error &exception) > { > diff --git a/gdb/testsuite/gdb.base/siginfo-obj.c b/gdb/testsuite/gdb.bas= e/siginfo-obj.c > index 43dc979bc50..960e5b8e9cd 100644 > --- a/gdb/testsuite/gdb.base/siginfo-obj.c > +++ b/gdb/testsuite/gdb.base/siginfo-obj.c > @@ -35,6 +35,7 @@ handler (int sig, siginfo_t *info, void *context) > int ssi_signo =3D info->si_signo; > int ssi_code =3D info->si_code; > void *ssi_addr =3D info->si_addr; > + unsigned int ssi_pkey =3D info->si_pkey; > =20 > _exit (0); /* set breakpoint here */ > } > diff --git a/gdb/testsuite/gdb.base/siginfo-obj.exp b/gdb/testsuite/gdb.b= ase/siginfo-obj.exp > index a94bf0e33ba..5e36b334068 100644 > --- a/gdb/testsuite/gdb.base/siginfo-obj.exp > +++ b/gdb/testsuite/gdb.base/siginfo-obj.exp > @@ -78,6 +78,14 @@ gdb_test_multiple "p \$_siginfo" "$test" { > } > } > =20 > +set test "extract si_pkey" > +gdb_test_multiple "p \$_siginfo" "$test" { > + -re "si_pkey =3D (\[0-9\]\+).*$gdb_prompt $" { > +=09set ssi_pkey $expect_out(1,string) > +=09pass "$test" > + } > +} > + > set bp_location [gdb_get_line_number "set breakpoint here"] > =20 > with_test_prefix "validate siginfo fields" { > @@ -87,6 +95,7 @@ with_test_prefix "validate siginfo fields" { > gdb_test "p ssi_errno" " =3D $ssi_errno" > gdb_test "p ssi_code" " =3D $ssi_code" > gdb_test "p ssi_signo" " =3D $ssi_signo" > + gdb_test "p ssi_pkey" " =3D $ssi_pkey" > } > =20 > # Again, but this time, patch si_addr and check that the inferior sees > @@ -106,6 +115,7 @@ gdb_test "p \$_siginfo._sifields._sigfault.si_addr = =3D 0x666" " =3D \\(void \\*\\) 0 > gdb_test "p \$_siginfo.si_errno =3D 666" " =3D 666" > gdb_test "p \$_siginfo.si_code =3D 999" " =3D 999" > gdb_test "p \$_siginfo.si_signo =3D 11" " =3D 11" > +gdb_test "p \$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pke= y =3D 123" " =3D 123" > =20 > with_test_prefix "validate modified siginfo fields" { > gdb_test "break $bp_location" > @@ -114,6 +124,7 @@ with_test_prefix "validate modified siginfo fields" { > gdb_test "p ssi_errno" " =3D 666" > gdb_test "p ssi_code" " =3D 999" > gdb_test "p ssi_signo" " =3D 11" > + gdb_test "p ssi_pkey" " =3D 123" > } > =20 > # Test siginfo preservation in core files. > @@ -132,4 +143,7 @@ if {$gcore_created} { > gdb_test "p \$_siginfo._sifields._sigfault.si_addr" \ > =09" =3D \\(void \\*\\) $ssi_addr" \ > =09"p \$_siginfo._sifields._sigfault.si_addr from core file" > + gdb_test "p \$_siginfo._sifields._sigfault._anon_union._addr_pkey.si= _pkey" \ > +=09" =3D $ssi_pkey" \ > +=09"p \$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pkey from= core file" > } > --=20 > 2.55.0