1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>Debugging Information Extension for Objective C Properties</title>
7 <link rel="stylesheet" href="llvm.css" type="text/css">
12 Debugging Information Extension for Objective C Properties
16 <li><a href="#introduction">Introduction</a></li>
17 <li><a href="#proposal">Proposal</a></li>
18 <li><a href="#newattributes">New DWARF Attributes</a></li>
19 <li><a href="#newconstants">New DWARF Constants</a></li>
23 <div class="doc_author">
24 <p>Written by Jim Ingham and Devang Patel </p>
27 <!-- *********************************************************************** -->
29 <a name="introduction">Introduction</a>
31 <!-- *********************************************************************** -->
34 <p>Objective C provides a simpler way to declare and define accessor methods
35 using declared properties. The language provides features to declare a
36 property and to let compiler synthesize accessor methods.
39 <p>The debugger lets developer inspect Objective C interfaces and their
40 instance variables and class variables. However, the debugger does not know
41 anything about the properties defined in Objective C interfaces. The debugger
42 consumes information generated by compiler in DWARF format. The format does
43 not support encoding of Objective C properties. This proposal describes DWARF
44 extensions to encode Objective C properties, which the debugger can use to let
45 developers inspect Objective C properties.
51 <!-- *********************************************************************** -->
53 <a name="proposal">Proposal</a>
55 <!-- *********************************************************************** -->
58 <p>Objective C properties are always backed by an instance variable. The
59 instance variables backing properties are identified using
60 DW_AT_APPLE_property_name attribute. The instance variables with this
61 attribute may not have data location attributes. The location of instance
62 variables is determined by debugger only after consulting Objective C runtime.
65 <div class="doc_code">
81 TAG_structure_type [7] *
82 AT_APPLE_runtime_class( 0x10 )
84 AT_decl_file( "Objc_Property.m" )
89 AT_APPLE_property_name(“p1”)
90 AT_type( {0x00000147} ( int ) )
94 AT_APPLE_property_name(“p2”)
95 AT_type( {0x00000147} ( int ) )
99 <p> Developers can decorate a property with attributes which are encoded using
100 DW_AT_APPLE_property_attribute.
103 <div class="doc_code">
105 @property (readonly, nonatomic) int pr;
110 AT_APPLE_property_name(“pr”)
111 AT_type ( {0x00000147} (int) )
112 AT_APPLE_property_attribute (DW_APPLE_PROPERTY_readonly, DW_APPLE_PROPERTY_nonatomic)
116 <p> The setter and getter method names are attached to the property using
117 DW_AT_APPLE_property_setter and DW_AT_APPLE_property_getter attributes.
119 <div class="doc_code">
122 @property (setter=myOwnP3Setter:) int p3;
123 -(void)myOwnP3Setter:(int)a;
128 -(void)myOwnP3Setter:(int)a{ }
131 0x000003bd: TAG_structure_type [7] *
132 AT_APPLE_runtime_class( 0x10 )
134 AT_decl_file( "Objc_Property.m" )
136 0x000003f3: TAG_member [8]
138 AT_APPLE_property_name(“p3”)
139 AT_APPLE_property_setter(“myOwnP3Setter:”)
140 AT_type( {0x00000147} ( int ) )
146 <!-- *********************************************************************** -->
148 <a name="newattributes">New DWARF Attributes</a>
150 <!-- *********************************************************************** -->
153 <table border="1" cellspacing="0">
155 <th width=200 >Attribute</th>
156 <th width=200 >Value</th>
157 <th width=200 >Classes</th>
160 <td width=200 >DW_AT_APPLE_property_name</td>
161 <td width=200 >0x3fe8</td>
162 <td width=200 >String</td>
165 <td width=200 >DW_AT_APPLE_property_getter</td>
166 <td width=200 >0x3fe9</td>
167 <td width=200 >String</td>
170 <td width=200 >DW_AT_APPLE_property_setter</td>
171 <td width=200 >0x3fea</td>
172 <td width=200 >String</td>
175 <td width=200 >DW_AT_APPLE_property_attribute</td>
176 <td width=200 >0x3feb</td>
177 <td width=200 >Constant</td>
183 <!-- *********************************************************************** -->
185 <a name="newconstants">New DWARF Constants</a>
187 <!-- *********************************************************************** -->
190 <table border="1" cellspacing="0">
192 <th width=200 >Name</th>
193 <th width=200 >Value</th>
196 <td width=200 >DW_AT_APPLE_PROPERTY_readonly</td>
197 <td width=200 >0x1</td>
200 <td width=200 >DW_AT_APPLE_PROPERTY_readwrite</td>
201 <td width=200 >0x2</td>
204 <td width=200 >DW_AT_APPLE_PROPERTY_assign</td>
205 <td width=200 >0x4</td>
208 <td width=200 >DW_AT_APPLE_PROPERTY_retain</td>
209 <td width=200 >0x8</td>
212 <td width=200 >DW_AT_APPLE_PROPERTY_copy</td>
213 <td width=200 >0x10</td>
216 <td width=200 >DW_AT_APPLE_PROPERTY_nonatomic</td>
217 <td width=200 >0x20</td>
223 <!-- *********************************************************************** -->
227 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
228 src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"></a>
229 <a href="http://validator.w3.org/check/referer"><img
230 src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a>
232 <a href="http://llvm.org/">LLVM Compiler Infrastructure</a><br>
233 Last modified: $Date: 2011-11-14 $