From: "Alex Bennée" <alex.bennee@linaro.org>
To: Gustavo Romero <gustavo.romero@linaro.org>
Cc: Richard Henderson <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, peter.maydell@linaro.org,
laurent@vivier.eu, philmd@linaro.org
Subject: Re: [PATCH v2 3/5] gdbstub: Save target's siginfo
Date: Fri, 08 Mar 2024 19:25:29 +0000 [thread overview]
Message-ID: <87h6hgttjq.fsf@draig.linaro.org> (raw)
In-Reply-To: <9fea440d-f0c5-0a7c-a60e-b75e4dcf73c3@linaro.org> (Gustavo Romero's message of "Fri, 8 Mar 2024 14:01:21 -0300")
Gustavo Romero <gustavo.romero@linaro.org> writes:
> Hi Alex,
>
> On 3/7/24 7:33 PM, Alex Bennée wrote:
>> Richard Henderson <richard.henderson@linaro.org> writes:
>>
>>> On 3/7/24 08:26, Gustavo Romero wrote:
>>>> Save target's siginfo into gdbserver_state so it can be used later, for
>>>> example, in any stub that requires the target's si_signo and si_code.
>>>> This change affects only linux-user mode.
>>>> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
>>>> Suggested-by: Richard Henderson <richard.henderson@linaro.org>
>>>> ---
>>>> gdbstub/internals.h | 3 +++
>>>> gdbstub/user-target.c | 3 ++-
>>>> gdbstub/user.c | 14 ++++++++++----
>>>> include/gdbstub/user.h | 6 +++++-
>>>> linux-user/main.c | 2 +-
>>>> linux-user/signal.c | 5 ++++-
>>>> 6 files changed, 25 insertions(+), 8 deletions(-)
>>>> diff --git a/gdbstub/internals.h b/gdbstub/internals.h
>>>> index 56b7c13b75..a7cc69dab3 100644
>>>> --- a/gdbstub/internals.h
>>>> +++ b/gdbstub/internals.h
>>>> @@ -58,6 +58,9 @@ typedef struct GDBState {
>>>> int line_csum; /* checksum at the end of the packet */
>>>> GByteArray *last_packet;
>>>> int signal;
>>>> +#ifdef CONFIG_USER_ONLY
>>>> + uint8_t siginfo[MAX_SIGINFO_LENGTH];
>>>> +#endif
>>>
>>> If we this in GDBUserState in user.c -- no need for ifdefs then.
>> Although it does break on FreeBSD's user target:
>> FAILED: libqemu-arm-bsd-user.fa.p/gdbstub_user-target.c.o
>> cc -m64 -mcx16 -Ilibqemu-arm-bsd-user.fa.p -I. -I.. -Itarget/arm -I../target/arm -I../common-user/host/x86_64 -I../bsd-user/include -Ibsd-user/freebsd -I../bsd-user/freebsd -I../bsd-user/host/x86_64 -Ibsd-user -I../bsd-user -I../bsd-user/arm -Iqapi -Itrace -Iui -Iui/shader -I/usr/local/include/capstone -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -fdiagnostics-color=auto -Wall -Winvalid-pch -Werror -std=gnu11 -O2 -g -fstack-protector-strong -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wformat-security -Wformat-y2k -Wignored-qualifiers -Winit-self -Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wstrict-prototypes -Wtype-limits -Wundef -Wvla -Wwrite-strings -Wno-gnu-variable-sized-type-not-at-end -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-psabi -Wno-shift-negative-value -Wno-string-plus-int -Wno-tautological-type-limit-compare -Wno-typedef-redefinition -Wthread-safety -iquote . -iquote /tmp/cirrus-ci-build -iquote /tmp/cirrus-ci-build/include -iquote /tmp/cirrus-ci-build/host/include/x86_64 -iquote /tmp/cirrus-ci-build/host/include/generic -iquote /tmp/cirrus-ci-build/tcg/i386 -pthread -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero -fPIE -DNEED_CPU_H '-DCONFIG_TARGET="arm-bsd-user-config-target.h"' '-DCONFIG_DEVICES="arm-bsd-user-config-devices.h"' -MD -MQ libqemu-arm-bsd-user.fa.p/gdbstub_user-target.c.o -MF libqemu-arm-bsd-user.fa.p/gdbstub_user-target.c.o.d -o libqemu-arm-bsd-user.fa.p/gdbstub_user-target.c.o -c ../gdbstub/user-target.c
>> In file included from ../gdbstub/user-target.c:18:
>> ../gdbstub/internals.h:62:21: error: use of undeclared identifier 'MAX_SIGINFO_LENGTH'
>> 62 | uint8_t siginfo[MAX_SIGINFO_LENGTH];
>> | ^
>> 1 error generated.
>> [2084/6731] Compiling C object libqemu-arm
>> See: https://gitlab.com/stsquad/qemu/-/jobs/6345829419
>
> argh, I've tested all targets for linux-user, but missed bsd-user. I've tried
> once to build it but that requires a BSD-like host, which I don't have at the
> moment, then I forgot about it... Let me setup one and review the change in
> the light of the comments from you and Richard.
make vm-build-[open|net|free]bsd
see make vm-help for details.
>
> Thanks!
>
>
> Cheers,
> Gustavo
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2024-03-08 19:26 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 [this message]
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
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=87h6hgttjq.fsf@draig.linaro.org \
--to=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 \
--cc=richard.henderson@linaro.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).