fix(db_info): report real program metadata for the active program (#1) - #9
Merged
Conversation
In headless mode (and any session where the client never issued an explicit OpenProgram), db_info reported program_name='active-program' with empty language_id/compiler_spec and image_base=0, because opened_program_ was never populated. The host does know the active program: GetRevision returns its path. db_info now resolves the active program from the revision and best-effort opens it to fill name/language/compiler/image_base, falling back to the real program path (not 'active-program') if the open fails. The analysis-query path is unchanged -- it already runs against the active program, so there is no regression. md5/sha256 stay empty: the host's OpenProgram response doesn't carry them.
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.
Problem
In headless mode (and any session where the client never issued an explicit
OpenProgram),db_inforeported placeholder metadata —program_name = "active-program", emptylanguage_id/compiler_spec,image_base = 0— even though a program was fully loaded and analysis queries worked. Reported in #1.Root cause:
read_program_info()only filled metadata fromopened_program_, which is never set on the headless path; neitherGetStatusnorGetRevisioncarrieslanguage_id/image_base.Fix
db_infonow resolves the active program's path fromGetRevision(which the host always knows) and best-effortOpenPrograms it to populateprogram_name/language_id/compiler_spec/image_base. If the open fails it falls back to the real program path instead of the"active-program"placeholder. The analysis-query path is untouched — it already runs against the active program, so there is no regression (verified).md5/sha256remain empty: the host'sOpenProgramresponse doesn't carry them (separate, host-side gap).Verification
t_linux.ox86:LE:64:defaultgcc0x100000/bin/ls(after)lsx86:LE:64:defaultgcc0x100000000Analysis queries unchanged across the fix: funcs 9 / 136, names/instructions intact.