This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Ensure incoming location is available in debug info for parameters (PR debug/49382)
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, Jan Kratochvil <jkratoch at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Tue, 14 Jun 2011 10:27:49 -0600
- Subject: Re: [PATCH] Ensure incoming location is available in debug info for parameters (PR debug/49382)
- References: <20110614155101.GD17079@tyan-ft48-01.lab.bos.redhat.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/14/11 09:51, Jakub Jelinek wrote:
> Hi!
>
> As detailed in the PR, when gdb attempts to print originally passed
> values to parameters instead of current values using call site info,
> if the parameter is modified already before the first real instruction
> in the function, it will find there already the modified value.
> E.g. void foo (int x) { x++; }
> or the larger testcase in the PR where first insn in the function
> is call (x++); and x is unused afterwards.
> In this case we say x lives in DW_OP_breg5 1 DW_OP_stack_value
> from the beginning of the function till the end (in the first case)
> or middle of the call (in the PR testcase).
> Unfortunately that means GDB doesn't know where x has been originally
> passed and thus can't look up in call site info what was passed to it.
>
> This patch special cases the parameters, such that the very first
> location in VAR_LOCATION note will be emitted even as empty range
> and won't be optimized away even if before the first real insn
> is some other VAR_LOCATION note for the parameter.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2011-06-14 Jakub Jelinek <jakub@redhat.com>
>
> PR debug/49382
> * dwarf2out.c (dw_loc_list_node): Add force field.
> (add_var_loc_to_decl): For PARM_DECL, attempt to keep
> the incoming location in the list, even if it is modified
> before first real insn.
> (output_loc_list): Emit empty ranges with force flag set.
> (dw_loc_list): If first range of a PARM_DECL is empty,
> set force flag.
OK.
Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJN94wFAAoJEBRtltQi2kC7UcsIAJZNzCJqYUB0/axMZlooxpBq
OCZZTM1m/GRH0NZMTOx5gebvfXyJazcbM2z/tQAaYvKNfFiQNus9W3shzSDW3jzP
vIFKnc4mMZIJnulrtZ1zCrxN6ahyCj3LPgOOhoIr/FJqCjetLDIeLexlbQPST2fo
UOIscpkfL8e9QztBivkcMCMc7EDsmiwAyZeHzzUrO+WUK6vnWUpqXR0cCFwOewyv
76c+ce+7/LW6BG50PmmdvuvaDOoyz1jrj4PUNxlNTdnuYm0IwL7FA43iE0I2Vk/0
TUgBHJgYxMTijk+TeXWknRO1b0WgBMZQTIvWYknxOUyeO3P7XUIfxGmykGYr5vw=
=0NBt
-----END PGP SIGNATURE-----