Repository navigation
Conversation
…se and do_get members open, get and close call do_open, do_get and do_close through the facet's vtable, as [locale.messages.members] specifies. do_get returns a copy of the default message, as Dinkumware's xlocmes does, since do_open never opens a catalog. GuestLocale gains the messages vtable layout and the StringData and AssignString helpers that build the copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run this test on pull requests.
AI-assisted: yes. |
|
Thank you for your contribution! Authors with no pull requests merged into |
Progress report (b11c7bf → a4689b1)📈 System libraries: 26.72% (+0.01%, +4 implemented, -4 removed functions) ✅ 4 implemented
🗑️ 4 removed
Changed libraries (implemented exports)
|
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.
What
Implements four
libSceLibcInternalexports ofstd::messages<char>that threwNotImplementedthrough thePending4_003-006stubs inExport.cpp:U2t+WvMQj8A_ZNKSt8messagesIcE4openERKSsRKSt6locale(open)XxsPrrWJ52I_ZNKSt8messagesIcE3getEiiiRKSs(get)EeBQ7253LkE_ZNKSt8messagesIcE5closeEi(close)vbgCuYKySLI_ZNKSt8messagesIcE6do_getEiiiRKSs(do_get)The stubs are replaced by functions with the mangled names in the new
Messages.cpp; the NID of each_nid_postfixname is the one the stub exported (checked with the SHA-1 NID computation).open,getandclosecalldo_open,do_getanddo_closethrough the facet's vtable and return their results, as ISO C++ [locale.messages.members] specifies ("Returns:do_open(name, loc)", "Returns:do_get(cat, set, msgid, dfault)", "Effects: Callsdo_close(cat)"). A null facet or a facet without a vtable throwsstd::invalid_argument.GuestLocale::MessagesVtable(libc/include/GuestLocale.hpp) placesdo_openat 0x20,do_getat 0x28 anddo_closeat 0x30 after the four facet slots, withstatic_asserts. Seven virtual slots plus offset-to-top and typeinfo give the nine-slot, 72-byte_ZTVSt8messagesIcEthat feat(libc): export the messages facet vtable as data #10158 measured on a consolelibc.prx.do_getreturns a copy of the default message for every catalog, set and message id, as Dinkumware'sxlocmesdoes. microsoft/STLstl/inc/xlocmesL87-L90 ate1ed302683e5e822f663fbb0f44cee7e9ddc6af0:do_openreturns -1 (the same file, L82-L84, and feat(libSceLibcInternal): answer the codecvt and messages queries as firmware 13.42 does #15582 for firmware 13.42), so [locale.messages.virtuals] only leaves the default. The result is built the waycollate::do_transformbuilds one (inline capacity 15, heap capacitylength | 15,GuestLocale::AllocateStringStorage, the 0x28-byteGuestLocale::String). The allocator word at offset 0 is left alone and embedded null characters are copied. A null default or result throwsstd::invalid_argument.GuestLocale::StringDataandGuestLocale::AssignString, declared inGuestLocale.hppand defined at the end ofLocaleSupport.cpp, solibSceLibcInternaladds no libc export (the feat(libSceLibcInternal): implement the numpunct<char> members #14373 pattern). They take the inline capacity fromsizeof(String::buffer), so they still build once feat(libSceLibcInternal): implement basic_string erase, append, assign, _Xran and _Xlen #15692 moves the file-local capacity constants into the header.docs/dev/debt/libSceLibcInternal.mdare removed. One Functional entry records thatdo_getfollows Dinkumware and that the console body was not disassembled.Progress (
tools/progress.pycollect_libraries(), origin/mainb11c7bf84fvs this branch): done 9921 -> 9925 (+4), todo 27225 -> 27221 (-4), no new todo.libSceLibcInternaldone 92 -> 96 and todo 1045 -> 1041; the four names above move from todo to done.Tested
No title or homebrew run. New guest test
guest_libc_internal_messages(core/libs/tests/GuestLibcInternalMessages.cpp):open,getandcloseon a facet whose test vtable records its calls: each forwards its own arguments and returns the virtual's result, and none calls another virtual.getthrough the realdo_getreturns the default.do_getcopies defaults of 0, 5, 3 (with an embedded null), 15, 16, 40 and 4095 characters. It checks size, capacity (15, 15, 15, 15, 31, 47, 4095), the terminator, inline or allocated storage, one allocation for each long copy, and that the source and the allocator word are unchanged.std::invalid_argument, and a rejected call never reaches a virtual.The test regex is
^(guest_libc_internal_messages|guest_collate|guest_locale|conventions_.*|debt_split|public_headers)$: 46 tests, of whichconventions_*anddebt_splitare self-tests of the conventions and debt-split checkers.nice -n 19 ionice -c3at -j3: 46/46 passed in each of 3 runs.NotImplemented_nid_no_patch(__func__)).guest_libc_internal_messagesfails (Windows 0/1, Linux 45/46 in the full regex,_ZNKSt8messagesIcE4openERKSsRKSt6locale_nid_postfix not implemented) and passes again once the change is restored.MSYS_NO_PATHCONV=1 python3 tools/check_conventions.py --base origin/main --title <title> --body <this body>:All conventions checks passed.python3 tools/pr_overlap.py --branch feat/r3-messages-char(1831 open PRs) failed closed. It reported line overlaps with feat(libc): implement legacy signal masks #10392, feat(libSceLibcInternal): implement _readdir_unlocked and _seekdir #13881, feat(libSceLibcInternal): implement __kernel_rem_pio2 #14158, feat(libSceLibcInternal): answer the codecvt and messages queries as firmware 13.42 does #15582, feat(libSceLibcInternal): implement basic_string erase, append, assign, _Xran and _Xlen #15692, feat(libSceLibcInternal): implement collate<char> compare, hash and do_* members #15711 and feat(libSceLibcInternal): implement num_put<char>::put and time_put<char>::put #15715. It could not compare feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021, fix(libs): share Sony CRT handler and lconv state between libc and libSceAmpr #7081, feat(libc): add std::__sce_v2::_Random_device, _Fiopen and setw #9526, feat(libc): export the messages facet vtable as data #10158, fix(libc): size the codecvt facet vtable to 104 bytes #10165, feat(libc): export the numpunct facet vtable as data #10200, feat(libc): export the time_put facet vtable as data #12510, feat(libc): export the money_get facet vtable as data #12511, feat(libc): export the money_put facet vtable as data #12518, feat(libc): export the wide time_put facet vtable as data #12704, fix(relinker): match AppContent utility import to provider #13486, feat(libSceLibcInternal): implement the msun trigonometric kernels #13778, feat(libSceLibcInternal): implement floating-point word access #13782, docs(debt): separate entries with blank lines and drop derived export totals #14212, feat(libSceLibcInternal): implement zero-return showmanyc exports #14401, feat(libSceLibcInternal): implement the placement operator delete and delete[] #14837 and feat(libSceLibcInternal): implement std::_MP_Add, _MP_Get, _MP_Mul and _MP_Rem #14936 because they conflict with main. A grep of the added lines of all 24 PRs for the four NIDs, the four mangled names,MessagesVtable,AssignString,StringDataand the new file names found one hit only: feat(libc): export the messages facet vtable as data #10158 adds the_ZTVSt8messagesIcEvtable data object (nine zeroed slots), a different symbol this PR does not touch. The rest are textual. Open feat(libSceLibcInternal): answer the codecvt and messages queries as firmware 13.42 does #15582 (BunnyFl) implements themessages<char>do_open/do_close(HeBwePMtuFs,rRmMX83UL1E, thePending4_007/008stubs), not these four NIDs, and it edits those stubs inExport.cppright next to the ones removed here, and the neighbouring debt lines:git merge-treeof this branch with its head (40c1005) reports a textual conflict incore/libs/prx/libSceLibcInternal/Export.cppanddocs/dev/debt/libSceLibcInternal.md. Keeping both sides resolves it, and whichever PR lands second rebases. feat(libSceLibcInternal): implement __kernel_rem_pio2 #14158, feat(libSceLibcInternal): implement basic_string erase, append, assign, _Xran and _Xlen #15692, feat(libSceLibcInternal): implement collate<char> compare, hash and do_* members #15711 and feat(libSceLibcInternal): implement num_put<char>::put and time_put<char>::put #15715 add sources at the same line oflibSceLibcInternal/CMakeLists.txt. feat(libc): implement legacy signal masks #10392 and feat(libSceLibcInternal): implement _readdir_unlocked and _seekdir #13881 touch neighbouring lines ofApi.hppand the debt file.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code