omjavaid added a comment.

In D91241#2391126 <https://reviews.llvm.org/D91241#2391126>, @labath wrote:

> That's a good point. Maybe this does need to be a two-pass algorithm (first 
> compute the offsets of primary registers, then fill out subregs). But that 
> doesn't mean the two passes should be in two completely separate files. It 
> would still be better if that was done in a single place. Maybe we can move 
> all the offset computation out of the parsing loop and into a separate helper 
> function. Doing the computation inside the loop is not really correct anyway, 
> as the registers in the target.xml don't have to come in ascending regnum 
> order (all stubs probably send them that way, but I don't think they _have_ 
> to do that).

I guess GDB standard does enforce ascending order, here is what it says about 
regnum:

"The register’s number. If omitted, a register’s number is one greater than 
that of the previous register (either in the current feature or in a preceding 
feature); the first register in the target description defaults to zero. This 
register number is used to read or write the register; e.g. it is used in the 
remote p and P packets, and registers appear in the g and G packets in order of 
increasing register number."

https://sourceware.org/gdb/current/onlinedocs/gdb/Target-Description-Format.html


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91241/new/

https://reviews.llvm.org/D91241

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to