Skip to content

[gui] Type libraries window (Shift+F11), and the libraries a program's types join - #1364

Merged
gmh5225 merged 6 commits into
devfrom
claude/type-libraries-view
Oct 18, 2026
Merged

gmh5225 merged 6 commits into
devfrom
claude/type-libraries-view

Conversation

@gmh5225

@gmh5225 gmh5225 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Summary

IDA lists the type libraries a database uses in its Type libraries window (Shift+F11), where Ins loads another and Del unloads one. NeverD joined the libraries of a system's headers to a program's types by the program's kind alone, with no way to see or change the choice. This adds the window and the choice behind it, from the engine to the command line, the worker and the workbench.

Engine

  • neverd_type_libraries_json lists every library NeverD ships with:

    • its data model and record ABI;
    • whether the program's image joins it, whether its records lay out as the program's, and whether it joins now;
    • the types and prototypes it joined, and the records it left out because the program sizes a type they hold otherwise.

    The libraries joined come first, in the order they join.

  • neverd_type_libraries_set adds a library whose data model and record ABI are the program's, or leaves out one the image joins. A library laid out otherwise, or a name the program already joins, is refused. The program's types are read again.

  • neverd_type_libraries_save and _load write and read the choice as <input>.neverd/libraries.json, which neverd_session_load reads. As with the debug files chosen, undo history leaves it out.

  • A libraries.json edited by hand that adds a library laid out otherwise joins nothing of it, and the listing says why. A library named twice joins once.

Command line

  • neverd types <input> --libraries lists the libraries as the window does.
  • --add-library and --remove-library change the choice as Ins and Del do, and the project keeps it.

Worker

  • type_libraries lists the libraries. type_libraries_set {added, removed} is a writer command.
  • The worker writes libraries.json itself, under the writer lock it holds, as it writes load.json; the engine's own save would take that lock again.
  • project_sync reads a libraries.json that git or another tool changed. It compares the file with the one the worker last read or wrote, so a sync reads no types.

Workbench

  • View → Open subviews → Type libraries (Shift+F11, IDA's key) lists the program's own libraries, then those the user added, with each one's counts. The tooltip names the records each left out.
  • Ins offers the libraries whose records lay out as the program's. Del leaves the selected library out, or takes back one the user added. The context menu has both.
  • All 11 catalogs translate the window. Each language gets an access key in its own script where the menu leaves one free.

Also

  • The capability manifest now claims neverd types --system-library and --header-pragmas, which [types] Take the C library's types from the system's own headers #1348 added without claiming them.
  • pseudocodeNamesAndCommentsEditTheirSource hung for 300 s under load on an "Unsaved changes" question. It waited for the .nddb file to exist, which happens as soon as the write starts, then restarted while the session still counted the write. It now waits for databaseSaved, as the other packing tests do. This race existed before this change.

Verification

  • NeverDSessionCAPITests (176 passed). TypeLibrariesAreChosenAndKeptWithTheProject covers:
    • a glibc program leaving glibc out and joining musl, with the header taking musl's types;
    • refusals;
    • persistence across sessions;
    • a hand-edited incompatible library;
    • listing order.
  • NeverDTypesTests (138 passed).
  • NeverDWorkerLocalTypes, on the real engine with local_types.exe:
    • the kernel library left out (_DRIVER_OBJECT goes) and UEFI's added (EFI_SYSTEM_TABLE comes);
    • nothing added to the history;
    • refusals, including from the read-only replica;
    • a project_sync that reads an external change once.
  • NeverDWorkerCLISidecarParity: the CLI's --remove-library/--add-library and the worker's type_libraries_set write byte-identical libraries.json.
  • WorkbenchTests::typeLibrariesAreAddedAndLeftOutByShiftF11: 20 of 20 runs passed. pseudocodeNamesAndCommentsEditTheirSource: 8 of 8. The whole binary passed offscreen.
  • Checks passed: check_gui_i18n.py --lupdate, check_gui_icons.py, check_capabilities.py and clang-format.

Notes

  • windows-user-arm64 and uefi-arm64 are offered to x64 Windows programs. They share the LLP64 data model and Microsoft's record layout, which is the rule for whether a library is compatible.
  • The program's own libraries still join before those the user adds, so a name both declare keeps the program's.

A project adds a library whose data model and record ABI are the
program's, or leaves out one its image joins (neverd_type_libraries_set),
and keeps the choice in libraries.json, which the session reads when it
loads; undo history leaves it out, as it does the debug files chosen.
neverd_type_libraries_json lists every library, those joined first in
the order they join, with the types, prototypes and conflicts of each.
A library that a hand-edited libraries.json adds and that lays out
otherwise joins nothing and says why.

`neverd types --libraries` lists them as the workbench's Type libraries
window does, and --add-library and --remove-library change the choice as
its Ins and Del do. The manifest also claims --system-library and
--header-pragmas, which #1348 added.
As IDA's Type libraries window: the libraries of a system's headers the
program's types join, in the order they join, with each one's data
model, record ABI, and the types, prototypes and conflicting records it
joined. Ins offers the libraries whose records lay out as the program's
and adds the one chosen; Del leaves the selected library out, or takes
back one the user added. The program's types are read again.

The worker's type_libraries and type_libraries_set ops reach the
engine's choice, and project_sync reads a libraries.json changed outside
it. Every catalog translates the window.
The engine's saves take the project's writer lock, which the worker
already holds, so a choice made in the workbench failed with "project
writer unavailable". As with the type declarations,
neverd_type_libraries_set now only sets the choice, and
neverd_type_libraries_save writes libraries.json for the command line;
the worker writes the file itself under the lock it holds, as it writes
load.json, and joins again what the file says when the write fails.

project_sync compares libraries.json with the file as the worker last
read or wrote it, instead of asking the engine for its choice, which
read every local type of the program on each sync.
pseudocodeNamesAndCommentsEditTheirSource waited for the .nddb file to
exist, which it does as soon as the database starts to be written; the
session counts the write until its result reaches the GUI thread, so a
restart right after asked to save first and hung on the question under
load. It now waits for databaseSaved, as the other packing tests do.
@gmh5225
gmh5225 merged commit bccc350 into dev Oct 18, 2026
6 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants