This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/6] : Update dat files with arch and osabi
- From: Alan Hayward <Alan dot Hayward at arm dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Mon, 22 Jan 2018 13:22:08 +0000
- Subject: Re: [PATCH 3/6] : Update dat files with arch and osabi
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan dot Hayward at arm dot com;
- Nodisclaimer: True
- References: <EAA396DF-9E34-45B9-A3B1-EC7FB294ADDE@arm.com> <737CEA28-7C3E-4A3C-AE7C-C0139A84FAC8@arm.com> <CAH=s-PMSHD2zYqN2ZgQBzNiVOg2=h_OreO4et054=PGTqRg1_w@mail.gmail.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
> On 19 Jan 2018, at 22:01, Yao Qi <qiyaoltc@gmail.com> wrote:
>
> On Tue, Jan 16, 2018 at 9:52 AM, Alan Hayward <Alan.Hayward@arm.com> wrote:
>> This patch simply ensures the osabi and arch fields exist in the dat
>> files. Otherwise, they will be missing in later patches when gdbserver
>> converts target descriptions to xml.
>
> I don't think we need to change *.dat. *.dat are used to generate *.c files
> in gdbserver build directory for the following two reasons,
>
> - the port isn't converted to new style flexible target descriptions yet,
> - or the generated *.c files are used for test,
>
> The goal of this series, IMO, is to get rid of the xml features for the ports
> which already use new style flexible target descriptions, like x86
> and aarch64.
>
> For the old style target description, they still use xml files for each
> description, and osabi/arch is written in these xml files.
>
If you remove this patch, but keep all the rest of the series, then the ports
using the new style target descriptions will segfault when printing the xml
in print_xml_feature::visit_pre() because the -generated.c files do not
contain an arch or osabi.
The segfault happens on gdbserver init because the -generated.c functions
are calling tdesc_get_features_xml().
Thinking about it, I will remove this call from -generated.
That fixes the bug.
This leaves a question:
Is it required that the generated target descriptions have the osabi and arch?
If it does not need this information, then I will delete this patch.
Alan.