From: Jakub Jelinek Date: Fri, 6 Mar 2009 09:48:25 +0000 (+0100) Subject: re PR debug/39387 (Wrong DW_AT_decl_line on DW_TAG_imported* for using directives... X-Git-Tag: releases/gcc-4.4.0~342 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c3d550c4a934d9669455aa81836772b4520e39f;p=thirdparty%2Fgcc.git re PR debug/39387 (Wrong DW_AT_decl_line on DW_TAG_imported* for using directives in C+ functions) PR debug/39387 * dwarf2out.c (dwarf2out_imported_module_or_decl_1): For IMPORTED_DECL take locus from its DECL_SOURCE_LOCATION instead of input_location. From-SVN: r144666 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d2bb30fcafe0..8809bb70f17c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-03-06 Jakub Jelinek + + PR debug/39387 + * dwarf2out.c (dwarf2out_imported_module_or_decl_1): For IMPORTED_DECL + take locus from its DECL_SOURCE_LOCATION instead of input_location. + 2009-03-05 Bernd Schmidt * config/bfin/bfin.c (bfin_discover_loop): When retrying fails, mark diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 848926b63831..22852fa94879 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15490,7 +15490,10 @@ dwarf2out_imported_module_or_decl_1 (tree decl, lexical_block_die, lexical_block); - xloc = expand_location (input_location); + if (TREE_CODE (decl) == IMPORTED_DECL) + xloc = expand_location (DECL_SOURCE_LOCATION (decl)); + else + xloc = expand_location (input_location); add_AT_file (imported_die, DW_AT_decl_file, lookup_filename (xloc.file)); add_AT_unsigned (imported_die, DW_AT_decl_line, xloc.line); if (name)