This is the mail archive of the gdb-patches@sources.redhat.com 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: ptype bug RESEND


On Tue, Dec 03, 2002 at 11:46:46PM -0500, Daniel Jacobowitz wrote:
> On Mon, Apr 29, 2002 at 12:01:56PM -0600, Stewart Brown wrote:
> > In my previous email I forgot to attach the tar file.
> > 
> > In the tar file is a README file that pretty much explains everything.
> > 
> > Stewart Brown
> > sb24@avaya.com
> 
> Sorry about the turnaround time; this dropped through the cracks.  I
> believe your patch is correct, and it shows no regressions, so I'll
> apply it this week.  The updated version is attached.

Like many of us in the GDB community, I have a somewhat unique
perception of passing time.  It is now that "this week" later.
Patch committed, since it still makes sense and still causes no
regressions.

> 2002-12-03  Stewart Brown  <sb24@avaya.com>
> 
> 	* c-typeprint.c (c_type_print_varspec_prefix): Pass value of show
> 	in recursive calls.  Handle TYPE_CODE_TYPEDEF.
> 	(c_type_print_varspec_suffix): Likewise.
> 
> Index: c-typeprint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/c-typeprint.c,v
> retrieving revision 1.23
> diff -u -p -r1.23 c-typeprint.c
> --- c-typeprint.c	14 Oct 2002 22:58:28 -0000	1.23
> +++ c-typeprint.c	4 Dec 2002 04:30:34 -0000
> @@ -216,7 +216,7 @@ c_type_print_varspec_prefix (struct type
>    switch (TYPE_CODE (type))
>      {
>      case TYPE_CODE_PTR:
> -      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1, 1);
> +      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, show, 1, 1);
>        fprintf_filtered (stream, "*");
>        c_type_print_modifier (type, stream, 1, need_post_space);
>        break;
> @@ -224,7 +224,7 @@ c_type_print_varspec_prefix (struct type
>      case TYPE_CODE_MEMBER:
>        if (passed_a_ptr)
>  	fprintf_filtered (stream, "(");
> -      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
> +      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, show, 0, 0);
>        fprintf_filtered (stream, " ");
>        name = type_name_no_tag (TYPE_DOMAIN_TYPE (type));
>        if (name)
> @@ -237,7 +237,7 @@ c_type_print_varspec_prefix (struct type
>      case TYPE_CODE_METHOD:
>        if (passed_a_ptr)
>  	fprintf_filtered (stream, "(");
> -      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
> +      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, show, 0, 0);
>        if (passed_a_ptr)
>  	{
>  	  fprintf_filtered (stream, " ");
> @@ -247,23 +247,27 @@ c_type_print_varspec_prefix (struct type
>        break;
>  
>      case TYPE_CODE_REF:
> -      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0);
> +      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, show, 1, 0);
>        fprintf_filtered (stream, "&");
>        c_type_print_modifier (type, stream, 1, need_post_space);
>        break;
>  
>      case TYPE_CODE_FUNC:
> -      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
> +      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, show, 0, 0);
>        if (passed_a_ptr)
>  	fprintf_filtered (stream, "(");
>        break;
>  
>      case TYPE_CODE_ARRAY:
> -      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
> +      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, show, 0, 0);
>        if (passed_a_ptr)
>  	fprintf_filtered (stream, "(");
>        break;
>  
> +    case TYPE_CODE_TYPEDEF:
> +      c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, show, 0, 0);
> +      break;
> +
>      case TYPE_CODE_UNDEF:
>      case TYPE_CODE_STRUCT:
>      case TYPE_CODE_UNION:
> @@ -279,7 +283,6 @@ c_type_print_varspec_prefix (struct type
>      case TYPE_CODE_STRING:
>      case TYPE_CODE_BITSTRING:
>      case TYPE_CODE_COMPLEX:
> -    case TYPE_CODE_TYPEDEF:
>      case TYPE_CODE_TEMPLATE:
>        /* These types need no prefix.  They are listed here so that
>           gcc -Wall will reveal any types that haven't been handled.  */
> @@ -543,19 +546,22 @@ c_type_print_varspec_suffix (struct type
>  			   / TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
>        fprintf_filtered (stream, "]");
>  
> -      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
> +      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, show,
> +				   0, 0);
>        break;
>  
>      case TYPE_CODE_MEMBER:
>        if (passed_a_ptr)
>  	fprintf_filtered (stream, ")");
> -      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
> +      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, show,
> +				   0, 0);
>        break;
>  
>      case TYPE_CODE_METHOD:
>        if (passed_a_ptr)
>  	fprintf_filtered (stream, ")");
> -      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
> +      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, show,
> +				   0, 0);
>        if (passed_a_ptr)
>  	{
>  	  c_type_print_args (type, stream);
> @@ -564,7 +570,8 @@ c_type_print_varspec_suffix (struct type
>  
>      case TYPE_CODE_PTR:
>      case TYPE_CODE_REF:
> -      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0);
> +      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, show,
> +				   1, 0);
>        break;
>  
>      case TYPE_CODE_FUNC:
> @@ -592,7 +599,12 @@ c_type_print_varspec_suffix (struct type
>  	      }
>  	  fprintf_filtered (stream, ")");
>  	}
> -      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
> +      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, show,
> +				   passed_a_ptr, 0);
> +      break;
> +
> +    case TYPE_CODE_TYPEDEF:
> +      c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, show,
>  				   passed_a_ptr, 0);
>        break;
>  
> @@ -611,7 +623,6 @@ c_type_print_varspec_suffix (struct type
>      case TYPE_CODE_STRING:
>      case TYPE_CODE_BITSTRING:
>      case TYPE_CODE_COMPLEX:
> -    case TYPE_CODE_TYPEDEF:
>      case TYPE_CODE_TEMPLATE:
>        /* These types do not need a suffix.  They are listed so that
>           gcc -Wall will report types that may not have been considered.  */
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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