feat(proc, stub): expose GetMarkStubAddr API to scan and record memory partially by intrusively insert stub address in struct definition#75
Open
Lslightly wants to merge 8 commits into
Conversation
adjust stubaddr testcase to show the function of --usemarkstub
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 type of PR is this?
feat
Check the PR title.
(Optional) Translate the PR title into Chinese.
暴露
GetMarkStubAddrAPI,通过在结构体定义中侵入式插入桩地址实现内存部分扫描和记录(Optional) More detailed description for this PR(en: English/zh: Chinese).
en: The most significant modification is in pkg/proc/reference.go. A
markContextis introduced to indicate whether an object or a field can be recorded.markContext.useMarkStubis always true/false depending on whether--usemarkstuboption is enabled.markContext.enableRecordis true when the stub address is found or an object is referenced directly/indirectly by other objects which contain the stub address.The testcase is
test/testdata/stubaddr/main.go. There are two sessions, one session with stub address whilemarkStubof the other one is nil. Only the former session's objects will be recorded using the commandgrf attach <pid> --usemarkstubzh(optional):
(Optional) Which issue(s) this PR fixes:
Fixes #71
(optional) The PR that updates user documentation: