This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix DW_AT_decl_{file,line} on DW_TAG_imported_declaration (PR debug/39387)


On Thu, Mar 5, 2009 at 11:47 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> Since IMPORTED_DECL was introduced for PR37410 we emit wrong DW_AT_decl_line
> on DW_TAG_imported* DIEs. ?input_location is usually the end of the current
> function, the correct location of the using namespace XXX directive is
> recorded in DECL_SOURCE_LOCATION of the IMPORTED_DECL (comes from
> USING_STMT's EXPR_LOCATION).
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?

Ok.

Thanks.
Richard.

> 2009-03-05 ?Jakub Jelinek ?<jakub@redhat.com>
>
> ? ? ? ?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.
>
> --- gcc/dwarf2out.c.jj ?2009-03-02 09:45:47.000000000 +0100
> +++ gcc/dwarf2out.c ? ? 2009-03-05 22:14:54.000000000 +0100
> @@ -15490,7 +15490,10 @@ dwarf2out_imported_module_or_decl_1 (tre
> ? ? ? ? ? ? ? ? ? ? ? ? ? ?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)
>
> ? ? ? ?Jakub
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]