-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set thread names for game threads #666
base: main
Are you sure you want to change the base?
Conversation
Uh, where can I see the thread names? ^^" |
Many tools, like x64dbg, Very Sleepy debugger, probably in various "process explorer" kind of programs too. Also worth noting for future reference from RoyalBlue:
The above and possibly bink could also be added, but unfortunately for now I cannot be arsed to do that. They might be done in a separate PR though, so I leave that for future reference here. This PR alone makes the situation much nicer already by naming game threads... |
Oh also one more thing, this doesn't set the name of MainThread as the hook is done too late. The thread that does the hooking is 99% the main thread, but that should be tested and then when the hook is performed it should set the name of its own thread to "MainThread" then. |
the real fix for this is to use tier0 to make threads so your TLS gets set up correctly |
I was told the comment above is not really relevant to the PR... |
Adds nice thread names that can be visible in crash dumps, non-attachable debuggers and generally in all places where old method of throwing exceptions to attached debugger on game start wouldn't work:
Can't believe it wasn't already there lol, makes debugging pain without.
Also the method to convert charsets is bad, but that's not my fault, seems Northstar doesn't have any util func for that apparently either, and this "method" was used in some other places in the codebase where it didn't belong. As thread names are generally static it should be fine in this place, but still.
Tested to work as you can see on the screenshot.