Skip to content

Commit bc6899f

Browse files
authored
[lldb] Exclude redundant task flags from summary (#10374)
Don't show `future` or `childTask` flags in a Task's summary. First, `future` is not an official term in Swift Concurrency. There's undetermined value in showing this. From my reading of the concurrency runtime, in non-embedded Swift all tasks have the flag `isFuture`. For embedded Swift it's _unset_ for all tasks. Second, child tasks are already indicated with either `groupChildTask`, or `asyncLetTask`. Both values are still available on demand, ex `p task.isFuture` or `p task.isChildTask`. This change is to reduce the quantity of data in the summary, because a subsequent change will add the Task's name in its summary.
1 parent 7194803 commit bc6899f

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

lldb/source/Plugins/Language/Swift/SwiftFormatters.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,8 +1838,6 @@ static const std::pair<StringRef, StringRef> TASK_FLAGS[] = {
18381838
{"isEnqueued", "enqueued"},
18391839
{"isGroupChildTask", "groupChildTask"},
18401840
{"isAsyncLetTask", "asyncLetTask"},
1841-
{"isChildTask", "childTask"},
1842-
{"isFuture", "future"},
18431841
{"isStatusRecordLocked", "statusRecordLocked"},
18441842
};
18451843

lldb/test/API/lang/swift/async/continuations/TestSwiftContinuationSynthetic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_unsafe_continuation_printing(self):
2020
textwrap.dedent(
2121
r"""
2222
\(UnsafeContinuation<Void, Never>\) cont = \{
23-
task = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?future \{
23+
task = id:(\d+) flags:(?:running|enqueued) \{
2424
address = 0x[0-9a-f]+
2525
id = \1
2626
enqueuePriority = 0
@@ -45,7 +45,7 @@ def test_checked_continuation_printing(self):
4545
textwrap.dedent(
4646
r"""
4747
\(CheckedContinuation<Int, Never>\) cont = \{
48-
task = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?future \{
48+
task = id:(\d+) flags:(?:running|enqueued) \{
4949
address = 0x[0-9a-f]+
5050
id = \1
5151
enqueuePriority = 0

lldb/test/API/lang/swift/async/formatters/task/TestSwiftTaskSyntheticProvider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_top_level_task(self):
2121
patterns=[
2222
textwrap.dedent(
2323
r"""
24-
\(Task<\(\), Error>\) task = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?future \{
24+
\(Task<\(\), Error>\) task = id:(\d+) flags:(?:running|enqueued) \{
2525
address = 0x[0-9a-f]+
2626
id = \1
2727
enqueuePriority = \.medium
@@ -45,7 +45,7 @@ def test_current_task(self):
4545
patterns=[
4646
textwrap.dedent(
4747
r"""
48-
\(UnsafeCurrentTask\) currentTask = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?asyncLetTask|childTask|future \{
48+
\(UnsafeCurrentTask\) currentTask = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?asyncLetTask \{
4949
address = 0x[0-9a-f]+
5050
id = \1
5151
enqueuePriority = \.medium

lldb/test/API/lang/swift/async/formatters/task/children/TestSwiftSyntheticTaskChildren.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ def test(self):
2020
patterns=[
2121
textwrap.dedent(
2222
r"""
23-
\(UnsafeCurrentTask\) current_task = id:1 flags:(?:running\|)?(?:enqueued\|)?future \{
23+
\(UnsafeCurrentTask\) current_task = id:1 flags:(?:running|enqueued) \{
2424
address = 0x[0-9a-f]+
2525
id = 1
2626
enqueuePriority = 0
2727
children = \{
28-
0 = id:2 flags:(?:running\|)?(?:enqueued\|)?asyncLetTask\|childTask\|future \{
28+
0 = id:2 flags:(?:running\|)?(?:enqueued\|)?asyncLetTask \{
2929
address = 0x[0-9a-f]+
3030
id = 2
3131
enqueuePriority = \.medium

lldb/test/API/lang/swift/async/taskgroups/TestSwiftTaskGroupSynthetic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ def do_test_print(self):
3232
textwrap.dedent(
3333
r"""
3434
\((?:Throwing)?TaskGroup<\(\)\??(?:, Error)?>\) group = \{
35-
\[0\] = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?groupChildTask\|childTask\|future \{
35+
\[0\] = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?groupChildTask \{
3636
address = 0x[0-9a-f]+
3737
id = \1
3838
enqueuePriority = \.medium
3939
children = \{\}
4040
\}
41-
\[1\] = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?groupChildTask\|childTask\|future \{
41+
\[1\] = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?groupChildTask \{
4242
address = 0x[0-9a-f]+
4343
id = \2
4444
enqueuePriority = \.medium
4545
children = \{\}
4646
\}
47-
\[2\] = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?groupChildTask\|childTask\|future \{
47+
\[2\] = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?groupChildTask \{
4848
address = 0x[0-9a-f]+
4949
id = \3
5050
enqueuePriority = \.medium

0 commit comments

Comments
 (0)