qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Gustavo Romero <gustavo.romero@linaro.org>, qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org, peter.maydell@linaro.org,
	laurent@vivier.eu, philmd@linaro.org
Subject: Re: [PATCH v2 4/5] gdbstub: Add Xfer:siginfo:read stub
Date: Fri, 8 Mar 2024 14:58:29 -1000	[thread overview]
Message-ID: <bb51b489-e22e-424a-b6be-40f91f6f8875@linaro.org> (raw)
In-Reply-To: <322b8643-d595-4ce0-1f11-5e6ee1138638@linaro.org>

On 3/8/24 08:30, Gustavo Romero wrote:
> Hi Richard!
> 
> On 3/7/24 6:13 PM, Richard Henderson wrote:
>> On 3/7/24 08:26, Gustavo Romero wrote:
>>> +void gdb_handle_query_xfer_siginfo(GArray *params, void *user_ctx)
>>> +{
>>> +    unsigned long offset, len;
>>> +    uint8_t *siginfo_offset;
>>> +
>>> +    offset = get_param(params, 0)->val_ul;
>>> +    len = get_param(params, 1)->val_ul;
>>> +
>>> +    if (offset + len > sizeof(target_siginfo_t)) {
>>
>> If you save the siginfo_len from gdb_handlesig, you can place this in user.c
> Shouldn't all user-only stubs be placed in user-target.c? Like
> gdb_handle_query_xfer_auxv and gdb_handle_query_xfer_exec_file, and since
> what controls the inclusion in the build of user-target.c is CONFIG_USER_ONLY?

user.c is also build for CONFIG_USER_ONLY, except that it is compiled only once, and has 
no target-specific code in it.

>> Is it really correct to reject (offset == 0) + (len == large), rather than truncate len?
> 
> I think this is correct. GDB mentions briefly that an invalid offset
> should be treated as an error. Thus, I think that a valid offset but
> a non-existing/invalid (large) length should be treated the same,
> cause in the end data on invalid offsets are being requested anyways.

Ok.


r~


  reply	other threads:[~2024-03-09  0:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 18:26 [PATCH v2 1/5] gdbstub: Rename back gdb_handlesig Gustavo Romero
2024-03-07 18:26 ` [PATCH v2 2/5] linux-user: Move tswap_siginfo out of target code Gustavo Romero
2024-03-07 19:21   ` Alex Bennée
2024-03-07 20:47     ` Richard Henderson
2024-03-07 20:44   ` Richard Henderson
2024-03-07 18:26 ` [PATCH v2 3/5] gdbstub: Save target's siginfo Gustavo Romero
2024-03-07 21:09   ` Richard Henderson
2024-03-07 22:33     ` Alex Bennée
2024-03-08 17:01       ` Gustavo Romero
2024-03-08 19:25         ` Alex Bennée
2024-03-09  0:41           ` Richard Henderson
2024-03-09 11:43             ` Alex Bennée
2024-03-08 20:24     ` Gustavo Romero
2024-03-07 18:26 ` [PATCH v2 4/5] gdbstub: Add Xfer:siginfo:read stub Gustavo Romero
2024-03-07 21:13   ` Richard Henderson
2024-03-08 18:30     ` Gustavo Romero
2024-03-09  0:58       ` Richard Henderson [this message]
2024-03-07 18:26 ` [PATCH v2 5/5] tests/tcg: Add multiarch test for " Gustavo Romero
2024-03-07 21:16   ` Richard Henderson
2024-03-07 19:14 ` [PATCH v2 1/5] gdbstub: Rename back gdb_handlesig Alex Bennée
2024-03-07 20:43 ` Richard Henderson

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=bb51b489-e22e-424a-b6be-40f91f6f8875@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=gustavo.romero@linaro.org \
    --cc=laurent@vivier.eu \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).