qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/5] gdbstub: Add Xfer:siginfo:read stub


From: Richard Henderson
Subject: Re: [PATCH v2 4/5] gdbstub: Add Xfer:siginfo:read stub
Date: Fri, 8 Mar 2024 14:58:29 -1000
User-agent: Mozilla Thunderbird

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 via email to

[Prev in Thread] Current Thread [Next in Thread]