Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: Matthieu Longo <matthieu.longo@arm.com>
Cc: gdb-patches@sourceware.org,  Tom Tromey <tom@tromey.com>,
	 Andrew Burgess <aburgess@redhat.com>
Subject: Re: [PATCH v1] gdb: align siginfo_t with the Linux kernel definition
Date: Thu, 18 Jun 2026 16:23:24 +0000	[thread overview]
Message-ID: <87wlvv6cn7.fsf@linaro.org> (raw)
In-Reply-To: <5e489d6c-199d-4e0d-921a-0ed0164a6f1e@arm.com> (Matthieu Longo's message of "Thu, 18 Jun 2026 15:02:22 +0100")

Matthieu Longo <matthieu.longo@arm.com> writes:

> On 18/06/2026 04:02, Thiago Jung Bauermann wrote:
>> Matthieu Longo <matthieu.longo@arm.com> writes:
>> 
>>> On 17/06/2026 07:07, Thiago Jung Bauermann wrote:
>>>> compat_siginfo_t is used when the inferior is an AArch32 process while
>>>> GDB is AArch64. This will cause the 64-bit kernel to use the syscall
>>>> compatibility layer — and thus the 32-bit definition of siginfo_t —
>>>> which GDB's compat_siginfo_t aims to represent.
>>>
>>> I imagined that compat_siginfo_t was also used in the case when the inferior is an
>>> AArch64
>>> process, while GDB is AArch32.
>>> Hence ...
>> 
>> Ah, ok. This isn't supported, at least in the Arm port. I think GDB in
>> general doesn't support 32-bit GDB debugging 64-bit inferior, but I
>> could be wrong. It's certainly not well tested though. :)
>> 
>>>>> However, I am confused by the definition of compat_siginfo_t in gdb/nat/aarch64-linux.h
>>>>> for instance. I see that addresses like _sigfaul._addr are converted to 'unsigned int'
>>>>> (that should be equivalent to uint32_t I guess). Why is this working ?
>>>>>
>>>>> Please, could you provide explanations on the above, and guidances on the changes
>>>>> required
>>>>> in struct compat_siginfo_t ?
>>>> I'm not sure I understand why it wouldn't work. In the example of
>>>> _sigfault._addr, it is an unsigned int (equivalent to uint32_t as you
>>>> point out) so it will match the width of the void * used for the
>>>> corresponding void * field in 32-bit userspace. This is converted to
>>>> siginfo_t's 64-bit void * in aarch64_siginfo_from_compat_siginfo with:
>>>>     to->si_addr = (void *) (intptr_t) from->cpt_si_addr;
>>>> Do you see a problem in this process?
>>>
>>> my surprise when I say the definition of _sigfault._addr as a uint32_t. This would not
>>> have worked in my understanding.
>>
>> Yes, indeed in that case it wouldn't work.
>
> If the feature that requires new fields in siginfo_t, is only available AArch64 only,
> there should not be any reason to change aarch64_siginfo_from_compat_siginfo and
> aarch64_compat_siginfo_from_siginfo. Is this correct ?

Yes, that is correct. compact_siginfo_t only needs to reflect the
siginfo_t that the Linux kernel passes to AArch32 processes.

> If so, then the current patch is complete and ready to be reviewed.

Ok, I will start reviewing it today.

-- 
Thiago
(he/him)

  reply	other threads:[~2026-06-18 16:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-12 10:16 Matthieu Longo
2026-06-12 10:42 ` Matthieu Longo
2026-06-17  6:07   ` Thiago Jung Bauermann
2026-06-17  9:11     ` Matthieu Longo
2026-06-18  3:02       ` Thiago Jung Bauermann
2026-06-18 14:02         ` Matthieu Longo
2026-06-18 16:23           ` Thiago Jung Bauermann [this message]
2026-06-19  3:58 ` Thiago Jung Bauermann
2026-06-19 10:45   ` Matthieu Longo
2026-06-22  8:42     ` Matthieu Longo
2026-06-24 21:45       ` Thiago Jung Bauermann
2026-06-25  9:55         ` Matthieu Longo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wlvv6cn7.fsf@linaro.org \
    --to=thiago.bauermann@linaro.org \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=matthieu.longo@arm.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox