Skip to content
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

proc: some refactorings for supporting struct literals #3909

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

aarzilli
Copy link
Member

  • deduplicates exprToString, defined in multiple packages, and moves it
    to astutil
  • moves resolveTypedef into pkg/dwarf/godwarf, this is currently only
    used by pkg/proc but we will need to call it from pkg/proc/evalop
  • creates a new FakePointerType function in pkg/dwarf/godwarf, this is
    also a function that is only used by pkg/proc but pkg/proc/evalop will
    also need.

Updates #1465

Copy link
Member

@derekparker derekparker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM just needs some doc comments.

@@ -43,3 +45,9 @@ func Or(x, y ast.Expr) ast.Expr {
}
return &ast.BinaryExpr{Op: token.LOR, X: x, Y: y}
}

func ExprToString(t ast.Expr) string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a doc comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -1101,3 +1101,16 @@ func zeroArray(t Type) {
t = at.Type
}
}

func ResolveTypedef(typ Type) Type {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a doc comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

* deduplicates exprToString, defined in multiple packages, and moves it
  to astutil
* moves resolveTypedef into pkg/dwarf/godwarf, this is currently only
  used by pkg/proc but we will need to call it from pkg/proc/evalop
* creates a new FakePointerType function in pkg/dwarf/godwarf, this is
  also a function that is only used by pkg/proc but pkg/proc/evalop will
  also need.

Updates go-delve#1465
Copy link
Member

@derekparker derekparker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@derekparker derekparker merged commit 62cd2d4 into go-delve:master Feb 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants