Debugger: Wait for the entry point to run before scanning from memory #12195
+74
−18
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.
Description of Changes
The symbol importer thread will now wait for the entry point to run before scanning for functions from memory.
I've used
std::condition_variable
to implement it so hopefully there won't be any deadlock issues this time.Rationale behind Changes
When I modified the function scanner to scan the ELF file, I removed the code to sync the symbol importer thread with the CPU thread because it was broken, but when I reintroduced support for scanning from memory I forgot to reintroduce it.
Previously this meant that if the
Scan From Memory
option was selected from the global or per-game settings dialogs (not from the analysis options dialog in the debugger as that won't affect boot) the function scanner could run before the game's code was actually loaded in memory. This could be fixed by doing another analysis run, which if you've selected theScan From Memory
option is probably what you want to do anyway, but it's still good to fix this.Suggested Testing Steps
Perform a bunch of operations that change the VM state e.g. rebooting, loading/saving save states, etc.