[Lldb-commits] [PATCH] D12079: [MIPS] microMIPS breakpoints, disassembly and compressed addresses

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 10 09:57:01 PDT 2015

clayborg added a comment.

In http://reviews.llvm.org/D12079#242998, @jaydeep wrote:

> In http://reviews.llvm.org/D12079#242742, @clayborg wrote:
> > So DumpAddress() in FormatEntity.cpp is a generic "dump any address by describing it". You can't just change the code to suit your needs for MIPS. This address could be any address: code or data. If you want something that can take an address like 0x1000 and you ask for its AddressClass and it sees that its address class is eAddressClassCodeAlternateISA, and then you change it to be "0x1001", this will need to be a new format type.
> >
> > DumpAddress in FormatEntity.cpp is called for the following entities:
> >
> >   case Entry::Type::LineEntryStartAddress:
> >   case Entry::Type::LineEntryEndAddress:
> >   case Entry::Type::AddressFile:
> >   case Entry::Type::AddressLoad:
> >   case Entry::Type::AddressLoadOrFile:
> >   case Entry::Type::FrameRegisterPC
> >   
> >
> > So only the LineEntry ones should actually do what you did.
> We need to display all these entities in compressed address format. How about a new MIPS specific function in Address and Target class which would do this.
> Address Address::GetCallableAddress(Target *target);
>  lldb::addr_t Target::GetCallableAddress (lldb::addr_t load_addr, AddressClass addr_class);

We already have this in Target:

  GetCallableLoadAddress (lldb::addr_t load_addr, lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;

So the solution here will be to modify Address::Dump() such that it detects when an address is eAddressClassCodeAlternateISA and when that happens it checks if the ExecutionContext parameter is non NULL, and if so, extract the target, and check the target's architecture is MIPS, then add the extra bit when displaying this address. As it seems that we would always want to describe a section offset address (lldb_private::Address object) in this way to show the MicroMIPS address space bit, right?



More information about the lldb-commits mailing list