Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Xavier Roirand <roirand@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix frame argument printing when using auto language mode
Date: Wed, 21 Feb 2018 16:12:00 -0000	[thread overview]
Message-ID: <eef6d18d-b6a6-b0f6-1b9a-d15e0f02b069@adacore.com> (raw)
In-Reply-To: <CAH=s-PNXHw=9peQkB23_g-dKKcXCiBP20tvG9Tbx9mJ5hmR+9A@mail.gmail.com>

Hello,

This is a doable fix, I don't see any issue with it and hope that it 
will not add any side effect. I'll propose an RFA soon. Thx

Regards

Le 2/20/18 à 5:48 PM, Yao Qi a écrit :
> On Tue, Feb 20, 2018 at 4:28 PM, Xavier Roirand <roirand@adacore.com> wrote:
>>
>> It was my first idea, but it would imply a consequent amount of work because
>> when ada_val_print_1 is called, the stack is the following one:
>>
>> #0  ada_val_print_1
>> #1  ada_val_print
>> #2  val_print (got the language of the frame arg)
>>
>> So if we want to pass the per-frame language down to ada_val_print_1 then in
>> the generic val_print function, we have to change:
>>
>>        language->la_val_print (type, embedded_offset, address,
>>                                stream, recurse, val,
>>                                &local_opts);
>> to something like:
>>
>>        language->la_val_print (type, embedded_offset, address,
>>                                stream, recurse, val,
>>                                &local_opts, language);
>>                                             ^^^^^^^^
>>
> 
> We don't have to do that.  ada_val_print_1 is called in ada_val_print,
> 
>        ada_val_print_1 (type, embedded_offset, address,
>         stream, recurse, val, options,
>         current_language);
> 
> and ada_val_print is language->la_val_print in effect, so "language"
> is ada_language_defn, and we can rewrite the code above like this,
> 
>        ada_val_print_1 (type, embedded_offset, address,
>         stream, recurse, val, options,
>         &ada_language_defn);
> 
> This change may break existing behaviour.  Printing for ada (or other
> languages) shouldn't depend on current_language, IMO.
> 
>> Fix me if I'm wrong but it means that <language>_val_print functions for all
>> the supported GDB languages have to be modified in order to support the
>> language parameter.
>>
> 


  reply	other threads:[~2018-02-21 16:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1519044767-8741-1-git-send-email-roirand@adacore.com>
     [not found] ` <CAH=s-PM+9dGs12pLNDZTcr69tdkTMDdyFhAwhHHL037vkvqCKQ@mail.gmail.com>
2018-02-20 16:28   ` Xavier Roirand
2018-02-20 16:48     ` Yao Qi
2018-02-21 16:12       ` Xavier Roirand [this message]
2018-02-22  3:38       ` Joel Brobecker

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=eef6d18d-b6a6-b0f6-1b9a-d15e0f02b069@adacore.com \
    --to=roirand@adacore.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