This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 06/25] Generate c for feature instead of tdesc


(this is not a full review)

On 06/12/2017 09:41 AM, Yao Qi wrote:
> +$(FEATURE_CFILES): %.c: %.xml.tmp
> +	$(GDB) -nx -q -batch \
> +	  -ex 'maint print c-tdesc $<' > $@.tmp
> +	sh ../../move-if-change $@.tmp $@
> +	rm $<
> +
> +%.xml.tmp: %.xml
> +	echo "<?xml version=\"1.0\"?>" > $@
> +	echo "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">" >> $@
> +	echo "<target>" >> $@
> +	echo "  <architecture>" >> $@
> +	if test $(findstring i386/32bit-,$@); then echo "i386" >> $@ ; fi;
> +	echo "  </architecture>" >> $@
> +	echo "  <xi:include href=\"$(notdir $<)\"/>" >> $@
> +	echo "</target>" >> $@
> +

Don't we need move-if-change here?

The findstring bits warrants a comment.

> +/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
> +  Original: 32bit-avx512.xml.tmp */

I don't think we should be pointing "Original" at a 
temporary file that does not exist in the repo?

On 06/12/2017 09:41 AM, Yao Qi wrote:
> -  print_c_tdesc v (filename_after_features);
> +  if (strncmp (filename_after_features.c_str(), "i386/32bit-", 11) == 0)

startswith

But again, this looks like needs at least a comment.  I'd
like to see an expanded rationale for this.  It's not
immediately obvious why/what's this special casing for.

> +    {
> +      print_c_feature v (filename_after_features);
> +
> +      tdesc->accept (v);
> +    }
> +  else
> +    {
> +      print_c_tdesc v (filename_after_features);
>  
> -  tdesc->accept (v);
> +      tdesc->accept (v);
> +    }


Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]