JDevlieghere added a comment.

I recently modified this function to support parsing the rosetta registers. To 
do that I call `parse_thread_registers` recursively, and I think we should do 
the same here and add an optional argument for the prefix. So the result would 
look something like:

  def parse_thread_registers(self, json_thread_state, prefix=None):
      registers = dict()
      for key, state in json_thread_state.items():
          if key == "rosetta":
             registers.update(self.parse_thread_registers(state))
             continue
          if key == "x":
             registers.update(self.parse_thread_registers(state), prefix="x")
             continue
          try:
             value = int(state['value'])
             registers["{}{}".format(prefix,key)] = value
          except (KeyError, ValueError, TypeError):
             pass
      return registers


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119168

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

Reply via email to