genodelabs / genode

Genode OS Framework
https://genode.org/
Other
1.08k stars 254 forks source link

Reduce reliance on C++ exceptions in the base framework #5245

Open nfeske opened 5 months ago

nfeske commented 5 months ago

Down the road, I'd like to clear the base framework from the use of C++ exceptions, using the attempt pattern for error handling instead (see https://genode.org/documentation/genode-foundations/24.05/api/Fundamental_types.html#Exception-less_error_handling). Let's move gradually to this direction.

nfeske commented 5 months ago

Commit https://github.com/genodelabs/genode/commit/a82a3e66910a2bdb3e506ab720c3039fe6d91ccf and fixup https://github.com/genodelabs/genode/commit/6af5a3e8871307025612440a54519d6bf45a18fb remove C++ exceptions from core's TRACE session interface and adjust the components throughout Genode's source tree. The new version of the interface is tighter in several respects. Hence, this change requires the adaptation of trace clients (@alex-ab thinking of top_view).

@jschlatow I have adapted the trace recorder to this change but admittedly haven't tested it. I'd appreciate you giving it a spin.

nfeske commented 5 months ago

Commit https://github.com/genodelabs/genode/commit/7cac494dc2e05ab9f4b14790b75f80be12808b96 takes another step by revisiting the PD session interface.

jschlatow commented 5 months ago

@jschlatow I have adapted the trace recorder to this change but admittedly haven't tested it. I'd appreciate you giving it a spin.

It's spinning happily.

nfeske commented 4 months ago

Commit https://github.com/genodelabs/genode/commit/2d77d43f89f184426b5a5efdf9bf9fd8974c6037 covers the CPU session interface. Commit https://github.com/genodelabs/genode/commit/6a044c72042a9f941874adb7b8ad4d6f0fee6e7c is concerned with the Region_map interface. This one is by far the most elaborate step so far because of the many users of the interface. While being at it, I took the opportunity to modernize several further aspects of it, in particular addressing the requirement #5070 and passing attach arguments via an attribute structure, which makes the intent of client-side code more obvious.

While adapting the API users, I spotted a number of places where we could live with read-only mappings but currently establish read-writeable mappings, for the mundane reason that rm.attachused rw by default when called with only the dataspace capability as argument. For now, I kept the existing semantics. But as subsequent step, we may consider grepping the code for "\.writeable *= *true" and individually reviewing the places.

nfeske commented 4 months ago

@cproc may you take care of adjusting qt5 to the latest Region_map change?

cproc commented 4 months ago

Commit f89482c adapts qt5.

nfeske commented 4 months ago

Fantastic! Thank you @cproc.

nfeske commented 4 months ago

Commit https://github.com/genodelabs/genode/commit/3c00a1b8a0e24de3417397f568f6b879767d884e removes exceptions from the parent interface. Commit https://github.com/genodelabs/genode/commit/87952dcaee22cf1740e9ddc562184dd64d9218ff revisits the child creation (ELF loading, process starting) in this respect.