Repository navigation
feat(libSceAmpr): implement std::_Throw_Cpp_error - #3679
Conversation
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for carrying this. Build and ctest are green here on top of current main (76/76 in the touched libraries); the new test is MinGW-only, so it could not be run on Linux.
One problem, in the second commit:
core/libs/prx/libc/src/exception/StandardExceptions.cpp:380-385andcore/libs/tests/GuestAmprCppError.cpp:26-32expectwhat()="device or resource busy: Device busy", anddocs/dev/TechnicalDebt.md:354says this follows VC12'ssyserror.cpp. In that file,_Generic_error_category::messagereturns_Syserror_map(code), which is the lowercase_Sys_errtab("device or resource busy","invalid argument", ...). microsoft/STL does the same. So by the cited source the text is"device or resource busy: device or resource busy", as in your first commit."Device busy","Cannot allocate memory"and"Resource temporarily unavailable"are FreeBSDstrerrorstrings, not VC12's.- To keep the title case form, please show where it comes from on the console (e.g. disassembly of the title's
libc.prx_Generic_error_category::message/_Syserror_mappath) and cite that in TechnicalDebt as unverified-against-VC12. Otherwise revert the second commit's message change and its test expectations.
Everything else looked right: the seven codes and order match VC12 thread0.cpp, errno values are FreeBSD's, out-of-range codes throw, and the copy/assign now carry the error_code.
|
Thanks for checking the pinned source. You are right: VC12's generic category calls I reverted my message-text follow-up; the branch now uses the repeated lowercase strings from the original implementation, matching |
Requested VC12 correction is in the current headThe title-case message change was reverted. Head @adriadam10, could you re-review the corrected head? The separate #3499 overlap is in different exports; we can rebase if it lands first. |
|
Conflicts with main in |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
94a3935 to
e456729
Compare
|
The current PR head ( |
|
Coordination note on the overlap with #4164: its current patch removes |
e456729 to
eebfbb6
Compare
Throw a guest std::system_error for the Dinkumware _Cpp_error codes, as in VC12 and microsoft/STL thread0.cpp: the error_code holds the FreeBSD errno and a guest generic error category modelled in libc, and what() is the table message followed by the category message. Codes outside the table throw std::out_of_range. The system_error copy constructor and assignment now copy the error_code too. Imported by Deathloop (PPSA01670) and Minecraft Legends (PPSA05510). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit bed1dea)
eebfbb6 to
2dc4d9d
Compare
adriadam10
left a comment
There was a problem hiding this comment.
Checked on top of current main: build and ctest of libs, libSceAmpr and libc are green on Linux (90/90). The new guest_ampr_cpp_error test is MinGW-only, so it was not run here; the full Windows build was dispatched for this PR (run 38306435583) and the earlier Windows 11 run reported by @screamm covers it. The what() text matches VC12's syserror.cpp, as discussed above.
Merging once that Windows run is green. #4164 also touches _ZSt16_Throw_Cpp_errori; it will need to rebase over this.
What
std::_Throw_Cpp_error(int)for the seven VC12 Dinkumware thread error codes.std::system_errorobjects with their FreeBSD errno and generic category; reject out-of-range codes withstd::out_of_range.error_codethroughsystem_errorcopies and assignments, and add a MinGW-only guest exception regression test.This carries David's implementation from issue #3346, retaining his commit author. The
what()text follows VC12'sthread0.cppand_Generic_error_category::message/_Syserror_mapinsyserror.cpp: the lowercase table message followed by the lowercase generic category message for the errno (for these seven codes, the strings are identical). Console behavior has not been verified.Tested
python3 tools/check_conventions.py --base upstream/mainandgit diff --check upstream/main...HEADpassed.guest_ampr_cpp_errortest: it has no MinGW compiler, and local CMake configuration could not find system SDL2 development files while the pinned SDL2 submodule commit could not be fetched from this checkout.guest_ampr_cpp_error(5/5) and the listed exception-runtime tests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Closes #3346.