Repository navigation
Conversation
- Add InlinedCall struct and InlinedList field to FuncMetadata - Add add(), multiply(), neverInlined() to testproject - Add comprehensive inline test suite (positive + negative cases) - Positive tests intentionally fail — implementation not yet written
Constant arguments let the compiler fold add(1,2)/multiply(3,4) into literals at compile time, leaving no inline-tree evidence to recover regardless of extraction-code correctness. Deriving from len(os.Args) forces the compiler to keep real, recoverable inlined instructions. Also strengthen main_test.go to check for main.multiply by name, not just main.add, now that both are genuinely recoverable.
…functions # Conflicts: # testproject/main.go
Reads moduledata.gofunc (go:func.* base) via the existing per-version layout tables, needed for FUNCDATA_InlTree offsets (issue mandiant#53). Offset 320/64-bit, 160/32-bit verified against runtime source and a real test binary; the Go 1.26-only layout bucket is left unset rather than guessed.
Contributor
Author
|
@stevemk14ebr Hello Any update on this? or should I just pull in next commit lemme know your response. |
Collaborator
|
You are free to continue work if you like. If you do we would prefer the tree version and would want a single final and complete PR |
…ng design (issue mandiant#53) - InlinedCall gains ParentIndex int (-1 = parent is ParentEntry; else index of another record in the same InlinedList). - testproject/main.go: new nestedOuter/nestedInner fixture (ported from learning/03_nested_inline) exercising real 2-level mid-stack inlining, with the sink-write trick so nestedInner can't be constant-folded away. - main_test.go: new positive assertion that nestedInner.ParentIndex resolves to nestedOuter's own index, not flattened to main.main -- the check that would have caught the flat design. No extraction logic changed -- these assertions are intentionally failing until the InlTree parsing commits land.
npcdata(), nfuncdata(), pcdataOffset(), funcdataOffset() on funcData, following the existing field() pattern. nfuncdata() and the new headerSize() helper derive their byte offset from sz0 (same computation field() already does) instead of hardcoding 43/44, so they stay correct for Go 1.18+ on any bitness rather than only the one binary this was hand-verified against. Not yet called anywhere -- wiring these into real InlTree parsing is the next commit.
…ant#53) decodePcValueRanges() walks the same delta-encoded pc-value table pcvalue() already reads (LEB128 varint + zigzag via step()), but returns every (value, pcStart, pcEnd) transition instead of stopping at one target PC -- needed later to find every disjoint chunk belonging to a given InlTree record. countInlineRecords() derives the record count as max(all non-negative values) + 1, Delve's approach (maxInlineTreeIndexValue()) -- nothing on disk states the count directly. Verified against hand-decoded data on learning/01_basic_inline and learning/02_runtime_inline. Not yet wired to anything -- InlTree record parsing is next.
Contributor
Author
|
@stevemk14ebr Please review when you get time and let know how to proceed further. Please note the CI tests will still fail and that is expected because there is nothing to be wired in significantly. |
Collaborator
|
Please work to a complete PR, I will review at that point. |
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.
closes #53
PR attempts implementation to recover inline functions
reference PR #59