public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Alan Hayward <Alan.Hayward@arm.com>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>,
	 nd <nd@arm.com>
Subject: Re: [PATCH 3/6] : Update dat files with arch and osabi
Date: Mon, 22 Jan 2018 15:28:00 -0000	[thread overview]
Message-ID: <86lggpewvg.fsf@gmail.com> (raw)
In-Reply-To: <6D4AA708-D4CE-42E6-8D84-54E6B292DB0B@arm.com> (Alan Hayward's	message of "Mon, 22 Jan 2018 13:22:08 +0000")

Alan Hayward <Alan.Hayward@arm.com> writes:

> 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.

Can you elaborate how does that happen?  New style target description
doesn't use anything from -generated.c files.  Note that there is even no
-generated.c files in gdbserver build directory when gdb is in release mode
(bfd/development.sh:development is false).

>
> The segfault happens on gdbserver init because the -generated.c functions
> are calling tdesc_get_features_xml().

I still don't see why -generated.c functions call
tdesc_get_features_xml.  For new style target description, it already
generate osabi and arch (see tdesc_get_features_xml path
tdesc->xmltarget == NULL).  For old style target description, arch and
osabi is from xml file.  Take i386-avx-linux-generated.c for example,

static const char *xmltarget_i386_avx_linux = "i386-avx-linux.xml";

#ifndef IN_PROCESS_AGENT
  result->expedite_regs = expedite_regs_i386_avx_linux;
  result->xmltarget = xmltarget_i386_avx_linux;
#endif

osabi and arch is specified in features/i386/i386-avx-linux.xml,

  <architecture>i386</architecture>
  <osabi>GNU/Linux</osabi>

> 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.

If by "the generated target descriptions", you mean *-generated.c files
in gdbserver build directory, yes, they don't have osabi and arch.  As I
said above, arch and osabi, if any, are specified in the xml files.

-- 
Yao (齐尧)

  reply	other threads:[~2018-01-22 15:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16  9:52 [PATCH 0/6] : Remove XML files from gdbserver Alan Hayward
2018-01-16  9:51 ` [PATCH 1/6] : Commonise various target-descriptions.c functions Alan Hayward
2018-01-16 14:18   ` Alan Hayward
2018-01-19 23:05   ` Yao Qi
2018-01-22 14:06     ` Alan Hayward
2018-01-22 15:47       ` Yao Qi
2018-01-16  9:52 ` [PATCH 2/6]: gdbserver use common tdesc functions Alan Hayward
2018-01-16  9:53 ` [PATCH 3/6] : Update dat files with arch and osabi Alan Hayward
2018-01-19 22:01   ` Yao Qi
2018-01-22 13:22     ` Alan Hayward
2018-01-22 15:28       ` Yao Qi [this message]
2018-01-16  9:55 ` [PATCH 5/6] : Remove xml file references from target descriptions Alan Hayward
2018-01-16  9:55 ` [PATCH 4/6]: Create xml " Alan Hayward
2018-01-16  9:55 ` [PATCH 6/6]: Remove xml files from gdbserver Alan Hayward
2018-01-19 22:11   ` Yao Qi
2018-01-22 13:23     ` Alan Hayward
2018-01-22 14:52       ` Yao Qi

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=86lggpewvg.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=Alan.Hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).