[Lldb-commits] [PATCH] D119168: [lldb/crashlog] Fix arm64 register parsing on crashlog.py

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 7 11:31:04 PST 2022


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



More information about the lldb-commits mailing list