Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <guinevere@redhat.com>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v7] gdb: Print linker namespace when showing a frame
Date: Wed, 6 May 2026 17:07:59 -0300	[thread overview]
Message-ID: <05e944bf-5c44-4201-b74b-ca6bdfa0289a@redhat.com> (raw)
In-Reply-To: <87se8p38al.fsf@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2422 bytes --]

On 4/20/26 1:28 PM, Andrew Burgess wrote:
>> @@ -1288,13 +1290,13 @@ find_frame_funname (const frame_info_ptr &frame, enum language *funlang,
>>   	     stored in the symbol table, but we stored a version
>>   	     with DMGL_PARAMS turned on, and here we don't want to
>>   	     display parameters.  So remove the parameters.  */
>> -	  funname = cp_remove_params (print_name);
>> +	  funname = cp_remove_params (print_name.c_str ());
> Does this work?  The PRINT_NAME will have the namepsace prefix in place,
> but doesn't cp_remove_params parse the name as a C++ symbol, so will
> this correctly find and remove the parameters?
>
> I haven't looked at the earlier versions, but I have a suspicion that
> this might be me causing problems, as I think originally you were adding
> the namespace-id as a prefix, and I pushed you to write
> print_name_with_namespace.
>
> Anyway, I think you should write a test to cover this case (C++ symbol
> in a namespace) and see if this works, if not, then you might need to go
> back to something more like your original approach, adding the namespace
> prefix.

You're correct, this does not work. However, I thought about it some 
more, and I think this is the wrong place to make this change anyway. I 
don't think we want to say that the function *name* includes the prefix.

So instead, I added a function that calculates and returns the 
identifier, then identified the callers that print the name directly, 
and made them call the function. This way, also, the python symbol.name 
and the guile equivalent won't be polluted by the linker namespace.

>
>>   	}
>>   
>>         /* If we didn't hit the C++ case above, set *funname
>>   	 here.  */
>>         if (funname == NULL)
>> -	funname.reset (xstrdup (print_name));
>> +	funname.reset (xstrdup (print_name.c_str ()));
>>       }
>>     else
>>       {
> This 'else' block looks up the funname via lookup_minimal_symbol_by_pc,
> but doesn't add the namespace-id.  If we had code without debug in a
> namespace, I think this is the path it would take, should we not be
> displaying the id in this case?
>
> This might be a good new test to add.

Now that print_frame is calling it, instead of find_frame_funname, I 
don't think the existence of debug symbols no longer matters, so I won't 
be adding this test case, as it is redundant. v8 should be arriving on 
the list soon enough

-- 
Cheers,
Guinevere Larsen
It/she

[-- Attachment #2: Type: text/html, Size: 3261 bytes --]

      reply	other threads:[~2026-05-06 20:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13 17:43 Guinevere Larsen
2026-01-13 20:08 ` Eli Zaretskii
2026-03-05 12:18 ` [PING][PATCH " Guinevere Larsen
2026-04-20 16:28 ` [PATCH " Andrew Burgess
2026-05-06 20:07   ` Guinevere Larsen [this message]

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=05e944bf-5c44-4201-b74b-ca6bdfa0289a@redhat.com \
    --to=guinevere@redhat.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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