public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Ijaz, Abdul B" <abdul.b.ijaz@intel.com>
To: Tom Tromey <tom@tromey.com>,
	Abdul Basit Ijaz via Gdb-patches <gdb-patches@sourceware.org>
Cc: "simark@simark.ca" <simark@simark.ca>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v3 2/4] gdb, types: Resolve pointer types dynamically
Date: Wed, 3 Jan 2024 21:31:15 +0000	[thread overview]
Message-ID: <SA1PR11MB6846AD8406044959D0C8CDD1CB60A@SA1PR11MB6846.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87ttqytfzk.fsf@tromey.com>

Hi Tom,

Thanks a lot for the feedback.

>> -  /* We only want to recognize references at the outermost level.  */
>> -  if (top_level && type->code () == TYPE_CODE_REF)
>> +  /* We only want to recognize references and pointers at the outermost
>> +     level.  */
>> +  if (top_level
>> +      && (type->code () == TYPE_CODE_REF || type->code () == 
>> + TYPE_CODE_PTR))

Tom > Pre-existing but I wonder why this code checks TYPE_CODE_REF and not TYPE_CODE_RVALUE_REF.

Here we are checking for LVALUE or Pointers dynamic value and for them need to resolve the target memory to resolve pointer/memory at outmost level.  So as far as I understood checking for rvalue here would not be needed.  In case you have some case to try then please let me know I can give it a try.

>> -  if (type_not_associated (val->type ()))
>> -    {
>> -      val_print_not_associated (stream);
>> -      return 0;
>> -    }

Tom > I don't really know anything about Fortran, so I don't know why this code was here in the first place, nor what its removal might mean.

This was originally added at time to support DW_AT_Associated/Allocated DIEs for Fortran dynamic arrays but this is a redundant code so no need to keep it. Also in existing testsuite there is no affect with or without it.  Will mention in the commit message in V4 series.

Best Regards,
Abdul Basit

-----Original Message-----
From: Tom Tromey <tom@tromey.com> 
Sent: Tuesday, October 10, 2023 9:50 PM
To: Abdul Basit Ijaz via Gdb-patches <gdb-patches@sourceware.org>
Cc: Ijaz, Abdul B <abdul.b.ijaz@intel.com>; simark@simark.ca; tom@tromey.com
Subject: Re: [PATCH v3 2/4] gdb, types: Resolve pointer types dynamically

>>>>> Abdul Basit Ijaz via Gdb-patches <gdb-patches@sourceware.org> writes:

> -  /* We only want to recognize references at the outermost level.  */
> -  if (top_level && type->code () == TYPE_CODE_REF)
> +  /* We only want to recognize references and pointers at the outermost
> +     level.  */
> +  if (top_level
> +      && (type->code () == TYPE_CODE_REF || type->code () == 
> + TYPE_CODE_PTR))

Pre-existing but I wonder why this code checks TYPE_CODE_REF and not TYPE_CODE_RVALUE_REF.

> diff --git a/gdb/valprint.c b/gdb/valprint.c index 
> b65dda15c04..c71ae089f46 100644
> --- a/gdb/valprint.c
> +++ b/gdb/valprint.c
> @@ -1156,12 +1156,6 @@ value_check_printable (struct value *val, struct ui_file *stream,
>        return 0;
>      }
 
> -  if (type_not_associated (val->type ()))
> -    {
> -      val_print_not_associated (stream);
> -      return 0;
> -    }

I don't really know anything about Fortran, so I don't know why this code was here in the first place, nor what its removal might mean.
Could you say why this is being removed?

Tom
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  reply	other threads:[~2024-01-03 21:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04 22:29 [PATCH v3 0/4] Dynamic properties of pointers Abdul Basit Ijaz
2023-09-04 22:29 ` [PATCH v3 1/4] gdb, testsuite: handle icc and icpc deprecated remarks Abdul Basit Ijaz
2023-10-03  0:04   ` Thiago Jung Bauermann
2023-09-04 22:29 ` [PATCH v3 2/4] gdb, types: Resolve pointer types dynamically Abdul Basit Ijaz
2023-10-03  0:07   ` Thiago Jung Bauermann
2023-10-10 19:45     ` Tom Tromey
2024-01-03 21:06       ` Ijaz, Abdul B
2024-01-03 21:06     ` Ijaz, Abdul B
2023-10-10 19:49   ` Tom Tromey
2024-01-03 21:31     ` Ijaz, Abdul B [this message]
2023-09-04 22:29 ` [PATCH v3 3/4] gdb, intel-classic-compilers, testsuite: workaround icc/icpc/ifort pointer/reference DWARF Abdul Basit Ijaz
2023-10-03  0:09   ` Thiago Jung Bauermann
2023-10-10 19:52   ` Tom Tromey
2024-01-03 21:15     ` Ijaz, Abdul B
2023-09-04 22:29 ` [PATCH v3 4/4] gdb, testsuite, fortran: Fix sizeof intrinsic for ifort Fortran pointers Abdul Basit Ijaz
2023-10-03  0:16   ` Thiago Jung Bauermann
2023-09-27 21:11 ` [PING][PATCH v3 0/4] Dynamic properties of pointers Ijaz, Abdul B
2023-10-03  0:17 ` [PATCH " Thiago Jung Bauermann

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=SA1PR11MB6846AD8406044959D0C8CDD1CB60A@SA1PR11MB6846.namprd11.prod.outlook.com \
    --to=abdul.b.ijaz@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=tom@tromey.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).