This is the mail archive of the gdb-patches@sourceware.org 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: [PATCH V2] AArch64 pauth: Indicate unmasked addresses in backtrace



> On 9 Aug 2019, at 15:17, Pedro Alves <palves@redhat.com> wrote:
> 
> On 8/9/19 2:22 PM, Alan Hayward wrote:
>> It looks like fixing the space just requires an additional call to uiout->text (" “).
>> 
>> 
>> How about I create a new field addr_flags? It would be a generic field into which
>> targets can add whichever fields they want to.
>> 
>> I then could add a call to a new function gdbarch_print_addr_flags() which prints the
>> PAC on AArch64 and nothing on all other targets?
> 
> That sounds like two different things.  You could have the gdbarch method without
> the uiout field.  Not sure what the uiout field buys you.  If CLI and MI are going to
> print the same way, then it doesn't appear useful over field_string.  The gdbarch
> method sounds fine.
> 

I was thinking of the following:

char *flags = gdbarch_print_pc_addr_flags(frame, pc);  /* Returns null or “PAC” or “FOO,BAR” etc */
if (flags)
{
  uiout->text (“ [“);
  uiout->field_string (“addr_flags", flags);
  uiout->text (“]“);
}

addr_flags can be printed by any target that wishes. And PAC only needs to be in
AArch64 specifics.



Alan.

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