This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v5 3/3] gdbserver: Add RISC-V/Linux support
- From: "Maciej W. Rozycki" <macro at wdc dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: gdb-patches at sourceware dot org, Jim Wilson <jimw at sifive dot com>, Palmer Dabbelt <palmer at dabbelt dot com>, Tom Tromey <tom at tromey dot com>, guoren at kernel dot org, lifang_xia at c-sky dot com, yunhai_shang at c-sky dot com, jiangshuai_li at c-sky dot com
- Date: Mon, 10 Feb 2020 09:01:53 +0000 (GMT)
- Subject: Re: [PATCH v5 3/3] gdbserver: Add RISC-V/Linux support
- Ironport-sdr: dEiIHY6Sbvvrrvrow0N7itHbyKaCgZVi4KAFxYDMDdipWoiaMUL6OOZVT9P2rHqsSc+59gds9S M+D3FdALRzRQxVh77P8D5MLMH9MlD5xhXEEYgsOLDiGWXyjLXrWMn87CeoW5IUjsgr0XBxJXvx oMqMMY91CnymmijKm0sVGLi3lerUOcDa86UIIrzzq8yylZw3tRFl1y/PC5C4czN4iKbkKdRWOm p+NwQY2KKJTtVkPOgcOnKLQpZQAkloD9hEDcLWVb+XPA5pgXPFFyI4fYxWyFKwJrd4o7wo8+ZI Wgs=
- Ironport-sdr: 7ENF/VyMbgKtrrh2BaUei9a+heGC8pDastco0FwQ2DFxKOe+uQw6baFHtyjwnUfz4UZK3g1XzD FJK1/xTc+ZQ+ReTGZz/IATC9Ai+D8PZojxMnwbj0SC0UpnpH+XDNcgJ84/KsUG1t7WzC94Lr6K VXVimKqCcg2zzTDlamRpNoAbZnnPFurT0HtUiof6KxZtloo9JO+85srV/2f0W3bL1AOTlcTP8O pRcUnqiX2/0hYMc6d5JDjBoYqA/aXQ++BtTaimAvEWj+oSQnkRxoJTI0RtG+EES6wvhKMRwrKk z/Ar5pUxpMm8+uFhkud6Fb29
- Ironport-sdr: oOSPoa6+M4Ug4jOG+OrC3x0up2xDptuUme1A8nsNjr/38b1qWY539ygqWyIS7Lv6iPnc0LucWF 7TJeVDikOqvcXvVAwBnSzPt+sjFM+KmKf8xCD5lUlw+gwFnkPJFD6kJV+bMHcxaezfYryGYEZX 8zWLiLbRXRWBV6riE51ZOXUYDlMRfMwth7cL2wns6IZdrXX3IzAre9UYNv7hoF8vTpTkd5Nxmz wZ8+UpFXlxWl5wjuRbibH/o/O5FrK9Sx1wXo3aprW8o8dCOvZHfGgTzK7Rzkx2oGwXl3H5inOE nQ8=
- References: <alpine.LFD.2.21.2002011556000.14118@redsun52.ssa.fujisawa.hgst.com> <alpine.LFD.2.21.2002011603510.14118@redsun52.ssa.fujisawa.hgst.com> <20200208001707.GJ4020@embecosm.com>
- Wdcironportexception: Internal
Andrew,
> I took a look through, and I'm happy with the changes in
> gdb/gdbserver/*. But I wondered if we could try something slightly
> different for the gdb/arch/* and gdb/nat/* changes.
>
> I'll follow up to this mail with a patch that I'd like to apply before
> we apply your patch #3, it tweaks the target description lookup API
> slightly. The result is that your patch #3 would drop all changes to
> gdb/arch/ and gdb/nat/, then the riscv_arch_setup function would look
> like this:
>
> static void
> riscv_arch_setup ()
> {
> static const char *expedite_regs[] = { "sp", "pc", NULL };
>
> const riscv_gdbarch_features features
> = riscv_linux_read_features (lwpid_of (current_thread));
> target_desc *tdesc = riscv_create_target_description (features);
>
> if (!tdesc->expedite_regs)
> init_target_desc (tdesc, expedite_regs);
> current_process ()->tdesc = tdesc;
> }
>
> The feature lookup and target description fetch are now separate
> calls.
>
> The benefit of this is that GDB gets to retain the const in its API,
> while gdbserver gets a non-const API to call.
Fine with me.
> If you're happy with this approach then feel free to push both these
> patches, or let me know and I'll push them both.
Thank you for your review and rework.
We've got a mid-air collision with Tom's `gdbserver' directory structure
rearrangement however, so I had to adjust v6 2/2 accordingly and I'm
currently rerunning verification as I had to update the sources.
I'll post v7 once that has completed, which may take several hours yet.
Changes are mechanical, applying to configury/Makefile structure only, so
I'll assume your approval for this updated version with a reasonable
amount of time allowed to chime in.
NB what's the `Change-Id' included with the change descriptions of your
patches; is that needed/useful for anything or just internal bookkeeping?
Maciej