Skip to content

[lldb] Add synthetic formatter for Swift.TaskGroup #10143

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

Conversation

kastiglione
Copy link

@kastiglione kastiglione commented Mar 1, 2025

Add synthetic data formatter for TaskGroup. This formatter prints the group's tasks using the previously added formatter for Task.

@kastiglione kastiglione requested a review from a team as a code owner March 1, 2025 00:50
@kastiglione kastiglione marked this pull request as draft March 1, 2025 00:50

operator bool() const { return addr && addr != LLDB_INVALID_ADDRESS; }

static constexpr offset_t JobFlagsOffset = 0x20;

Choose a reason for hiding this comment

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

Are these offsets dependent on the target architecture or are they host offsets?

Copy link
Author

Choose a reason for hiding this comment

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

I'll check. I think so, but your question made me realize I have made some assumptions that I'll need to check.

Copy link
Author

Choose a reason for hiding this comment

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

I realized I can get rid of some of these offsets.

Copy link
Author

Choose a reason for hiding this comment

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

@adrian-prantl on review, I think these offsets will need to be adjusted for arm64_32.

Choose a reason for hiding this comment

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

I would try to compute them as multiples of the pointer size of the target, and in addition verify that the Swift concurrency version (there's a new special symbol for this now) on the target is still 1 and error out otherwise.

Copy link
Author

Choose a reason for hiding this comment

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

yes this PR checks the swift concurrency version symbol.

I will merge this with 64 bit support and then setup a test for watchOS update for arm64_32 in a follow up.

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione kastiglione marked this pull request as ready for review March 3, 2025 19:59
@kastiglione
Copy link
Author

@swift-ci test

)
self.expect(
"v group",
substrs=[

Choose a reason for hiding this comment

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

While this probably covers it, It would be slightly better to test GetChildWithName/GetChildAtIndex/GetNumChildren separately, since they are implemented separately, too.

Copy link
Author

Choose a reason for hiding this comment

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

will do

Copy link
Author

Choose a reason for hiding this comment

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

Added a new test in 31845cf

Copy link
Author

Choose a reason for hiding this comment

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

Good call, I had a StringRef bug in GetIndexOfChildWithName

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione kastiglione merged commit 065c58e into stable/20240723 Mar 4, 2025
3 checks passed
@kastiglione kastiglione deleted the dl/lldb-Add-synthetic-formatter-for-Swift.TaskGroup branch March 4, 2025 17:47
kastiglione added a commit that referenced this pull request Mar 5, 2025
Add synthetic data formatter for `TaskGroup`. This formatter prints the group's tasks using the previously added formatter for `Task`.

(cherry-picked from commit 065c58e)
kastiglione added a commit that referenced this pull request Mar 5, 2025
Add synthetic data formatter for `TaskGroup`. This formatter prints the group's tasks using the previously added formatter for `Task`.

(cherry-picked from commit 065c58e)
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.

2 participants