-
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
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... |
Fails to build after updating with |
I guess the CModule class was refactored in master |
Any chance you could update the PR so that we can merge 👉👈 |
CI still failing btw @p0358 |
Co-authored-by: Maya <11448698+RoyalBlue1@users.noreply.github.com>
9257ed4
to
c4dc792
Compare
Merge with rebase maybe, I rebased it to two distinct commits on top of main |
Will consider, thanks <3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified that it still runs fine on Linux. This is more of a breakage check than a functionality check though tbh...
Would appreciate if someone could give this code review, since I have switched the hooks over to be manually hooked instead of using autohook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good (although I am a bit biased since I converted the hooks to manually hooking) other than the stuff indicated by the comments. Fixing that would be beyond the scope of the PR though so it shouldn't block anything
@F1F7Y Any chance you could sanity check the stuff that I wrote? Would prefer to not be reviewing my own code in a PR if possible |
Hehe I can't physically do an approving review on my own PR lol. But yeah it does seem to look okay... |
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
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.