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

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 21 10:40:18 PDT 2023


bulbazord added a subscriber: aprantl.
bulbazord added a comment.

In D145580#4209621 <https://reviews.llvm.org/D145580#4209621>, @DavidSpickett wrote:

> On the subject of not using `TypeSystemClang`, looking around it seems like `TypeSystem` is purely used to look up basic types, never to make new ones. When new types are made the code asks the `TypeSystem` for its `TypeSystemClang` and then uses that to do it.
>
> Is that a limitation of `TypeSystem` or just that it's missing methods? I also looked for ways to build types without the type system then add them to it, but didn't find any. Do we have anyone who knows more about this? (I sure don't)

I think @aprantl might know more about TypeSystems and what their intended use/capabilities are. It's entirely possible that TypeSystem is just not as flexible as it could be.

> I could move the code into an existing plugin like Platform. Problems with that:
>
> - Platform implementations are plugins, the base class is not so I have to have 3 copies of the method.
> - When using a core file, the platform is always the host. Might be able to work around that by passing the core file's triple in each time.
>
> Or put the code into a new plugin but then I've just got the same dependency problem with more steps.
>
> There is code for dealing with user expressions so I could make the types out of strings and evaluate something like:
>
>   *reinterpret_cast(
>     __attribute__((packed)) struct __lldb_register_fields_cpsr {
>       uint32_t z;
>       ...
>     })(<fake address of register value)
>
> It does feel like something that code wasn't intended to do.

Right, these solutions might not be as nice. I've been working to stop using plugins in non-plugin code for a few years now so I'd like to prevent us from adding new uses where possible. I don't want to block progress though! Let's see if @aprantl can help us out.


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