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] Fix display of structures/bitfields in register description.


>>>>> "Walfred" == Walfred Tedeschi <walfred.tedeschi@intel.com> writes:

Walfred> Add support for displaying structures and bitfields for
Walfred> registers when executing the "maint print c-tdesc". Command is
Walfred> also used when converting the xml target description file into
Walfred> c file.

Thanks for the patch.

I think it looks pretty good.  I have a few notes.

Walfred> +	    case TDESC_TYPE_STRUCT:
Walfred> +	      printf_unfiltered
Walfred> +		("  type = tdesc_create_struct (feature, \"%s\");\n",

This emits code to assign to the variable "type".
But is this variable defined?
Earlier I see:

	  if (type->kind == TDESC_TYPE_UNION
	      && VEC_length (tdesc_type_field, type->u.u.fields) > 0)
	    {
	      printf_unfiltered ("  struct tdesc_type *type;\n");

... which I think is the only spot where it is defined.

If this is correct then I think changing this to also check
TDESC_TYPE_STRUCT would be appropriate.

If it isn't correct, then I'm curious to know what defines 'type' in the
output.

Walfred> +global srcdir
Walfred> +global subdir

I don't think these are needed.

Walfred> +<!-- Copyright (C) 2013 Free Software Foundation, Inc.
Walfred> +
Walfred> +     Copying and distribution of this file, with or without modification,
Walfred> +     are permitted in any medium without royalty provided the copyright
Walfred> +     notice and this notice are preserved.  -->

I think this should be the usual GPL comment.

Tom


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