Skip to content

Front-ends and modes in symtab2gb #6223

Closed

Description

@martin-cs

I don't yet have a reproducer for this issue but it seems that there is a design / architectural problem.

  1. symtab2gb only loads the json_symtab language:

    register_language(new_json_symtab_language);

  2. It calls linking. The error reporting of linking calls from_type which uses the mode of the symbol:
    linkingt::copy_symbols
    linkingt::duplicate_non_type_symbol
    linkingt::duplicate_code_symbol
    linkingt::detailed_conflict_report
    linkingt::detailed_conflict_report_rec
    linkingt::type_to_string_verbose
    from_type

  3. At the moment having the mode as anything other than "json_symtab" will result in an invariant failure.

So, potential work-arounds or solutions:

  • Set the mode of all inputs using this interface to "json_symtab" ( paging @danielsn for the connection to RFC: Language mode for Rust  #6219 ).
  • Add the C language interface to symtab2gb and set the mode to ID_C (as it is at the moment).
  • Create modes for the various languages using this front-end and load all of them.

( See also #6219 (comment) )

Activity

  1. chrisr-diffblue commented on Jul 20, 2021

    @chrisr-diffblue
    Contributor

    While its not the biggest problem in the world, it does seem that adding more 'language modes' to json_symtab_language makes it an increasing maintenance burden over time (e.g. harder to add sensible invariants, easier for language specific implementation details to leak into dark corners of code, etc). I think I prefer the proposals in #6219 personally (see comments I'm about to add there...)

  2. martin-cs commented on Jul 27, 2021

    @martin-cs
    CollaboratorAuthor

    #6233 works around this issue by supporting mode ID_C . To be resolved properly as part of #6219 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions