@@ -142,17 +142,25 @@ impl DebugContext {
142
142
let entry_id = self . dwarf . unit . add ( scope, gimli:: DW_TAG_subprogram ) ;
143
143
let entry = self . dwarf . unit . get_mut ( entry_id) ;
144
144
let name_id = self . dwarf . strings . add ( name) ;
145
- // Gdb requires DW_AT_name. Otherwise the DW_TAG_subprogram is skipped.
146
- entry. set ( gimli:: DW_AT_name , AttributeValue :: StringRef ( name_id) ) ;
147
- entry. set ( gimli:: DW_AT_linkage_name , AttributeValue :: StringRef ( name_id) ) ;
145
+
146
+ // These will be replaced in FunctionDebugContext::finalize. They are
147
+ // only defined here to ensure that the order of the attributes matches
148
+ // rustc.
149
+ entry. set ( gimli:: DW_AT_low_pc , AttributeValue :: Udata ( 0 ) ) ;
150
+ entry. set ( gimli:: DW_AT_high_pc , AttributeValue :: Udata ( 0 ) ) ;
148
151
149
152
let mut frame_base_expr = Expression :: new ( ) ;
150
153
frame_base_expr. op_reg ( self . stack_pointer_register ) ;
151
154
entry. set ( gimli:: DW_AT_frame_base , AttributeValue :: Exprloc ( frame_base_expr) ) ;
152
155
156
+ // Gdb requires DW_AT_name. Otherwise the DW_TAG_subprogram is skipped.
157
+ // FIXME only include the function name and not the full mangled symbol
158
+ entry. set ( gimli:: DW_AT_name , AttributeValue :: StringRef ( name_id) ) ;
159
+
153
160
entry. set ( gimli:: DW_AT_decl_file , AttributeValue :: FileIndex ( Some ( file_id) ) ) ;
154
161
entry. set ( gimli:: DW_AT_decl_line , AttributeValue :: Udata ( line) ) ;
155
- entry. set ( gimli:: DW_AT_decl_column , AttributeValue :: Udata ( column) ) ;
162
+
163
+ // FIXME set DW_AT_external as appropriate
156
164
157
165
FunctionDebugContext {
158
166
entry_id,
0 commit comments