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

refactor: use code generate for moduledata #77

Merged
merged 12 commits into from
Feb 9, 2024
Merged

Conversation

Zxilly
Copy link
Contributor

@Zxilly Zxilly commented Jan 24, 2024

I'd like to use this PR as part of the continue work of #69.

@TcM1911 Can you review this?

@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2024

Codecov Report

Attention: 47 lines in your changes are missing coverage. Please review.

Comparison is base (777e08b) 75.52% compared to head (fd5a0f2) 78.99%.

Files Patch % Lines
file.go 62.50% 13 Missing and 8 partials ⚠️
moduledata.go 68.33% 12 Missing and 7 partials ⚠️
elf.go 55.55% 3 Missing and 1 partial ⚠️
moduledata_gen.go 99.76% 2 Missing ⚠️
pe.go 85.71% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #77      +/-   ##
===========================================
+ Coverage    75.52%   78.99%   +3.47%     
===========================================
  Files           14       15       +1     
  Lines         2680     3480     +800     
===========================================
+ Hits          2024     2749     +725     
- Misses         446      514      +68     
- Partials       210      217       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Zxilly Zxilly changed the title fix: add compatibility for external linker cases refactor: use moduledata search based implementation Jan 31, 2024
@Zxilly Zxilly changed the title refactor: use moduledata search based implementation refactor: use pclntab search based implementation Jan 31, 2024
@Zxilly
Copy link
Contributor Author

Zxilly commented Jan 31, 2024

Some of code from #69.

@Zxilly Zxilly marked this pull request as draft January 31, 2024 20:03
@Zxilly Zxilly changed the title refactor: use pclntab search based implementation refactor: use pclntab search based implementation (WIP) Jan 31, 2024
@Zxilly Zxilly changed the title refactor: use pclntab search based implementation (WIP) refactor: use code generate for moduledata Jan 31, 2024
@Zxilly Zxilly marked this pull request as ready for review January 31, 2024 20:41
@TcM1911
Copy link
Member

TcM1911 commented Feb 1, 2024

Very nice! I've wanted to clean up the generation code for a long time. I really appreciate this PR.

There is a "bug" in the generation code for std packages that's been present since the beginning, and maybe you want to tackle it too. The logic will always use the "current" available packages from the Go repo. So when they remove internal packages or move things around, the "old" packages are removed from the list. This causes the package detection for older binaries to get worse with newer versions of Gore. The proper way to handle this would be to append only new packages to the list and not regenerate it every time. We also will have to recover the packages that has been removed and re-add them to the list. This could probably be done from Gore's git history.

@Zxilly
Copy link
Contributor Author

Zxilly commented Feb 1, 2024

It has been implemented. Plz check the stdpkgs.go
I implement it by searching all the minor release version of golang, then merge them.

@Zxilly
Copy link
Contributor Author

Zxilly commented Feb 1, 2024

I'm writing an auto generate logic for moduledata. Playing with ast is not easy and may take some hours.

@Zxilly
Copy link
Contributor Author

Zxilly commented Feb 1, 2024

Now moduledata will auto generate from golang codebase.

@TcM1911 I think this PR is ready for review.

@Zxilly
Copy link
Contributor Author

Zxilly commented Feb 4, 2024

Any updates?

@Zxilly
Copy link
Contributor Author

Zxilly commented Feb 9, 2024

If there any problem blocking the merge process please let me know

@TcM1911
Copy link
Member

TcM1911 commented Feb 9, 2024

Sorry @Zxilly, I've just been very busy. I will take a look at this today. There are some conflicts, can you fix them?

@Zxilly
Copy link
Contributor Author

Zxilly commented Feb 9, 2024

conflict resolved.

elf.go Show resolved Hide resolved
@TcM1911 TcM1911 merged commit 7b68ef2 into goretk:develop Feb 9, 2024
3 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.

5 participants