Repository navigation
[gui] Type libraries window (Shift+F11), and the libraries a program's types join - #1364
Merged
Merged
Conversation
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.
…view # Conflicts: # docs/architecture.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_jsonlists every library NeverD ships with:The libraries joined come first, in the order they join.
neverd_type_libraries_setadds 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_saveand_loadwrite and read the choice as<input>.neverd/libraries.json, whichneverd_session_loadreads. As with the debug files chosen, undo history leaves it out.A
libraries.jsonedited 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> --librarieslists the libraries as the window does.--add-libraryand--remove-librarychange the choice as Ins and Del do, and the project keeps it.Worker
type_librarieslists the libraries.type_libraries_set {added, removed}is a writer command.libraries.jsonitself, under the writer lock it holds, as it writesload.json; the engine's own save would take that lock again.project_syncreads alibraries.jsonthat 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
Also
neverd types --system-libraryand--header-pragmas, which [types] Take the C library's types from the system's own headers #1348 added without claiming them.pseudocodeNamesAndCommentsEditTheirSourcehung for 300 s under load on an "Unsaved changes" question. It waited for the.nddbfile to exist, which happens as soon as the write starts, then restarted while the session still counted the write. It now waits fordatabaseSaved, as the other packing tests do. This race existed before this change.Verification
NeverDSessionCAPITests(176 passed).TypeLibrariesAreChosenAndKeptWithTheProjectcovers:NeverDTypesTests(138 passed).NeverDWorkerLocalTypes, on the real engine withlocal_types.exe:_DRIVER_OBJECTgoes) and UEFI's added (EFI_SYSTEM_TABLEcomes);project_syncthat reads an external change once.NeverDWorkerCLISidecarParity: the CLI's--remove-library/--add-libraryand the worker'stype_libraries_setwrite byte-identicallibraries.json.WorkbenchTests::typeLibrariesAreAddedAndLeftOutByShiftF11: 20 of 20 runs passed.pseudocodeNamesAndCommentsEditTheirSource: 8 of 8. The whole binary passed offscreen.check_gui_i18n.py --lupdate,check_gui_icons.py,check_capabilities.pyand clang-format.Notes
windows-user-arm64anduefi-arm64are 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.