Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ijaz, Abdul B" <abdul.b.ijaz@intel.com>
To: Andrew Burgess <aburgess@redhat.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "pedro@palves.net" <pedro@palves.net>,
	"philippe.waroquiers@skynet.be" <philippe.waroquiers@skynet.be>,
	"Schimpe, Christina" <christina.schimpe@intel.com>,
	"lsix@lancelotsix.com" <lsix@lancelotsix.com>,
	 "eliz@gnu.org" <eliz@gnu.org>,
	"guinevere@redhat.com" <guinevere@redhat.com>
Subject: RE: [PATCH v13 1/2] gdb: add annotation in 'info locals' command for variables shadowing case
Date: Mon, 13 Jul 2026 20:06:48 +0000	[thread overview]
Message-ID: <SA1PR11MB6846F1EF6D2C1412A2133AA7CBFA2@SA1PR11MB6846.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87o6gaexdy.fsf@redhat.com>

Hi Andrew,

Thanks for the feedback.

>> +      if (var->symtab () && var->symtab ()->filename ())
>> +	file_name = lbasename (var->symtab ()->filename ());

> I suspect there might be some history here, but did you consider using `symtab_to_filename_for_display`?  If not, then it might be worth a comment explaining what that isn't being used.

The symtab_to_filename_for_display function has not been tried so far. But a quick test shows that by default GDB is configured to use a relative path for filenames. In the past there was feedback to show only the basename here instead of the full path. I will add a comment explaining why we are using lbasename instead.

Best Regards
Abdul Basit

-----Original Message-----
From: Andrew Burgess <aburgess@redhat.com> 
Sent: Monday, July 13, 2026 5:13 PM
To: Ijaz, Abdul B <abdul.b.ijaz@intel.com>; gdb-patches@sourceware.org
Cc: pedro@palves.net; philippe.waroquiers@skynet.be; Schimpe, Christina <christina.schimpe@intel.com>; lsix@lancelotsix.com; eliz@gnu.org; Ijaz, Abdul B <abdul.b.ijaz@intel.com>; guinevere@redhat.com
Subject: Re: [PATCH v13 1/2] gdb: add annotation in 'info locals' command for variables shadowing case

Abdul Basit Ijaz <abdul.b.ijaz@intel.com> writes:

> --- a/gdb/printcmd.c
> +++ b/gdb/printcmd.c
> @@ -2377,12 +2377,17 @@ clear_dangling_display_expressions (struct 
> objfile *objfile)  void  print_variable_value (symbol *var, const 
> frame_info_ptr &frame,
>  		      ui_file *stream, int indent,
> -		      const language_defn *language)
> +		      const language_defn *language,
> +		      var_shadowing shadow_status)
>  {
>    try
>      {
>        struct value *val;
>        struct value_print_options opts;
> +      const char *file_name = nullptr;
> +
> +      if (var->symtab () && var->symtab ()->filename ())
> +	file_name = lbasename (var->symtab ()->filename ());

I suspect there might be some history here, but did you consider using `symtab_to_filename_for_display`?  If not, then it might be worth a comment explaining what that isn't being used.

Thanks,
Andrew

Intel Deutschland GmbH

Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  reply	other threads:[~2026-07-13 20:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 18:08 [PATCH v13 0/2] " Abdul Basit Ijaz
2026-07-08 18:08 ` [PATCH v13 1/2] gdb: " Abdul Basit Ijaz
2026-07-13 12:49   ` Andrew Burgess
2026-07-13 13:45     ` Ijaz, Abdul B
2026-07-13 15:12   ` Andrew Burgess
2026-07-13 20:06     ` Ijaz, Abdul B [this message]
2026-07-08 18:08 ` [PATCH v13 2/2] gdb: add shadowed field in '-stack-list-locals/variables' mi commands Abdul Basit Ijaz
2026-07-13 15:11   ` Andrew Burgess
2026-07-13 20:39     ` Ijaz, Abdul B

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=SA1PR11MB6846F1EF6D2C1412A2133AA7CBFA2@SA1PR11MB6846.namprd11.prod.outlook.com \
    --to=abdul.b.ijaz@intel.com \
    --cc=aburgess@redhat.com \
    --cc=christina.schimpe@intel.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.com \
    --cc=lsix@lancelotsix.com \
    --cc=pedro@palves.net \
    --cc=philippe.waroquiers@skynet.be \
    /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