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

[Backtracing][Linux] Support the DW_AT_specification attribute. #67592

Merged

Conversation

DianQK
Copy link
Contributor

@DianQK DianQK commented Jul 28, 2023

Support parsing the following format:

0x0000104b: DW_TAG_subprogram
              DW_AT_specification (0x00000d23 "$s8CrashOpt6level1yyF")
              DW_AT_inline (DW_INL_inlined)

After #67077, a DWARF in the following format may be generated:

0x00000d58:       DW_TAG_subprogram
                    DW_AT_linkage_name	("$s8CrashOpt0A0V5$mainyyFZ")
                    DW_AT_name	("$main")
                    DW_AT_type	(0x00000f65 "$sytD")
                    DW_AT_declaration	(true)
                    DW_AT_external	(true)
                    DW_AT_APPLE_optimized	(true)
...
0x00000d9d:         DW_TAG_inlined_subroutine
                      DW_AT_abstract_origin	(0x000011d2 "$s8CrashOpt0A0V5$mainyyFZ")
                      DW_AT_ranges	(0x00000210
                         [0x00000000000011e0, 0x00000000000012f3)
                         [0x00000000000012fb, 0x0000000000001307))
                      DW_AT_call_file	("/home/dianqk/Projects/swift-project/swift/test/Backtracing/Crash.swift")
                      DW_AT_call_line	(0)
...
0x000011d2:   DW_TAG_subprogram
                DW_AT_specification	(0x00000d58 "$s8CrashOpt0A0V5$mainyyFZ")
                DW_AT_inline	(DW_INL_inlined)

Copy link
Contributor

@al45tair al45tair left a comment

Choose a reason for hiding this comment

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

LGTM, though I wonder whether we should check the tag on the thing pointed to by the DW_AT_specification to make sure it's a subprogram, which is what we expect I think.

stdlib/public/Backtracing/Dwarf.swift Show resolved Hide resolved
@al45tair
Copy link
Contributor

@swift-ci Please smoke test

Support parsing the following format:
```
0x0000104b: DW_TAG_subprogram
              DW_AT_specification (0x00000d23 "$s8CrashOpt6level1yyF")
              DW_AT_inline (DW_INL_inlined)
```
@DianQK DianQK force-pushed the support-the-DW_AT_specification-attribute branch from 0e686cf to 017d31f Compare July 31, 2023 23:00
@al45tair
Copy link
Contributor

al45tair commented Aug 1, 2023

@swift-ci Please smoke test

@DianQK
Copy link
Contributor Author

DianQK commented Aug 5, 2023

@al45tair Could you help me invoke swift-ci and merge changes again? Test case failures look like the CI instability?

@al45tair
Copy link
Contributor

al45tair commented Aug 6, 2023

@swift-ci Please smoke test linux platform

@al45tair al45tair merged commit 5429100 into swiftlang:main Aug 6, 2023
3 checks passed
@DianQK DianQK deleted the support-the-DW_AT_specification-attribute branch August 6, 2023 12:25
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