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

[SR-2273] Struct fields are not represented in Swift 3.0 DSYM. #44880

Open
swift-ci opened this issue Aug 4, 2016 · 5 comments
Open

[SR-2273] Struct fields are not represented in Swift 3.0 DSYM. #44880

swift-ci opened this issue Aug 4, 2016 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself debug info Area → compiler → IRGen: Debug information emission

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Aug 4, 2016

Previous ID SR-2273
Radar None
Original Reporter delkind (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 2
Component/s Compiler
Labels Bug, DebugInfo
Assignee None
Priority Medium

md5: 60b56867bc7972257aa0b3c9479e1e9e

relates to:

  • SR-7809 Define layout algorithm for structs

Issue Description:

There is no field information in the struct information in DSYM, just property methods and total struct size. Field information is necessary for deducing struct layout when it is passed as a function parameter in register(s).

Using one of the property methods (for instance, get()) seems problematic because of computed properties.

Example:

Code
struct TestStruct31 {
var float0: Float = 0;
var double1: Double = 1;
}

Dwarfdump output:
0x0001d442: TAG_structure_type [4] *
AT_name( "TestStruct31" )
AT_linkage_name( "_TtV8SwiftApp12TestStruct31" )
AT_byte_size( 0x10 )
AT_decl_line( 4 )
AT_APPLE_runtime_class( 0x1e )

0x0001d44f: TAG_subprogram [5] *
AT_low_pc( 0x00166d50 )
AT_high_pc( 0x00166d74 )
AT_frame_base( r7 )
AT_MIPS_linkage_name( "_TFV8SwiftApp12TestStruct31g6float0Sf" )
AT_name( "float0.get" )
AT_decl_line( 5 )
AT_type( {0x0001f32b} ( Float ) )
AT_external( 0x01 )
AT_APPLE_isa( 0x02 )

0x0001d46a: TAG_formal_parameter [6]
AT_location( sp+0 )
AT_name( "self" )
AT_decl_line( 5 )
AT_type( {0x0001d442} ( TestStruct31 ) )
AT_artificial( 0x01 )

0x0001d479: NULL

0x0001d47a: TAG_subprogram [5] *
AT_low_pc( 0x00166d74 )
AT_high_pc( 0x00166d94 )
AT_frame_base( r7 )
AT_MIPS_linkage_name( "_TFV8SwiftApp12TestStruct31s6float0Sf" )
AT_name( "float0.set" )
AT_decl_line( 5 )
AT_type( {0x0001f383} ( TtT ) )
AT_external( 0x01 )
AT_APPLE_isa( 0x02 )

0x0001d495: TAG_formal_parameter [7]
AT_location( sp+0 )
AT_name( "value" )
AT_decl_line( 5 )
AT_type( {0x0001f32b} ( Float ) )

0x0001d4a3: TAG_formal_parameter [6]
AT_location( sp+4 )
AT_name( "self" )
AT_decl_line( 5 )
AT_type( {0x0001f3a3} ( _TtRV8SwiftApp12TestStruct31 ) )
AT_artificial( 0x01 )

0x0001d4b2: NULL

0x0001d4b3: TAG_subprogram [8]
AT_low_pc( 0x00166d94 )
AT_high_pc( 0x00166db4 )
AT_frame_base( r7 )
AT_MIPS_linkage_name( "_TFV8SwiftApp12TestStruct31m6float0Sf" )
AT_name( "float0.materialize" )
AT_type( {0x0001f38e} ( TtTBpGSqBp_ ) )
AT_external( 0x01 )
AT_APPLE_isa( 0x02 )

0x0001d4cc: TAG_subprogram [5] *
AT_low_pc( 0x00166db4 )
AT_high_pc( 0x00166dd8 )
AT_frame_base( r7 )
AT_MIPS_linkage_name( "_TFV8SwiftApp12TestStruct31g7double1Sd" )
AT_name( "double1.get" )
AT_decl_line( 6 )
AT_type( {0x0001f336} ( Double ) )
AT_external( 0x01 )
AT_APPLE_isa( 0x02 )

0x0001d4e7: TAG_formal_parameter [6]
AT_location( sp+0 )
AT_name( "self" )
AT_decl_line( 6 )
AT_type( {0x0001d442} ( TestStruct31 ) )
AT_artificial( 0x01 )

0x0001d4f6: NULL

0x0001d4f7: TAG_subprogram [5] *
AT_low_pc( 0x00166dd8 )
AT_high_pc( 0x00166e04 )
AT_frame_base( r7 )
AT_MIPS_linkage_name( "_TFV8SwiftApp12TestStruct31s7double1Sd" )
AT_name( "double1.set" )
AT_decl_line( 6 )
AT_type( {0x0001f383} ( TtT ) )
AT_external( 0x01 )
AT_APPLE_isa( 0x02 )

0x0001d512: TAG_formal_parameter [7]
AT_location( sp+0 )
AT_name( "value" )
AT_decl_line( 6 )
AT_type( {0x0001f336} ( Double ) )

0x0001d520: TAG_formal_parameter [6]
AT_location( sp+8 )
AT_name( "self" )
AT_decl_line( 6 )
AT_type( {0x0001f3a3} ( _TtRV8SwiftApp12TestStruct31 ) )
AT_artificial( 0x01 )

0x0001d52f: NULL

0x0001d530: TAG_subprogram [8]
AT_low_pc( 0x00166e04 )
AT_high_pc( 0x00166e28 )
AT_frame_base( r7 )
AT_MIPS_linkage_name( "_TFV8SwiftApp12TestStruct31m7double1Sd" )
AT_name( "double1.materialize" )
AT_type( {0x0001f38e} ( TtTBpGSqBp_ ) )
AT_external( 0x01 )
AT_APPLE_isa( 0x02 )

0x0001d549: TAG_subprogram [9]
AT_low_pc( 0x00166e28 )
AT_high_pc( 0x00166e40 )
AT_frame_base( r7 )
AT_MIPS_linkage_name( "TFV8SwiftApp12TestStruct31CfT6float0Sf7double1Sd_S0" )
AT_name( "init" )
AT_decl_line( 4 )
AT_type( {0x0001d442} ( TestStruct31 ) )
AT_external( 0x01 )
AT_APPLE_isa( 0x02 )

0x0001d564: TAG_subprogram [5] *
AT_low_pc( 0x00166e40 )
AT_high_pc( 0x00166e7c )
AT_frame_base( r7 )
AT_MIPS_linkage_name( "TFV8SwiftApp12TestStruct31CfT_S0" )
AT_name( "init" )
AT_decl_line( 4 )
AT_type( {0x0001d442} ( TestStruct31 ) )
AT_external( 0x01 )
AT_APPLE_isa( 0x02 )

0x0001d57f: TAG_formal_parameter [6]
AT_location( sp+0 )
AT_name( "self" )
AT_decl_line( 4 )
AT_type( {0x0001d442} ( TestStruct31 ) )
AT_artificial( 0x01 )

0x0001d58e: NULL

0x0001d58f: NULL

@belkadan
Copy link
Contributor

belkadan commented Aug 4, 2016

I'm not sure what good the field information would do for you because Swift's calling convention isn't the same as C's.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Aug 4, 2016

Comment by David Elkind (JIRA)

That's something I already took care of. I realize this might also be changed in Swift 3.0, but I can take care of it too.

@Dante-Broggi
Copy link
Contributor

I think this relates to struct ABI, if not please correct.

Also, if this is resolved, it should be marked as such.

@belkadan
Copy link
Contributor

cc @adrian-prantl, when he gets back. This gets a lot more complicated with resilient structs, too.

@adrian-prantl
Copy link
Member

Is this with -gfull-types? May I ask why you are interested in this information? What's your use-case?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself debug info Area → compiler → IRGen: Debug information emission
Projects
None yet
Development

No branches or pull requests

4 participants