[Lldb-commits] [PATCH] D142052: [lldb] Implement SymbolFile::CopyType

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 19 14:51:05 PST 2023


clayborg added a comment.

We don't allow types to be copied into another SymbolFile. There is a strict rule in LLDB that SymbolFile objects only create types from their own data. There are many reasons we don't want this:

- Type objects have a  m_symbol_file which points to the SymbolFile that created it. This pointer can and will go bad if the original symbol file is freed.
- Type objects have a symbol context member variable ( "SymbolContextScope *m_context;"), same issue as above
- Type objects might have a valid encoding type member variable ("Type *m_encoding_type;") that is non NULL that points to a type that is owned by the original symbol file
- Type objects might have a encoding User ID and encoding type that point to the original symbol file (  lldb::user_id_t m_encoding_uid = LLDB_INVALID_UID; EncodingDataType m_encoding_uid_type = eEncodingInvalid;) and the user_id_t only makes sense in the original encoding type.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142052



More information about the lldb-commits mailing list