[Lldb-commits] [PATCH] D145580: [lldb] Show register fields using bitfield struct types

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 20 04:54:04 PDT 2023


DavidSpickett added a comment.

The shakiest aspect here is probably my use of the scratch type system. It works but I'm not 100% that there isn't a better choice.

These are the current steps:

- Make the type name. I've prepended `__lldb_` as I saw elsewhere. So register `cpsr` would have a type `__llb_register_fields_cpsr`.
- If we already have a type, use it.
- If we don't, make one and use that.

So I'm assuming that the scratch type system exists for the life of the debug session. It can be reset and we would regenerate the type
as needed.

Another assumption is that we won't get a new batch of register info mid session. We would just keep using the existing type if we had
already made one. Seems fairly safe to me.

The type name might change in future to be more general e.g. `__lldb_register_type_cpsr` as and when we support the union and struct
elements that can also be in the XML. It's an internal detail, so this is fine.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145580



More information about the lldb-commits mailing list